Changeset 4895


Ignore:
Timestamp:
Dec 15, 2015, 7:47:23 AM (2 years ago)
Author:
cameron
Message:

hi_mask in s2p, lo_mask

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

Legend:

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

    r4894 r4895  
    3636}
    3737
    38 Constant * IDISA_Builder::simd_himask(unsigned fw) {
    39     return Constant::getIntegerValue(mLLVMBuilder->getIntNTy(mBitBlockWidth), APInt::getSplat(mBitBlockWidth, APInt::getHighBitsSet(fw, fw/2)));
    40 }
    41 
    42 Value * IDISA_Builder::simd_add(unsigned fw, Value * a, Value * b) {
     38    Constant * IDISA_Builder::simd_himask(unsigned fw) {
     39        return Constant::getIntegerValue(mLLVMBuilder->getIntNTy(mBitBlockWidth), APInt::getSplat(mBitBlockWidth, APInt::getHighBitsSet(fw, fw/2)));
     40    }
     41   
     42    Constant * IDISA_Builder::simd_lomask(unsigned fw) {
     43        return Constant::getIntegerValue(mLLVMBuilder->getIntNTy(mBitBlockWidth), APInt::getSplat(mBitBlockWidth, APInt::getLowBitsSet(fw, fw/2)));
     44    }
     45   
     46    Value * IDISA_Builder::simd_add(unsigned fw, Value * a, Value * b) {
    4347    return mLLVMBuilder->CreateAdd(fwCast(fw, a), fwCast(fw, b));
    4448}
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.h

    r4894 r4895  
    4747    Constant * allOnes() {return mOneInitializer;}
    4848    Constant * simd_himask(unsigned fw);
     49    Constant * simd_lomask(unsigned fw);
    4950       
    5051    virtual Value * simd_add(unsigned fw, Value * a, Value * b);
  • icGREP/icgrep-devel/icgrep/IDISA/s2p_gen.cpp

    r4891 r4895  
    1919    Value * bit00224466_0,bit00224466_1,bit00224466_2,bit00224466_3;
    2020    Value * bit11335577_0,bit11335577_1,bit11335577_2,bit11335577_3;
    21     Value *  bit00004444_0,bit22226666_0,bit00004444_1,bit22226666_1;
    22     Value *  bit11115555_0,bit33337777_0,bit11115555_1,bit33337777_1;
    23     s2p_step(iBuilder, s0,s1,simd<2>::himask(),1,bit00224466_0,bit11335577_0);
    24     s2p_step(iBuilder, s2,s3,simd<2>::himask(),1,bit00224466_1,bit11335577_1);
    25     s2p_step(iBuilder, s4,s5,simd<2>::himask(),1,bit00224466_2,bit11335577_2);
    26     s2p_step(iBuilder, s6,s7,simd<2>::himask(),1,bit00224466_3,bit11335577_3);
    27     s2p_step(iBuilder, bit00224466_0,bit00224466_1,simd<4>::himask(),2,bit00004444_0,bit22226666_0);
    28     s2p_step(iBuilder, bit00224466_2,bit00224466_3,simd<4>::himask(),2,bit00004444_1,bit22226666_1);
    29     s2p_step(iBuilder, bit11335577_0,bit11335577_1,simd<4>::himask(),2,bit11115555_0,bit33337777_0);
    30     s2p_step(iBuilder, bit11335577_2,bit11335577_3,simd<4>::himask(),2,bit11115555_1,bit33337777_1);
    31     s2p_step(iBuilder, bit00004444_0,bit00004444_1,simd<8>::himask(),4,p0,p4);
    32     s2p_step(iBuilder, bit11115555_0,bit11115555_1,simd<8>::himask(),4,p1,p5);
    33     s2p_step(iBuilder, bit22226666_0,bit22226666_1,simd<8>::himask(),4,p2,p6);
    34     s2p_step(iBuilder, bit33337777_0,bit33337777_1,simd<8>::himask(),4,p3,p7);
     21    Value * bit00004444_0,bit22226666_0,bit00004444_1,bit22226666_1;
     22    Value * bit11115555_0,bit33337777_0,bit11115555_1,bit33337777_1;
     23    Value * hi_mask2 = iBuilder->simd_himask(2);
     24    Value * hi_mask4 = iBuilder->simd_himask(4);
     25    Value * hi_mask8 = iBuilder->simd_himask(8);
     26    s2p_step(iBuilder, s0,s1,hi_mask2,1,bit00224466_0,bit11335577_0);
     27    s2p_step(iBuilder, s2,s3,hi_mask2,1,bit00224466_1,bit11335577_1);
     28    s2p_step(iBuilder, s4,s5,hi_mask2,1,bit00224466_2,bit11335577_2);
     29    s2p_step(iBuilder, s6,s7,hi_mask2,1,bit00224466_3,bit11335577_3);
     30    s2p_step(iBuilder, bit00224466_0,bit00224466_1,hi_mask4,2,bit00004444_0,bit22226666_0);
     31    s2p_step(iBuilder, bit00224466_2,bit00224466_3,hi_mask4,2,bit00004444_1,bit22226666_1);
     32    s2p_step(iBuilder, bit11335577_0,bit11335577_1,hi_mask4,2,bit11115555_0,bit33337777_0);
     33    s2p_step(iBuilder, bit11335577_2,bit11335577_3,hi_mask4,2,bit11115555_1,bit33337777_1);
     34    s2p_step(iBuilder, bit00004444_0,bit00004444_1,hi_mask8,4,p0,p4);
     35    s2p_step(iBuilder, bit11115555_0,bit11115555_1,hi_mask8,4,p1,p5);
     36    s2p_step(iBuilder, bit22226666_0,bit22226666_1,hi_mask8,4,p2,p6);
     37    s2p_step(iBuilder, bit33337777_0,bit33337777_1,hi_mask8,4,p3,p7);
    3538}
Note: See TracChangeset for help on using the changeset viewer.