1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; Test 256-bit subtraction 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: vscbiq %v4, %v3, %v2
14 ; CHECK-NEXT: vsbcbiq %v5, %v1, %v0, %v4
15 ; CHECK-NEXT: vlgvg %r2, %v5, 1
16 ; CHECK-NEXT: vsbiq %v0, %v1, %v0, %v4
17 ; CHECK-NEXT: vsq %v1, %v3, %v2
18 ; CHECK-NEXT: xilf %r2, 1
19 ; CHECK-NEXT: vst %v1, 16(%r4), 3
20 ; CHECK-NEXT: vst %v0, 0(%r4), 3
22 %t = call {i256, i1} @llvm.usub.with.overflow.i256(i256 %a, i256 %b)
23 %val = extractvalue {i256, i1} %t, 0
24 %obit = extractvalue {i256, i1} %t, 1
25 store i256 %val, ptr %res
29 define zeroext i1 @f2(i256 %a, i256 %b) {
32 ; CHECK-NEXT: vl %v2, 16(%r3), 3
33 ; CHECK-NEXT: vl %v3, 16(%r2), 3
34 ; CHECK-NEXT: vl %v0, 0(%r3), 3
35 ; CHECK-NEXT: vl %v1, 0(%r2), 3
36 ; CHECK-NEXT: vscbiq %v2, %v3, %v2
37 ; CHECK-NEXT: vsbcbiq %v0, %v1, %v0, %v2
38 ; CHECK-NEXT: vlgvg %r2, %v0, 1
39 ; CHECK-NEXT: xilf %r2, 1
41 %t = call {i256, i1} @llvm.usub.with.overflow.i256(i256 %a, i256 %b)
42 %obit = extractvalue {i256, i1} %t, 1
46 define i256 @f3(i256 %a, i256 %b) {
49 ; CHECK-NEXT: vl %v2, 16(%r4), 3
50 ; CHECK-NEXT: vl %v3, 16(%r3), 3
51 ; CHECK-NEXT: vl %v0, 0(%r4), 3
52 ; CHECK-NEXT: vl %v1, 0(%r3), 3
53 ; CHECK-NEXT: vscbiq %v4, %v3, %v2
54 ; CHECK-NEXT: vsbiq %v0, %v1, %v0, %v4
55 ; CHECK-NEXT: vsq %v1, %v3, %v2
56 ; CHECK-NEXT: vst %v1, 16(%r2), 3
57 ; CHECK-NEXT: vst %v0, 0(%r2), 3
59 %t = call {i256, i1} @llvm.usub.with.overflow.i256(i256 %a, i256 %b)
60 %val = extractvalue {i256, i1} %t, 0
64 declare {i256, i1} @llvm.usub.with.overflow.i256(i256, i256) nounwind readnone