1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; Test 128-bit addition on z13 and higher
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 define zeroext i1 @f1(i128 %a, i128 %b, ptr %res) {
9 ; CHECK-NEXT: vl %v0, 0(%r3), 3
10 ; CHECK-NEXT: vl %v1, 0(%r2), 3
11 ; CHECK-NEXT: vaccq %v2, %v1, %v0
12 ; CHECK-NEXT: vlgvg %r2, %v2, 1
13 ; CHECK-NEXT: vaq %v0, %v1, %v0
14 ; CHECK-NEXT: vst %v0, 0(%r4), 3
16 %t = call {i128, i1} @llvm.uadd.with.overflow.i128(i128 %a, i128 %b)
17 %val = extractvalue {i128, i1} %t, 0
18 %obit = extractvalue {i128, i1} %t, 1
19 store i128 %val, ptr %res
23 define zeroext i1 @f2(i128 %a, i128 %b) {
26 ; CHECK-NEXT: vl %v0, 0(%r3), 3
27 ; CHECK-NEXT: vl %v1, 0(%r2), 3
28 ; CHECK-NEXT: vaccq %v0, %v1, %v0
29 ; CHECK-NEXT: vlgvg %r2, %v0, 1
31 %t = call {i128, i1} @llvm.uadd.with.overflow.i128(i128 %a, i128 %b)
32 %obit = extractvalue {i128, i1} %t, 1
36 define i128 @f3(i128 %a, i128 %b) {
39 ; CHECK-NEXT: vl %v0, 0(%r4), 3
40 ; CHECK-NEXT: vl %v1, 0(%r3), 3
41 ; CHECK-NEXT: vaq %v0, %v1, %v0
42 ; CHECK-NEXT: vst %v0, 0(%r2), 3
44 %t = call {i128, i1} @llvm.uadd.with.overflow.i128(i128 %a, i128 %b)
45 %val = extractvalue {i128, i1} %t, 0
49 declare {i128, i1} @llvm.uadd.with.overflow.i128(i128, i128) nounwind readnone