Ignore:
Timestamp:
Nov 18, 2016, 1:46:55 PM (2 years ago)
Author:
nmedfort
Message:

Merged PabloFunction? and PabloKernel? classes. Updated projects where necessary.

Location:
icGREP/icgrep-devel/icgrep/IDISA/types
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/types/streamtype.h

    r5216 r5217  
    66
    77namespace IDISA {
    8     class IDISA_Builder;
    9 }
    108
    11 namespace pablo {
     9class IDISA_Builder;
    1210
    1311class StreamType : public llvm::Type {
    1412
    15     StreamType(llvm::LLVMContext & ctx, uint64_t FieldWidth);
     13    StreamType(llvm::LLVMContext & ctx, unsigned NumElements, unsigned FieldWidth);
    1614
    1715public:
     
    2119    };
    2220
    23     static StreamType * get(llvm::LLVMContext & ctx, uint64_t FieldWidth);
     21    static StreamType * get(llvm::LLVMContext & ctx, unsigned NumElements, unsigned FieldWidth);
    2422
    25     llvm::Type * resolveType(IDISA::IDISA_Builder * const iBuilder);
     23    unsigned getNumElements() const {
     24        return mNumElements;
     25    }
     26
     27    unsigned getFieldWidth() const {
     28        return mFieldWidth;
     29    }
     30
     31    StreamType * getStreamElementType() const {
     32        return get(getContext(), 1, mFieldWidth);
     33    }
     34
     35    llvm::Type * resolveType(IDISA_Builder * const iBuilder);
    2636
    2737    /// Methods for support type inquiry through isa, cast, and dyn_cast.
     
    3343    }
    3444private:
    35 
    36     uint64_t mFieldWidth;
    37     uint64_t mNumElements;
    38 
     45    unsigned mNumElements;
     46    unsigned mFieldWidth;
    3947};
    4048
    4149}
    4250
    43 inline llvm::Type * getStreamTy(const uint64_t FieldWidth = 1, const uint64_t NumElements = 1) {
    44     llvm::Type * ty = pablo::StreamType::get(llvm::getGlobalContext(), FieldWidth);
    45     if (NumElements > 1) {
    46         ty = llvm::ArrayType::get(ty, NumElements);
    47     }
    48     return ty;
    49 }
    50 
    51 inline llvm::Type * getScalarTy(const uint64_t FieldWidth = 0) {
    52     return llvm::Type::getIntNTy(llvm::getGlobalContext(), FieldWidth);
    53 }
    54 
    5551#endif // STREAMTYPE_H
Note: See TracChangeset for help on using the changeset viewer.