Changeset 4076 for trunk


Ignore:
Timestamp:
Aug 22, 2014, 11:36:12 AM (4 years ago)
Author:
linmengl
Message:

tests for i128 add/shift

Location:
trunk/lib_ir
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib_ir/README.md

    r4042 r4076  
    2121  ".." starts from where the `run_all.py` locates.
    2222+ u8u16 tests driver is "u8u16/run_all". It requires to clone "http://u8u16.costar.sfu.ca/browser/QA" into
    23   "${PROJECT_SOURCE_DIR}/../../proto/u8u16/QA"
     23  "${PROJECT_SOURCE_DIR}/../../proto/u8u16/QA" and run `u8u16_testgen.py`.
    2424
    2525Perf xmlwf
  • trunk/lib_ir/gen/llc_func.pytemplate.ll

    r4005 r4076  
    7777}
    7878{% endfor %}
     79
     80
     81; long add/shift
     82define <4 x i32> @add_128(<4 x i32> %a, <4 x i32> %b) {
     83entry:
     84  %aa = bitcast <4 x i32> %a to i128
     85  %bb = bitcast <4 x i32> %b to i128
     86  %c = add i128 %aa, %bb
     87  %cc = bitcast i128 %c to <4 x i32>
     88  ret <4 x i32> %cc
     89}
     90
     91define <4 x i32> @sll_128(<4 x i32> %a, <4 x i32> %b) {
     92entry:
     93  %aa = bitcast <4 x i32> %a to i128
     94  %bb = bitcast <4 x i32> %b to i128
     95  %c = shl i128 %aa, %bb
     96  %cc = bitcast i128 %c to <4 x i32>
     97  ret <4 x i32> %cc
     98}
     99
  • trunk/lib_ir/gen/test_llc.pytemplate.cpp

    r4005 r4076  
    2121  short extractelement_{{ fw }}(SIMD_type a, int idx);
    2222{% endfor %}
     23
     24//long add/shift
     25SIMD_type add_128(SIMD_type a, SIMD_type b);
     26SIMD_type sll_128(SIMD_type a, SIMD_type b);
    2327}
    2428
     
    3034
    3135int main() {
    32   SIMD_type a, b, c, d;
     36  SIMD_type a, b, c, d, f;
    3337  short x, y;
    3438
     
    5963    {% for x in range(0, name.fw) %}
    6064      c = {{ name.cxx }}<{{ x }}>(a);
    61       b = mvmd<{{ name.fw }}>::fill({{ x }});
    62       d = {{ name.c }}(a, b);
     65      f = mvmd<{{ name.fw }}>::fill({{ x }});
     66      d = {{ name.c }}(a, f);
    6367      if (Store2String(c,1) != Store2String(d,1)) {
    6468        cout << "{{ name.c }} faild." << endl;
     
    8993    {% endfor %}
    9094    {% endfor %}
     95
     96    //try i128 add and shift
     97    c = simd<128>::add(a, b);
     98    d = add_128(a, b);
     99    if (Store2String(c,1) != Store2String(d,1)) {
     100      cout << "add_128 failed." << endl;
     101      return 1;
     102    }
     103
     104    {% set imm = range(0,128) | random %}
     105    c = simd<128>::slli<{{ imm }}>(a);
     106    f = mvmd<128>::fill({{ imm }});
     107    d = sll_128(a, f);
     108    if (Store2String(c,1) != Store2String(d,1)) {
     109      cout << "sll_128 failed." << endl;
     110      return 1;
     111    }
    91112  }
    92113
  • trunk/lib_ir/xmlwf/perf.txt

    r3946 r4076  
    4949
    5050===========================================
     51only compile s2p with avx. The rest is SSE2 (benefit from 3 operand command)
     52xmlwf_perf   &  3.928   &   4.372   &   4.57   &    4.861   &   5.184 \\ \hline
     53
     54===========================================
    5155use PEXT for packh_2/4/8
    5256xmlwf_perf   &  4.349   &   4.81   &    4.979   &   5.342   &   5.661 \\ \hline
Note: See TracChangeset for help on using the changeset viewer.