Ignore:
Timestamp:
Nov 6, 2014, 6:24:05 PM (5 years ago)
Author:
linmengl
Message:

add tests for long shift right and dslli

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib_ir/gen/llc_func.pytemplate.ll

    r4278 r4296  
    178178 
    179179 
     180{% for sh in LongShiftAmount128 %}
     181define <4 x i32> @long_shift_right_{{sh}}(<4 x i32> %a) {
     182entry:
     183  %aa = bitcast <4 x i32> %a to i128
     184  %c = lshr i128 %aa, {{sh}}
     185  %cc = bitcast i128 %c to <4 x i32>
     186  ret <4 x i32> %cc
     187}
     188{% endfor %}
     189
     190{% for sh in LongShiftAmount128 %}
     191define <4 x i32> @long_shift_dslli_{{sh}}(<4 x i32> %a, <4 x i32> %b) {
     192entry:
     193  %aa = bitcast <4 x i32> %a to i128
     194  %bb = bitcast <4 x i32> %b to i128
     195
     196  %c = shl i128 %aa, {{sh}}
     197  %d = lshr i128 %bb, {{128 - sh}}
     198  %e = or i128 %c, %d
     199
     200  %cc = bitcast i128 %e to <4 x i32>
     201  ret <4 x i32> %cc
     202}
     203{% endfor %}
Note: See TracChangeset for help on using the changeset viewer.