|
2 | 2 | ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple | FileCheck -check-prefixes=CHECK,CHECK-SD %s |
3 | 3 | ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple -global-isel -global-isel-abort=2 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI |
4 | 4 |
|
5 | | -; CHECK-GI: warning: Instruction selection used fallback path for abs_8b |
6 | | -; CHECK-GI-NEXT: warning: Instruction selection used fallback path for abs_16b |
7 | | -; CHECK-GI-NEXT: warning: Instruction selection used fallback path for abs_4h |
8 | | -; CHECK-GI-NEXT: warning: Instruction selection used fallback path for abs_8h |
9 | | -; CHECK-GI-NEXT: warning: Instruction selection used fallback path for abs_2s |
10 | | -; CHECK-GI-NEXT: warning: Instruction selection used fallback path for abs_4s |
11 | | -; CHECK-GI-NEXT: warning: Instruction selection used fallback path for abs_1d |
12 | | -; CHECK-GI-NEXT: warning: Instruction selection used fallback path for abs_1d_honestly |
13 | | -; CHECK-GI-NEXT: warning: Instruction selection used fallback path for fabds |
| 5 | +; CHECK-GI: warning: Instruction selection used fallback path for fabds |
14 | 6 | ; CHECK-GI-NEXT: warning: Instruction selection used fallback path for fabdd |
15 | 7 | ; CHECK-GI-NEXT: warning: Instruction selection used fallback path for uabd_i64 |
16 | 8 |
|
@@ -1047,21 +1039,37 @@ define <4 x i32> @abs_4s(ptr %A) nounwind { |
1047 | 1039 | } |
1048 | 1040 |
|
1049 | 1041 | define <1 x i64> @abs_1d(<1 x i64> %A) nounwind { |
1050 | | -; CHECK-LABEL: abs_1d: |
1051 | | -; CHECK: // %bb.0: |
1052 | | -; CHECK-NEXT: abs d0, d0 |
1053 | | -; CHECK-NEXT: ret |
| 1042 | +; CHECK-SD-LABEL: abs_1d: |
| 1043 | +; CHECK-SD: // %bb.0: |
| 1044 | +; CHECK-SD-NEXT: abs d0, d0 |
| 1045 | +; CHECK-SD-NEXT: ret |
| 1046 | +; |
| 1047 | +; CHECK-GI-LABEL: abs_1d: |
| 1048 | +; CHECK-GI: // %bb.0: |
| 1049 | +; CHECK-GI-NEXT: fmov x8, d0 |
| 1050 | +; CHECK-GI-NEXT: fmov x9, d0 |
| 1051 | +; CHECK-GI-NEXT: neg x8, x8 |
| 1052 | +; CHECK-GI-NEXT: cmp x9, #0 |
| 1053 | +; CHECK-GI-NEXT: fmov d1, x8 |
| 1054 | +; CHECK-GI-NEXT: fcsel d0, d0, d1, gt |
| 1055 | +; CHECK-GI-NEXT: ret |
1054 | 1056 | %abs = call <1 x i64> @llvm.aarch64.neon.abs.v1i64(<1 x i64> %A) |
1055 | 1057 | ret <1 x i64> %abs |
1056 | 1058 | } |
1057 | 1059 |
|
1058 | 1060 | define i64 @abs_1d_honestly(i64 %A) nounwind { |
1059 | | -; CHECK-LABEL: abs_1d_honestly: |
1060 | | -; CHECK: // %bb.0: |
1061 | | -; CHECK-NEXT: fmov d0, x0 |
1062 | | -; CHECK-NEXT: abs d0, d0 |
1063 | | -; CHECK-NEXT: fmov x0, d0 |
1064 | | -; CHECK-NEXT: ret |
| 1061 | +; CHECK-SD-LABEL: abs_1d_honestly: |
| 1062 | +; CHECK-SD: // %bb.0: |
| 1063 | +; CHECK-SD-NEXT: fmov d0, x0 |
| 1064 | +; CHECK-SD-NEXT: abs d0, d0 |
| 1065 | +; CHECK-SD-NEXT: fmov x0, d0 |
| 1066 | +; CHECK-SD-NEXT: ret |
| 1067 | +; |
| 1068 | +; CHECK-GI-LABEL: abs_1d_honestly: |
| 1069 | +; CHECK-GI: // %bb.0: |
| 1070 | +; CHECK-GI-NEXT: cmp x0, #0 |
| 1071 | +; CHECK-GI-NEXT: cneg x0, x0, le |
| 1072 | +; CHECK-GI-NEXT: ret |
1065 | 1073 | %abs = call i64 @llvm.aarch64.neon.abs.i64(i64 %A) |
1066 | 1074 | ret i64 %abs |
1067 | 1075 | } |
|
0 commit comments