Ignore:
Timestamp:
Sep 8, 2014, 6:22:08 PM (4 years ago)
Author:
linmengl
Message:

add some more lib files; add tests for long stream addition.

File:
1 edited

Legend:

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

    r4076 r4138  
    7979
    8080
    81 ; long add/shift
     81; long stream add/shift
     82declare {i128, i1} @llvm.uadd.with.overflow.i128(i128 %a, i128 %b)
     83
     84define void @uadd_with_overflow_i128(<2 x i64> %a, <2 x i64> %b, <2 x i64>* %P, i8* %B) {
     85entry:
     86  %aa = bitcast <2 x i64> %a to i128
     87  %bb = bitcast <2 x i64> %b to i128
     88
     89  %res = call {i128, i1} @llvm.uadd.with.overflow.i128(i128 %aa, i128 %bb)
     90  %sum = extractvalue {i128, i1} %res, 0
     91  %obit = extractvalue {i128, i1} %res, 1
     92  %obit8 = zext i1 %obit to i8
     93
     94  %r = bitcast i128 %sum to <2 x i64>
     95
     96  store <2 x i64> %r, <2 x i64>* %P
     97  store i8 %obit8, i8* %B
     98
     99  ret void
     100}
     101
    82102define <4 x i32> @add_128(<4 x i32> %a, <4 x i32> %b) {
    83103entry:
     
    98118}
    99119
     120define i32 @sign_mask_64(<2 x i64> %a) {
     121entry:
     122  %aa = icmp slt <2 x i64> %a, zeroinitializer
     123  %a1 = bitcast <2 x i1> %aa to i2
     124  %a2 = zext i2 %a1 to i32
     125  ret i32 %a2
     126}
Note: See TracChangeset for help on using the changeset viewer.