Ignore:
Timestamp:
Jan 14, 2018, 1:57:43 AM (12 months ago)
Author:
nmedfort
Message:

UntilN kernel rewritten to use new MultiBlock? system

File:
1 edited

Legend:

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

    r5828 r5830  
    538538
    539539Value * IDISA_Builder::bitblock_mask_from(Value * pos) {
    540     Type * bitBlockInt = getIntNTy(getBitBlockWidth());
    541     return bitCast(CreateShl(ConstantInt::getAllOnesValue(bitBlockInt), CreateZExt(pos, bitBlockInt)));
    542    
    543 }
     540    Type * const ty = getIntNTy(getBitBlockWidth());
     541    Constant * const ONES = ConstantInt::getAllOnesValue(ty);
     542    Constant * const ZEROES = ConstantInt::getNullValue(ty);
     543    Constant * const BIT_BLOCK_WIDTH = ConstantInt::get(pos->getType(), getBitBlockWidth());
     544    Value * const mask = CreateSelect(CreateICmpULT(pos, BIT_BLOCK_WIDTH), CreateShl(ONES, CreateZExt(pos, ty)), ZEROES);
     545    return bitCast(mask);
     546}
     547
    544548Value * IDISA_Builder::bitblock_set_bit(Value * pos) {
    545     Type * bitBlockInt = getIntNTy(getBitBlockWidth());
    546     return bitCast(CreateShl(ConstantInt::get(bitBlockInt, 1), CreateZExt(pos, bitBlockInt)));
     549    Type * const ty = getIntNTy(getBitBlockWidth());
     550    return bitCast(CreateShl(ConstantInt::get(ty, 1), CreateZExt(pos, ty)));
    547551}
    548552
Note: See TracChangeset for help on using the changeset viewer.