Ignore:
Timestamp:
Jun 13, 2018, 9:51:17 PM (10 months ago)
Author:
cameron
Message:

IDISA builder updates for esimd_mergel/h

File:
1 edited

Legend:

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

    r6083 r6087  
    758758}
    759759
     760
     761Constant * IDISA_Builder::bit_interleave_byteshuffle_table(unsigned fw) {
     762    const unsigned fieldCount = mBitBlockWidth/8;
     763    if (fw > 2) llvm::report_fatal_error("bit_interleave_byteshuffle_table requires fw == 1 or fw == 2");
     764    // Bit interleave using shuffle.
     765    // Make a shuffle table that translates the lower 4 bits of each byte in
     766    // order to spread out the bits: xxxxdcba => .d.c.b.a (fw = 1)
     767    Constant * bit_interleave[fieldCount];
     768    for (unsigned i = 0; i < fieldCount; i++) {
     769        if (fw == 1)
     770            bit_interleave[i] = getInt8((i & 1) | ((i & 2) << 1) | ((i & 4) << 2) | ((i & 8) << 3));
     771        else bit_interleave[i] = getInt8((i & 3) | ((i & 0x0C) << 2));
     772    }
     773    return ConstantVector::get({bit_interleave, fieldCount});
     774}
     775
     776
    760777IDISA_Builder::IDISA_Builder(LLVMContext & C, unsigned vectorWidth, unsigned stride)
    761778: CBuilder(C)
Note: See TracChangeset for help on using the changeset viewer.