1 # RUN: llvm-mc %s -triple=riscv64 -mattr=+d,+zfh,+zfbfmin -M no-aliases \
2 # RUN: | FileCheck -check-prefixes=CHECK-INST %s
3 # RUN: llvm-mc %s -triple=riscv64 -mattr=+d,+zfh,+zfbfmin \
4 # RUN: | FileCheck -check-prefixes=CHECK-ALIAS %s
5 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+d,+zfh,+zfbfmin < %s \
6 # RUN: | llvm-objdump -M no-aliases --mattr=+d,+zfh,+zfbfmin -d -r - \
7 # RUN: | FileCheck -check-prefixes=CHECK-INST %s
8 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+d,+zfh,+zfbfmin < %s \
9 # RUN: | llvm-objdump --mattr=+d,+zfh,+zfbfmin -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
21 # CHECK-INST: fmadd.s fa0, fa1, fa2, fa3, dyn{{$}}
22 # CHECK-ALIAS: fmadd.s fa0, fa1, fa2, fa3{{$}}
23 fmadd.s fa0
, fa1
, fa2
, fa3
25 # CHECK-INST: fadd.s fa0, fa1, fa2, dyn{{$}}
26 # CHECK-ALIAS: fadd.s fa0, fa1, fa2{{$}}
29 # CHECK-INST: fcvt.w.s a0, fa0, dyn{{$}}
30 # CHECK-ALIAS: fcvt.w.s a0, fa0{{$}}
33 # CHECK-INST: fcvt.wu.s a0, fa0, dyn{{$}}
34 # CHECK-ALIAS: fcvt.wu.s a0, fa0{{$}}
37 # CHECK-INST: fcvt.s.w fa0, a0, dyn{{$}}
38 # CHECK-ALIAS: fcvt.s.w fa0, a0{{$}}
41 # CHECK-INST: fcvt.s.wu fa0, a0, dyn{{$}}
42 # CHECK-ALIAS: fcvt.s.wu fa0, a0{{$}}
45 # CHECK-INST: fcvt.l.s a0, fa0, dyn{{$}}
46 # CHECK-ALIAS: fcvt.l.s a0, fa0{{$}}
49 # CHECK-INST: fcvt.lu.s a0, fa0, dyn{{$}}
50 # CHECK-ALIAS: fcvt.lu.s a0, fa0{{$}}
53 # CHECK-INST: fcvt.s.l fa0, a0, dyn{{$}}
54 # CHECK-ALIAS: fcvt.s.l fa0, a0{{$}}
57 # CHECK-INST: fcvt.s.lu fa0, a0, dyn{{$}}
58 # CHECK-ALIAS: fcvt.s.lu fa0, a0{{$}}
63 # CHECK-INST: fmadd.d fa0, fa1, fa2, fa3, dyn{{$}}
64 # CHECK-ALIAS: fmadd.d fa0, fa1, fa2, fa3{{$}}
65 fmadd.d fa0
, fa1
, fa2
, fa3
67 # CHECK-INST: fadd.d fa0, fa1, fa2, dyn{{$}}
68 # CHECK-ALIAS: fadd.d fa0, fa1, fa2{{$}}
71 # CHECK-INST: fcvt.s.d fa0, fa0, dyn{{$}}
72 # CHECK-ALIAS: fcvt.s.d fa0, fa0{{$}}
75 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
76 # default rounding mode.
77 # CHECK-INST: fcvt.d.s fa0, fa0{{$}}
78 # CHECK-ALIAS: fcvt.d.s fa0, fa0{{$}}
80 # CHECK-INST: fcvt.d.s fa0, fa0{{$}}
81 # CHECK-ALIAS: fcvt.d.s fa0, fa0{{$}}
82 fcvt.d.s fa0
, fa0
, rne
84 # CHECK-INST: fcvt.w.d a0, fa0, dyn{{$}}
85 # CHECK-ALIAS: fcvt.w.d a0, fa0{{$}}
88 # CHECK-INST: fcvt.wu.d a0, fa0, dyn{{$}}
89 # CHECK-ALIAS: fcvt.wu.d a0, fa0{{$}}
92 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
93 # default rounding mode.
94 # CHECK-INST: fcvt.d.w fa0, a0{{$}}
95 # CHECK-ALIAS: fcvt.d.w fa0, a0{{$}}
97 # CHECK-INST: fcvt.d.w fa0, a0{{$}}
98 # CHECK-ALIAS: fcvt.d.w fa0, a0{{$}}
101 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
102 # default rounding mode.
103 # CHECK-INST: fcvt.d.wu fa0, a0{{$}}
104 # CHECK-ALIAS: fcvt.d.wu fa0, a0{{$}}
106 # CHECK-INST: fcvt.d.wu fa0, a0{{$}}
107 # CHECK-ALIAS: fcvt.d.wu fa0, a0{{$}}
108 fcvt.d.wu fa0
, a0
, rne
110 # CHECK-INST: fcvt.l.d a0, fa0, dyn{{$}}
111 # CHECK-ALIAS: fcvt.l.d a0, fa0{{$}}
114 # CHECK-INST: fcvt.lu.d a0, fa0, dyn{{$}}
115 # CHECK-ALIAS: fcvt.lu.d a0, fa0{{$}}
118 # CHECK-INST: fcvt.d.l fa0, a0, dyn{{$}}
119 # CHECK-ALIAS: fcvt.d.l fa0, a0{{$}}
122 # CHECK-INST: fcvt.d.lu fa0, a0, dyn{{$}}
123 # CHECK-ALIAS: fcvt.d.lu fa0, a0{{$}}
128 # CHECK-INST: fmadd.h fa0, fa1, fa2, fa3, dyn{{$}}
129 # CHECK-ALIAS: fmadd.h fa0, fa1, fa2, fa3{{$}}
130 fmadd.h fa0
, fa1
, fa2
, fa3
132 # CHECK-INST: fadd.h fa0, fa1, fa2, dyn{{$}}
133 # CHECK-ALIAS: fadd.h fa0, fa1, fa2{{$}}
136 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
137 # default rounding mode.
138 # CHECK-INST: fcvt.s.h fa0, fa0{{$}}
139 # CHECK-ALIAS: fcvt.s.h fa0, fa0{{$}}
141 # CHECK-INST: fcvt.s.h fa0, fa0{{$}}
142 # CHECK-ALIAS: fcvt.s.h fa0, fa0{{$}}
143 fcvt.s.h fa0
, fa0
, rne
145 # CHECK-INST: fcvt.h.s fa0, fa0, dyn{{$}}
146 # CHECK-ALIAS: fcvt.h.s fa0, fa0{{$}}
149 # For historical reasons defaults to frm==0b000 (rne) but doesn't print this
150 # default rounding mode.
151 # CHECK-INST: fcvt.d.h fa0, fa0{{$}}
152 # CHECK-ALIAS: fcvt.d.h fa0, fa0{{$}}
154 # CHECK-INST: fcvt.d.h fa0, fa0{{$}}
155 # CHECK-ALIAS: fcvt.d.h fa0, fa0{{$}}
156 fcvt.d.h fa0
, fa0
, rne
158 # CHECK-INST: fcvt.h.d fa0, fa0, dyn{{$}}
159 # CHECK-ALIAS: fcvt.h.d fa0, fa0{{$}}
162 # CHECK-INST: fcvt.w.h a0, fa0, dyn{{$}}
163 # CHECK-ALIAS: fcvt.w.h a0, fa0{{$}}
166 # CHECK-INST: fcvt.wu.h a0, fa0, dyn{{$}}
167 # CHECK-ALIAS: fcvt.wu.h a0, fa0{{$}}
170 # CHECK-INST: fcvt.h.w fa0, a0, dyn{{$}}
171 # CHECK-ALIAS: fcvt.h.w fa0, a0{{$}}
174 # CHECK-INST: fcvt.h.wu fa0, a0, dyn{{$}}
175 # CHECK-ALIAS: fcvt.h.wu fa0, a0{{$}}
178 # CHECK-INST: fcvt.l.h a0, fa0, dyn{{$}}
179 # CHECK-ALIAS: fcvt.l.h a0, fa0{{$}}
182 # CHECK-INST: fcvt.lu.h a0, fa0, dyn{{$}}
183 # CHECK-ALIAS: fcvt.lu.h a0, fa0{{$}}
186 # CHECK-INST: fcvt.h.l fa0, a0, dyn{{$}}
187 # CHECK-ALIAS: fcvt.h.l fa0, a0{{$}}
190 # CHECK-INST: fcvt.h.lu fa0, a0, dyn{{$}}
191 # CHECK-ALIAS: fcvt.h.lu fa0, a0{{$}}
194 # Zfbfmin instructions
196 # CHECK-INST: fcvt.s.bf16 fa0, fa0{{$}}
197 # CHECK-ALIAS: fcvt.s.bf16 fa0, fa0{{$}}
199 # CHECK-INST: fcvt.s.bf16 fa0, fa0{{$}}
200 # CHECK-ALIAS: fcvt.s.bf16 fa0, fa0{{$}}
201 fcvt.s.bf16 fa0
, fa0
, rne
203 # CHECK-INST: fcvt.bf16.s fa0, fa0, dyn{{$}}
204 # CHECK-ALIAS: fcvt.bf16.s fa0, fa0{{$}}