Ignore:
Timestamp:
Jan 18, 2018, 1:34:55 PM (16 months ago)
Author:
cameron
Message:

Pablo packh/packl and transposition with -enable-pablo-s2p

File:
1 edited

Legend:

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

    r5832 r5837  
    353353
    354354Value * IDISA_Builder::hsimd_packh(unsigned fw, Value * a, Value * b) {
    355     if (fw < 8) report_fatal_error("Unsupported field width: packh " + std::to_string(fw));
     355    if (fw <= 8) {
     356        const unsigned fw_wkg = 32;
     357        Value * aLo = simd_srli(fw_wkg, a, fw/2);
     358        Value * bLo = simd_srli(fw_wkg, b, fw/2);
     359        return hsimd_packl(fw, aLo, bLo);
     360    }
    356361    Value * aVec = fwCast(fw/2, a);
    357362    Value * bVec = fwCast(fw/2, b);
     
    365370
    366371Value * IDISA_Builder::hsimd_packl(unsigned fw, Value * a, Value * b) {
    367     if (fw < 8) report_fatal_error("Unsupported field width: packl " + std::to_string(fw));
     372    if (fw <= 8) {
     373        const unsigned fw_wkg = 64;
     374        Value * aLo = simd_srli(fw_wkg, a, fw/2);
     375        Value * bLo = simd_srli(fw_wkg, b, fw/2);
     376        return hsimd_packl(fw*2,
     377                           bitCast(simd_or(simd_and(simd_himask(fw), aLo), simd_and(simd_lomask(fw), a))),
     378                           bitCast(simd_or(simd_and(simd_himask(fw), bLo), simd_and(simd_lomask(fw), b))));
     379    }
    368380    Value * aVec = fwCast(fw/2, a);
    369381    Value * bVec = fwCast(fw/2, b);
Note: See TracChangeset for help on using the changeset viewer.