Changeset 5975 for icGREP


Ignore:
Timestamp:
Apr 18, 2018, 6:32:08 AM (15 months ago)
Author:
cameron
Message:

Use AVX512F as foundation class, adopting Cole's approach

Location:
icGREP/icgrep-devel/icgrep/IR_Gen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_avx_builder.cpp

    r5931 r5975  
    256256}
    257257
    258 std::string IDISA_AVX512BW_Builder::getBuilderUniqueName() {
    259     return mBitBlockWidth != 512 ? "AVX512BW_" + std::to_string(mBitBlockWidth) : "AVX512BW";
    260 }
    261 
    262 llvm::Value * IDISA_AVX512BW_Builder::hsimd_packh(unsigned fw, llvm::Value * a, llvm::Value * b) {
     258std::string IDISA_AVX512F_Builder::getBuilderUniqueName() {
     259    return mBitBlockWidth != 512 ? "AVX512F_" + std::to_string(mBitBlockWidth) : "AVX512BW";
     260}
     261
     262llvm::Value * IDISA_AVX512F_Builder::hsimd_packh(unsigned fw, llvm::Value * a, llvm::Value * b) {
    263263    if ((mBitBlockWidth == 512) && (fw == 16)) {
    264264
     
    288288}
    289289
    290 llvm::Value * IDISA_AVX512BW_Builder::hsimd_packl(unsigned fw, llvm::Value * a, llvm::Value * b) {
     290llvm::Value * IDISA_AVX512F_Builder::hsimd_packl(unsigned fw, llvm::Value * a, llvm::Value * b) {
    291291    if ((mBitBlockWidth == 512) && (fw == 16)) {
    292292
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_avx_builder.h

    r5931 r5975  
    5252};
    5353
    54 class IDISA_AVX512BW_Builder : public IDISA_AVX2_Builder {
     54class IDISA_AVX512F_Builder : public IDISA_AVX2_Builder {
    5555public:
    5656
    57     IDISA_AVX512BW_Builder(llvm::LLVMContext & C, unsigned vectorWidth, unsigned stride)
     57    IDISA_AVX512F_Builder(llvm::LLVMContext & C, unsigned vectorWidth, unsigned stride)
    5858    : IDISA_Builder(C, vectorWidth, stride)
    5959    , IDISA_AVX2_Builder(C, vectorWidth, stride) {
     
    6464    llvm::Value * hsimd_packl(unsigned fw, llvm::Value * a, llvm::Value * b) override;
    6565   
    66     ~IDISA_AVX512BW_Builder() {}
     66    ~IDISA_AVX512F_Builder() {}
    6767};
    6868
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.cpp

    r5871 r5975  
    2222    bool hasAVX;
    2323    bool hasAVX2;
    24     bool hasAVX512BW;
    25     Features() : hasAVX(0), hasAVX2(0), hasAVX512BW(0) { }
     24    bool hasAVX512F;
     25    Features() : hasAVX(0), hasAVX2(0), hasAVX512F(0) { }
    2626};
    2727
     
    3232        hostCPUFeatures.hasAVX = features.lookup("avx");
    3333        hostCPUFeatures.hasAVX2 = features.lookup("avx2");
    34         hostCPUFeatures.hasAVX512BW = features.lookup("avx512bw");
    35         //if (hostCPUFeatures.hasAVX512BW) errs() << "AVX512BW detected.\n";
     34        hostCPUFeatures.hasAVX512F = features.lookup("avx512f");
    3635    }
    3736    return hostCPUFeatures;
     
    5554
    5655namespace IDISA {
    57    
     56
    5857KernelBuilder * GetIDISA_Builder(llvm::LLVMContext & C) {
    5958    const auto hostCPUFeatures = getHostCPUFeatures();
    6059    if (LLVM_LIKELY(codegen::BlockSize == 0)) {  // No BlockSize override: use processor SIMD width
    61        
    62         if (hostCPUFeatures.hasAVX512BW) codegen::BlockSize = 512;
     60
     61        if (hostCPUFeatures.hasAVX512F) codegen::BlockSize = 512;
    6362        else if (hostCPUFeatures.hasAVX2) codegen::BlockSize = 256;
    6463        else codegen::BlockSize = 128;
     
    6968    if (codegen::BlockSize >= 512) {
    7069        // AVX512BW builder can only be used for BlockSize multiples of 512
    71         if (hostCPUFeatures.hasAVX512BW) {
    72             return new KernelBuilderImpl<IDISA_AVX512BW_Builder>(C, codegen::BlockSize, codegen::BlockSize);
     70        if (hostCPUFeatures.hasAVX512F) {
     71            return new KernelBuilderImpl<IDISA_AVX512F_Builder>(C, codegen::BlockSize, codegen::BlockSize);
    7372        }
    7473    }
Note: See TracChangeset for help on using the changeset viewer.