Ignore:
Timestamp:
Oct 31, 2014, 3:42:32 PM (5 years ago)
Author:
linmengl
Message:

add tests for i128 shift left

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib_ir/gen/test_llc.pytemplate.cpp

    r4236 r4278  
    3232{% for fw in [128]%}
    3333void uadd_with_overflow_i{{ fw }}(bitblock{{fw}}_t a, bitblock{{fw}}_t b, bitblock{{fw}}_t *sum, unsigned short *obit);
     34{% endfor %}
     35
     36{% for sh in LongShiftAmount128 %}
     37SIMD_type long_shift_left_{{sh}}(SIMD_type a);
    3438{% endfor %}
    3539}
     
    135139}
    136140
     141int test_long_shift(const SIMD_type &a)
     142{
     143  SIMD_type b, c, d;
     144  {% for sh in LongShiftAmount128 %}
     145  b = simd<128>::slli<{{sh}}>(a);
     146  c = long_shift_left_{{sh}}(a);
     147  if (to_string(b) != to_string(c)) {
     148    cout << "long_shift_left with sh = {{sh}} failed." << endl;
     149    return 1;
     150  }
     151
     152  {% endfor %}
     153
     154  return 0;
     155}
     156
    137157int main() {
    138158  SIMD_type a, b, c, d, e, f;
     
    216236    if (test_long_stream_addition(a, b))
    217237      return 1;
     238
     239    if (test_long_shift(a))
     240      return 1;
    218241  }
    219242
Note: See TracChangeset for help on using the changeset viewer.