Changeset 3919 for trunk/lib_ir/s2p.ll


Ignore:
Timestamp:
Jul 21, 2014, 6:12:48 PM (5 years ago)
Author:
linmengl
Message:

adding more unittests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib_ir/s2p.ll

    r3918 r3919  
    1212}
    1313
    14 define <4 x i32> @packh_16(<4 x i32> %a, <4 x i32> %b) {
     14define <4 x i32> @packh_16(<4 x i32> %a, <4 x i32> %b) alwaysinline {
    1515entry:
    1616  %aa = bitcast <4 x i32> %a to <16 x i8>
     
    2222}
    2323
    24 define <4 x i32> @packl_16(<4 x i32> %a, <4 x i32> %b) {
     24define <4 x i32> @packl_16(<4 x i32> %a, <4 x i32> %b) alwaysinline {
    2525entry:
    2626  %aa = bitcast <4 x i32> %a to <16 x i8>
     
    3030  %rr1 = bitcast <16 x i8> %rr to <4 x i32>
    3131  ret <4 x i32> %rr1
     32}
     33
     34define <4 x i32> @ifh_1(<4 x i32> %cond, <4 x i32> %b, <4 x i32> %c) alwaysinline {
     35entry:
     36  %mm = bitcast <4 x i32> %cond to <128 x i1>
     37  %bb = bitcast <4 x i32> %b to <128 x i1>
     38  %cc = bitcast <4 x i32> %c to <128 x i1>
     39
     40  %rr = select <128 x i1> %mm, <128 x i1> %bb, <128 x i1> %cc
     41  %r  = bitcast <128 x i1> %rr to <4 x i32>
     42  ret <4 x i32> %r
     43}
     44
     45define <4 x i32> @srli_16(<4 x i32> %a, <8 x i16> %shift_mask) alwaysinline {
     46entry:
     47  %aa = bitcast <4 x i32> %a to <8 x i16>
     48  %r0 = lshr <8 x i16> %aa, %shift_mask
     49  %rr = bitcast <8 x i16> %r0 to <4 x i32>
     50  ret <4 x i32> %rr
     51}
     52
     53define <4 x i32> @slli_16(<4 x i32> %a, <8 x i16> %shift_mask) alwaysinline {
     54entry:
     55  %aa = bitcast <4 x i32> %a to <8 x i16>
     56  %r0 = shl <8 x i16> %aa, %shift_mask
     57  %rr = bitcast <8 x i16> %r0 to <4 x i32>
     58  ret <4 x i32> %rr
     59}
     60
     61define void @s2p_step(<4 x i32> %s0, <4 x i32> %s1, <4 x i32> %hi_mask, <8 x i16> %shift_mask, <4 x i32>* %p0, <4 x i32>* %p1) alwaysinline {
     62entry:
     63  %t0 = call <4 x i32> @packh_16(<4 x i32> %s0, <4 x i32> %s1)
     64  %t1 = call <4 x i32> @packl_16(<4 x i32> %s0, <4 x i32> %s1)
     65
     66  %t2 = call <4 x i32> @srli_16(<4 x i32> %t1, <8 x i16> %shift_mask)
     67  %q0 = call <4 x i32> @ifh_1(<4 x i32> %hi_mask, <4 x i32> %t0, <4 x i32> %t2)
     68  %t3 = call <4 x i32> @slli_16(<4 x i32> %t0, <8 x i16> %shift_mask)
     69  %q1 = call <4 x i32> @ifh_1(<4 x i32> %hi_mask, <4 x i32> %t3, <4 x i32> %t1)
     70
     71  store <4 x i32> %q0, <4 x i32>* %p0
     72  store <4 x i32> %q1, <4 x i32>* %p1
     73
     74  ret void
    3275}
    3376
     
    137180;}
    138181
    139 ;define void @s2p_bytepack(
    140                   ;<4 x i32> %s0, <4 x i32> %s1, <4 x i32> %s2, <4 x i32> %s3,
    141                   ;<4 x i32> %s4, <4 x i32> %s5, <4 x i32> %s6, <4 x i32> %s7,
    142                   ;<4 x i32>* %p0, <4 x i32>* %p1, <4 x i32>* %p2, <4 x i32>* %p3,
    143                   ;<4 x i32>* %p4, <4 x i32>* %p5, <4 x i32>* %p6, <4 x i32>* %p7) {
    144 ;entry:
    145182
    146   ;ret void
    147 ;}
    148 
Note: See TracChangeset for help on using the changeset viewer.