Skip to content

Commit b72fa04

Browse files
committed
[AArch64][GlobalISel] Add test coverage for more adc / ands instructions. NFC
1 parent 3466cdb commit b72fa04

File tree

4 files changed

+250
-110
lines changed

4 files changed

+250
-110
lines changed

llvm/test/CodeGen/AArch64/adc.ll

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -verify-machineinstrs < %s -mtriple=arm64-apple-ios7.0 | FileCheck --check-prefix=CHECK-LE %s
3-
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64_be-none-linux-gnu | FileCheck --check-prefix=CHECK-BE %s
2+
; RUN: llc -verify-machineinstrs < %s -mtriple=arm64-apple-ios7.0 | FileCheck --check-prefixes=CHECK-LE %s
3+
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64_be-none-linux-gnu | FileCheck --check-prefixes=CHECK-BE %s
4+
; RUN: llc -verify-machineinstrs < %s -mtriple=arm64-apple-ios7.0 -global-isel | FileCheck --check-prefixes=CHECK-GI %s
45

56
define i128 @test_simple(i128 %a, i128 %b, i128 %c) {
67
; CHECK-LE-LABEL: test_simple:
@@ -18,11 +19,16 @@ define i128 @test_simple(i128 %a, i128 %b, i128 %c) {
1819
; CHECK-BE-NEXT: subs x1, x8, x5
1920
; CHECK-BE-NEXT: sbc x0, x9, x4
2021
; CHECK-BE-NEXT: ret
21-
22+
;
23+
; CHECK-GI-LABEL: test_simple:
24+
; CHECK-GI: ; %bb.0:
25+
; CHECK-GI-NEXT: adds x8, x0, x2
26+
; CHECK-GI-NEXT: adc x9, x1, x3
27+
; CHECK-GI-NEXT: subs x0, x8, x4
28+
; CHECK-GI-NEXT: sbc x1, x9, x5
29+
; CHECK-GI-NEXT: ret
2230
%valadd = add i128 %a, %b
23-
2431
%valsub = sub i128 %valadd, %c
25-
2632
ret i128 %valsub
2733
}
2834

@@ -38,9 +44,13 @@ define i128 @test_imm(i128 %a) {
3844
; CHECK-BE-NEXT: adds x1, x1, #12
3945
; CHECK-BE-NEXT: cinc x0, x0, hs
4046
; CHECK-BE-NEXT: ret
41-
47+
;
48+
; CHECK-GI-LABEL: test_imm:
49+
; CHECK-GI: ; %bb.0:
50+
; CHECK-GI-NEXT: adds x0, x0, #12
51+
; CHECK-GI-NEXT: adc x1, x1, xzr
52+
; CHECK-GI-NEXT: ret
4253
%val = add i128 %a, 12
43-
4454
ret i128 %val
4555
}
4656

@@ -58,11 +68,16 @@ define i128 @test_shifted(i128 %a, i128 %b) {
5868
; CHECK-BE-NEXT: adds x1, x1, x3, lsl #45
5969
; CHECK-BE-NEXT: adc x0, x0, x8
6070
; CHECK-BE-NEXT: ret
61-
71+
;
72+
; CHECK-GI-LABEL: test_shifted:
73+
; CHECK-GI: ; %bb.0:
74+
; CHECK-GI-NEXT: lsr x8, x2, #19
75+
; CHECK-GI-NEXT: adds x0, x0, x2, lsl #45
76+
; CHECK-GI-NEXT: orr x8, x8, x3, lsl #45
77+
; CHECK-GI-NEXT: adc x1, x1, x8
78+
; CHECK-GI-NEXT: ret
6279
%rhs = shl i128 %b, 45
63-
6480
%val = add i128 %a, %rhs
65-
6681
ret i128 %val
6782
}
6883

@@ -86,11 +101,19 @@ define i128 @test_extended(i128 %a, i16 %b) {
86101
; CHECK-BE-NEXT: extr x8, x9, x8, #61
87102
; CHECK-BE-NEXT: adc x0, x0, x8
88103
; CHECK-BE-NEXT: ret
89-
104+
;
105+
; CHECK-GI-LABEL: test_extended:
106+
; CHECK-GI: ; %bb.0:
107+
; CHECK-GI-NEXT: ; kill: def $w2 killed $w2 def $x2
108+
; CHECK-GI-NEXT: sxth x8, w2
109+
; CHECK-GI-NEXT: adds x0, x0, w2, sxth #3
110+
; CHECK-GI-NEXT: asr x9, x8, #63
111+
; CHECK-GI-NEXT: lsr x8, x8, #61
112+
; CHECK-GI-NEXT: orr x8, x8, x9, lsl #3
113+
; CHECK-GI-NEXT: adc x1, x1, x8
114+
; CHECK-GI-NEXT: ret
90115
%ext = sext i16 %b to i128
91116
%rhs = shl i128 %ext, 3
92-
93117
%val = add i128 %a, %rhs
94-
95118
ret i128 %val
96119
}
Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s | FileCheck %s
2+
; RUN: llc < %s | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3+
; RUN: llc < %s -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI
4+
35
target triple = "arm64-apple-ios7.0"
46

57
define i64 @foo(ptr nocapture readonly %ptr, i64 %a, i64 %b, i64 %c) local_unnamed_addr #0 {
6-
; CHECK-LABEL: foo:
7-
; CHECK: ; %bb.0: ; %entry
8-
; CHECK-NEXT: lsr x8, x1, #32
9-
; CHECK-NEXT: ldr w9, [x0, #4]
10-
; CHECK-NEXT: cmn x3, x2
11-
; CHECK-NEXT: umull x8, w9, w8
12-
; CHECK-NEXT: cinc x0, x8, hs
13-
; CHECK-NEXT: ret
8+
; CHECK-SD-LABEL: foo:
9+
; CHECK-SD: ; %bb.0: ; %entry
10+
; CHECK-SD-NEXT: lsr x8, x1, #32
11+
; CHECK-SD-NEXT: ldr w9, [x0, #4]
12+
; CHECK-SD-NEXT: cmn x3, x2
13+
; CHECK-SD-NEXT: umull x8, w9, w8
14+
; CHECK-SD-NEXT: cinc x0, x8, hs
15+
; CHECK-SD-NEXT: ret
16+
;
17+
; CHECK-GI-LABEL: foo:
18+
; CHECK-GI: ; %bb.0: ; %entry
19+
; CHECK-GI-NEXT: ldr x8, [x0]
20+
; CHECK-GI-NEXT: lsr x9, x1, #32
21+
; CHECK-GI-NEXT: cmn x3, x2
22+
; CHECK-GI-NEXT: cset w10, hs
23+
; CHECK-GI-NEXT: lsr x8, x8, #32
24+
; CHECK-GI-NEXT: and x10, x10, #0x1
25+
; CHECK-GI-NEXT: umaddl x0, w8, w9, x10
26+
; CHECK-GI-NEXT: ret
1427
entry:
1528
%0 = lshr i64 %a, 32
1629
%1 = load i64, ptr %ptr, align 8
@@ -24,3 +37,6 @@ entry:
2437
}
2538

2639
attributes #0 = { norecurse nounwind readonly }
40+
41+
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
42+
; CHECK: {{.*}}

llvm/test/CodeGen/AArch64/arm64-vabs.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple | FileCheck -check-prefixes=CHECK,CHECK-SD %s
2+
; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple | FileCheck %s -check-prefixes=CHECK,CHECK-SD
33
; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI
44

55
define <8 x i16> @sabdl8h(ptr %A, ptr %B) nounwind {

0 commit comments

Comments
 (0)