1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; Test 256-bit addition on z13 and higher
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 define zeroext i1 @f1(i256 %a, i256 %b, ptr %res) {
9 ; CHECK-NEXT: vl %v2, 16(%r3), 3
10 ; CHECK-NEXT: vl %v3, 16(%r2), 3
11 ; CHECK-NEXT: vl %v0, 0(%r3), 3
12 ; CHECK-NEXT: vl %v1, 0(%r2), 3
13 ; CHECK-NEXT: vaccq %v4, %v3, %v2
14 ; CHECK-NEXT: vacccq %v5, %v1, %v0, %v4
15 ; CHECK-NEXT: vlgvg %r2, %v5, 1
16 ; CHECK-NEXT: vacq %v0, %v1, %v0, %v4
17 ; CHECK-NEXT: vaq %v1, %v3, %v2
18 ; CHECK-NEXT: vst %v1, 16(%r4), 3
19 ; CHECK-NEXT: vst %v0, 0(%r4), 3
21 %t = call {i256, i1} @llvm.uadd.with.overflow.i256(i256 %a, i256 %b)
22 %val = extractvalue {i256, i1} %t, 0
23 %obit = extractvalue {i256, i1} %t, 1
24 store i256 %val, ptr %res
28 define zeroext i1 @f2(i256 %a, i256 %b) {
31 ; CHECK-NEXT: vl %v2, 16(%r3), 3
32 ; CHECK-NEXT: vl %v3, 16(%r2), 3
33 ; CHECK-NEXT: vl %v0, 0(%r3), 3
34 ; CHECK-NEXT: vl %v1, 0(%r2), 3
35 ; CHECK-NEXT: vaccq %v2, %v3, %v2
36 ; CHECK-NEXT: vacccq %v0, %v1, %v0, %v2
37 ; CHECK-NEXT: vlgvg %r2, %v0, 1
39 %t = call {i256, i1} @llvm.uadd.with.overflow.i256(i256 %a, i256 %b)
40 %obit = extractvalue {i256, i1} %t, 1
44 define i256 @f3(i256 %a, i256 %b) {
47 ; CHECK-NEXT: vl %v2, 16(%r4), 3
48 ; CHECK-NEXT: vl %v3, 16(%r3), 3
49 ; CHECK-NEXT: vl %v0, 0(%r4), 3
50 ; CHECK-NEXT: vl %v1, 0(%r3), 3
51 ; CHECK-NEXT: vaccq %v4, %v3, %v2
52 ; CHECK-NEXT: vacq %v0, %v1, %v0, %v4
53 ; CHECK-NEXT: vaq %v1, %v3, %v2
54 ; CHECK-NEXT: vst %v1, 16(%r2), 3
55 ; CHECK-NEXT: vst %v0, 0(%r2), 3
57 %t = call {i256, i1} @llvm.uadd.with.overflow.i256(i256 %a, i256 %b)
58 %val = extractvalue {i256, i1} %t, 0
62 declare {i256, i1} @llvm.uadd.with.overflow.i256(i256, i256) nounwind readnone