source: trunk/lib_ir/gen/llc_func_256.ll @ 4238

Last change on this file since 4238 was 4238, checked in by linmengl, 5 years ago

add test code for long stream addition i256, test passed.

File size: 820 bytes
Line 
1declare {i256, i1} @llvm.uadd.with.overflow.carryin.i256(i256 %a, i256 %b, i1 %carryin)
2
3define void @add_with_carry_ir_better(<4 x i64> %a, <4 x i64> %b, <4 x i64> %carry_in, <4 x i64>* %carry_out, <4 x i64>* %sum) {
4entry:
5  %aa = bitcast <4 x i64> %a to i256
6  %bb = bitcast <4 x i64> %b to i256
7  %cc = bitcast <4 x i64> %carry_in to i256
8  %cin = trunc i256 %cc to i1
9
10  %res1 = call {i256, i1} @llvm.uadd.with.overflow.carryin.i256(i256 %aa, i256 %bb, i1 %cin)
11  %sum1 = extractvalue {i256, i1} %res1, 0
12  %obit = extractvalue {i256, i1} %res1, 1
13
14  %ret_sum = bitcast i256 %sum1 to <4 x i64>
15  %obit_64 = zext i1 %obit to i64
16  %obit_2x64 = insertelement <4 x i64> zeroinitializer, i64 %obit_64, i32 0
17
18  store <4 x i64> %ret_sum, <4 x i64>* %sum
19  store <4 x i64> %obit_2x64, <4 x i64>* %carry_out
20
21  ret void
22}
Note: See TracBrowser for help on using the repository browser.