Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / RISCV / fp-inx-default-rounding-mode.s
blobd2764ce2ad2171239616d81f23e0a5aefbad2ae5
1 # RUN: llvm-mc %s -triple=riscv64 -mattr=+zdinx,+zhinx -riscv-no-aliases \
2 # RUN: | FileCheck -check-prefixes=CHECK-INST %s
3 # RUN: llvm-mc %s -triple=riscv64 -mattr=+zdinx,+zhinx \
4 # RUN: | FileCheck -check-prefixes=CHECK-ALIAS %s
5 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zdinx,+zhinx < %s \
6 # RUN: | llvm-objdump -M no-aliases --mattr=+zdinx,+zhinx -d -r - \
7 # RUN: | FileCheck -check-prefixes=CHECK-INST %s
8 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zdinx,+zhinx < %s \
9 # RUN: | llvm-objdump --mattr=+zdinx,+zhinx -d -r - \
10 # RUN: | FileCheck -check-prefixes=CHECK-ALIAS %s
12 # This test aims to check what the default rounding mode is for a given
13 # instruction if it's not specified, and ensures that it isn't printed when
14 # aliases are enabled but is printed otherwise. Instructions aren't listed
15 # exhaustively, but special attention is given to the fcvt instructions given
16 # that those that never round often default to frm=0b000 for historical
17 # reasons.
19 # These test cases are copied from fp-default-round-mode.s, but changed to use
20 # GPRs.
22 # Zfinx instructions
24 # CHECK-INST: fmadd.s a0, a1, a2, a3, dyn{{$}}
25 # CHECK-ALIAS: fmadd.s a0, a1, a2, a3{{$}}
26 fmadd.s a0, a1, a2, a3
28 # CHECK-INST: fadd.s a0, a1, a2, dyn{{$}}
29 # CHECK-ALIAS: fadd.s a0, a1, a2{{$}}
30 fadd.s a0, a1, a2
32 # CHECK-INST: fcvt.w.s a0, a0, dyn{{$}}
33 # CHECK-ALIAS: fcvt.w.s a0, a0{{$}}
34 fcvt.w.s a0, a0
36 # CHECK-INST: fcvt.wu.s a0, a0, dyn{{$}}
37 # CHECK-ALIAS: fcvt.wu.s a0, a0{{$}}
38 fcvt.wu.s a0, a0
40 # CHECK-INST: fcvt.s.w a0, a0, dyn{{$}}
41 # CHECK-ALIAS: fcvt.s.w a0, a0{{$}}
42 fcvt.s.w a0, a0
44 # CHECK-INST: fcvt.s.wu a0, a0, dyn{{$}}
45 # CHECK-ALIAS: fcvt.s.wu a0, a0{{$}}
46 fcvt.s.wu a0, a0
48 # CHECK-INST: fcvt.l.s a0, a0, dyn{{$}}
49 # CHECK-ALIAS: fcvt.l.s a0, a0{{$}}
50 fcvt.l.s a0, a0
52 # CHECK-INST: fcvt.lu.s a0, a0, dyn{{$}}
53 # CHECK-ALIAS: fcvt.lu.s a0, a0{{$}}
54 fcvt.lu.s a0, a0
56 # CHECK-INST: fcvt.s.l a0, a0, dyn{{$}}
57 # CHECK-ALIAS: fcvt.s.l a0, a0{{$}}
58 fcvt.s.l a0, a0
60 # CHECK-INST: fcvt.s.lu a0, a0, dyn{{$}}
61 # CHECK-ALIAS: fcvt.s.lu a0, a0{{$}}
62 fcvt.s.lu a0, a0
64 # Zdinx instructions
66 # CHECK-INST: fmadd.d a0, a1, a2, a3, dyn{{$}}
67 # CHECK-ALIAS: fmadd.d a0, a1, a2, a3{{$}}
68 fmadd.d a0, a1, a2, a3
70 # CHECK-INST: fadd.d a0, a1, a2, dyn{{$}}
71 # CHECK-ALIAS: fadd.d a0, a1, a2{{$}}
72 fadd.d a0, a1, a2
74 # CHECK-INST: fcvt.s.d a0, a0, dyn{{$}}
75 # CHECK-ALIAS: fcvt.s.d a0, a0{{$}}
76 fcvt.s.d a0, a0
78 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
79 # default rounding mode.
80 # CHECK-INST: fcvt.d.s a0, a0{{$}}
81 # CHECK-ALIAS: fcvt.d.s a0, a0{{$}}
82 fcvt.d.s a0, a0
83 # CHECK-INST: fcvt.d.s a0, a0{{$}}
84 # CHECK-ALIAS: fcvt.d.s a0, a0{{$}}
85 fcvt.d.s a0, a0, rne
87 # CHECK-INST: fcvt.w.d a0, a0, dyn{{$}}
88 # CHECK-ALIAS: fcvt.w.d a0, a0{{$}}
89 fcvt.w.d a0, a0
91 # CHECK-INST: fcvt.wu.d a0, a0, dyn{{$}}
92 # CHECK-ALIAS: fcvt.wu.d a0, a0{{$}}
93 fcvt.wu.d a0, a0
95 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
96 # default rounding mode.
97 # CHECK-INST: fcvt.d.w a0, a0{{$}}
98 # CHECK-ALIAS: fcvt.d.w a0, a0{{$}}
99 fcvt.d.w a0, a0
100 # CHECK-INST: fcvt.d.w a0, a0{{$}}
101 # CHECK-ALIAS: fcvt.d.w a0, a0{{$}}
102 fcvt.d.w a0, a0, rne
104 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
105 # default rounding mode.
106 # CHECK-INST: fcvt.d.wu a0, a0{{$}}
107 # CHECK-ALIAS: fcvt.d.wu a0, a0{{$}}
108 fcvt.d.wu a0, a0
109 # CHECK-INST: fcvt.d.wu a0, a0{{$}}
110 # CHECK-ALIAS: fcvt.d.wu a0, a0{{$}}
111 fcvt.d.wu a0, a0, rne
113 # CHECK-INST: fcvt.l.d a0, a0, dyn{{$}}
114 # CHECK-ALIAS: fcvt.l.d a0, a0{{$}}
115 fcvt.l.d a0, a0
117 # CHECK-INST: fcvt.lu.d a0, a0, dyn{{$}}
118 # CHECK-ALIAS: fcvt.lu.d a0, a0{{$}}
119 fcvt.lu.d a0, a0
121 # CHECK-INST: fcvt.d.l a0, a0, dyn{{$}}
122 # CHECK-ALIAS: fcvt.d.l a0, a0{{$}}
123 fcvt.d.l a0, a0
125 # CHECK-INST: fcvt.d.lu a0, a0, dyn{{$}}
126 # CHECK-ALIAS: fcvt.d.lu a0, a0{{$}}
127 fcvt.d.lu a0, a0
129 # Zhinx instructions
131 # CHECK-INST: fmadd.h a0, a1, a2, a3, dyn{{$}}
132 # CHECK-ALIAS: fmadd.h a0, a1, a2, a3{{$}}
133 fmadd.h a0, a1, a2, a3
135 # CHECK-INST: fadd.h a0, a1, a2, dyn{{$}}
136 # CHECK-ALIAS: fadd.h a0, a1, a2{{$}}
137 fadd.h a0, a1, a2
139 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
140 # default rounding mode.
141 # CHECK-INST: fcvt.s.h a0, a0{{$}}
142 # CHECK-ALIAS: fcvt.s.h a0, a0{{$}}
143 fcvt.s.h a0, a0
144 # CHECK-INST: fcvt.s.h a0, a0{{$}}
145 # CHECK-ALIAS: fcvt.s.h a0, a0{{$}}
146 fcvt.s.h a0, a0, rne
148 # CHECK-INST: fcvt.h.s a0, a0, dyn{{$}}
149 # CHECK-ALIAS: fcvt.h.s a0, a0{{$}}
150 fcvt.h.s a0, a0
152 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
153 # default rounding mode.
154 # CHECK-INST: fcvt.d.h a0, a0{{$}}
155 # CHECK-ALIAS: fcvt.d.h a0, a0{{$}}
156 fcvt.d.h a0, a0
157 # CHECK-INST: fcvt.d.h a0, a0{{$}}
158 # CHECK-ALIAS: fcvt.d.h a0, a0{{$}}
159 fcvt.d.h a0, a0, rne
161 # CHECK-INST: fcvt.h.d a0, a0, dyn{{$}}
162 # CHECK-ALIAS: fcvt.h.d a0, a0{{$}}
163 fcvt.h.d a0, a0
165 # CHECK-INST: fcvt.w.h a0, a0, dyn{{$}}
166 # CHECK-ALIAS: fcvt.w.h a0, a0{{$}}
167 fcvt.w.h a0, a0
169 # CHECK-INST: fcvt.wu.h a0, a0, dyn{{$}}
170 # CHECK-ALIAS: fcvt.wu.h a0, a0{{$}}
171 fcvt.wu.h a0, a0
173 # CHECK-INST: fcvt.h.w a0, a0, dyn{{$}}
174 # CHECK-ALIAS: fcvt.h.w a0, a0{{$}}
175 fcvt.h.w a0, a0
177 # CHECK-INST: fcvt.h.wu a0, a0, dyn{{$}}
178 # CHECK-ALIAS: fcvt.h.wu a0, a0{{$}}
179 fcvt.h.wu a0, a0
181 # CHECK-INST: fcvt.l.h a0, a0, dyn{{$}}
182 # CHECK-ALIAS: fcvt.l.h a0, a0{{$}}
183 fcvt.l.h a0, a0
185 # CHECK-INST: fcvt.lu.h a0, a0, dyn{{$}}
186 # CHECK-ALIAS: fcvt.lu.h a0, a0{{$}}
187 fcvt.lu.h a0, a0
189 # CHECK-INST: fcvt.h.l a0, a0, dyn{{$}}
190 # CHECK-ALIAS: fcvt.h.l a0, a0{{$}}
191 fcvt.h.l a0, a0
193 # CHECK-INST: fcvt.h.lu a0, a0, dyn{{$}}
194 # CHECK-ALIAS: fcvt.h.lu a0, a0{{$}}
195 fcvt.h.lu a0, a0