2
2
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3
3
; RUN: | FileCheck -check-prefix=RV32I %s
4
4
; RUN: llc -mtriple=riscv32 -mattr=+experimental-zfh -verify-machineinstrs \
5
- ; RUN: -target-abi ilp32f < %s \
6
- ; RUN: | FileCheck -check-prefix=RV32IZFH %s
5
+ ; RUN: < %s | FileCheck -check-prefix=RV32IZFH %s
7
6
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
8
7
; RUN: | FileCheck -check-prefix=RV64I %s
9
8
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zfh -verify-machineinstrs \
10
- ; RUN: -target-abi lp64f < %s \
11
- ; RUN: | FileCheck -check-prefix=RV64IZFH %s
9
+ ; RUN: < %s | FileCheck -check-prefix=RV64IZFH %s
12
10
13
11
; This file tests cases where simple floating point operations can be
14
12
; profitably handled though bit manipulation if a soft-float ABI is being used
@@ -25,7 +23,9 @@ define half @fneg(half %a) nounwind {
25
23
;
26
24
; RV32IZFH-LABEL: fneg:
27
25
; RV32IZFH: # %bb.0:
28
- ; RV32IZFH-NEXT: fneg.h fa0, fa0
26
+ ; RV32IZFH-NEXT: fmv.h.x ft0, a0
27
+ ; RV32IZFH-NEXT: fneg.h ft0, ft0
28
+ ; RV32IZFH-NEXT: fmv.x.h a0, ft0
29
29
; RV32IZFH-NEXT: ret
30
30
;
31
31
; RV64I-LABEL: fneg:
@@ -36,7 +36,9 @@ define half @fneg(half %a) nounwind {
36
36
;
37
37
; RV64IZFH-LABEL: fneg:
38
38
; RV64IZFH: # %bb.0:
39
- ; RV64IZFH-NEXT: fneg.h fa0, fa0
39
+ ; RV64IZFH-NEXT: fmv.h.x ft0, a0
40
+ ; RV64IZFH-NEXT: fneg.h ft0, ft0
41
+ ; RV64IZFH-NEXT: fmv.x.h a0, ft0
40
42
; RV64IZFH-NEXT: ret
41
43
%1 = fneg half %a
42
44
ret half %1
@@ -54,7 +56,9 @@ define half @fabs(half %a) nounwind {
54
56
;
55
57
; RV32IZFH-LABEL: fabs:
56
58
; RV32IZFH: # %bb.0:
57
- ; RV32IZFH-NEXT: fabs.h fa0, fa0
59
+ ; RV32IZFH-NEXT: fmv.h.x ft0, a0
60
+ ; RV32IZFH-NEXT: fabs.h ft0, ft0
61
+ ; RV32IZFH-NEXT: fmv.x.h a0, ft0
58
62
; RV32IZFH-NEXT: ret
59
63
;
60
64
; RV64I-LABEL: fabs:
@@ -66,7 +70,9 @@ define half @fabs(half %a) nounwind {
66
70
;
67
71
; RV64IZFH-LABEL: fabs:
68
72
; RV64IZFH: # %bb.0:
69
- ; RV64IZFH-NEXT: fabs.h fa0, fa0
73
+ ; RV64IZFH-NEXT: fmv.h.x ft0, a0
74
+ ; RV64IZFH-NEXT: fabs.h ft0, ft0
75
+ ; RV64IZFH-NEXT: fmv.x.h a0, ft0
70
76
; RV64IZFH-NEXT: ret
71
77
%1 = call half @llvm.fabs.f16 (half %a )
72
78
ret half %1
@@ -92,7 +98,10 @@ define half @fcopysign_fneg(half %a, half %b) nounwind {
92
98
;
93
99
; RV32IZFH-LABEL: fcopysign_fneg:
94
100
; RV32IZFH: # %bb.0:
95
- ; RV32IZFH-NEXT: fsgnjn.h fa0, fa0, fa1
101
+ ; RV32IZFH-NEXT: fmv.h.x ft0, a1
102
+ ; RV32IZFH-NEXT: fmv.h.x ft1, a0
103
+ ; RV32IZFH-NEXT: fsgnjn.h ft0, ft1, ft0
104
+ ; RV32IZFH-NEXT: fmv.x.h a0, ft0
96
105
; RV32IZFH-NEXT: ret
97
106
;
98
107
; RV64I-LABEL: fcopysign_fneg:
@@ -108,7 +117,10 @@ define half @fcopysign_fneg(half %a, half %b) nounwind {
108
117
;
109
118
; RV64IZFH-LABEL: fcopysign_fneg:
110
119
; RV64IZFH: # %bb.0:
111
- ; RV64IZFH-NEXT: fsgnjn.h fa0, fa0, fa1
120
+ ; RV64IZFH-NEXT: fmv.h.x ft0, a1
121
+ ; RV64IZFH-NEXT: fmv.h.x ft1, a0
122
+ ; RV64IZFH-NEXT: fsgnjn.h ft0, ft1, ft0
123
+ ; RV64IZFH-NEXT: fmv.x.h a0, ft0
112
124
; RV64IZFH-NEXT: ret
113
125
%1 = fneg half %b
114
126
%2 = call half @llvm.copysign.f16 (half %a , half %1 )
0 commit comments