1 # RUN: llvm-mc %s -triple=riscv32 -mattr=+f -riscv-no-aliases -show-encoding \
2 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
3 # RUN: llvm-mc %s -triple=riscv64 -mattr=+f -riscv-no-aliases -show-encoding \
4 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
5 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+f < %s \
6 # RUN: | llvm-objdump -mattr=+f -M no-aliases -d -r - \
7 # RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s
8 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+f < %s \
9 # RUN: | llvm-objdump -mattr=+f -M no-aliases -d -r - \
10 # RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s
12 # CHECK-ASM-AND-OBJ: flw ft0, 12(a0)
13 # CHECK-ASM: encoding: [0x07,0x20,0xc5,0x00]
15 # CHECK-ASM-AND-OBJ: flw ft1, 4(ra)
16 # CHECK-ASM: encoding: [0x87,0xa0,0x40,0x00]
18 # CHECK-ASM-AND-OBJ: flw ft2, -2048(a3)
19 # CHECK-ASM: encoding: [0x07,0xa1,0x06,0x80]
21 # CHECK-ASM-AND-OBJ: flw ft3, -2048(s1)
22 # CHECK-ASM: encoding: [0x87,0xa1,0x04,0x80]
24 # CHECK-ASM-AND-OBJ: flw ft4, 2047(s2)
25 # CHECK-ASM: encoding: [0x07,0x22,0xf9,0x7f]
27 # CHECK-ASM-AND-OBJ: flw ft5, 0(s3)
28 # CHECK-ASM: encoding: [0x87,0xa2,0x09,0x00]
31 # CHECK-ASM-AND-OBJ: fsw ft6, 2047(s4)
32 # CHECK-ASM: encoding: [0xa7,0x2f,0x6a,0x7e]
34 # CHECK-ASM-AND-OBJ: fsw ft7, -2048(s5)
35 # CHECK-ASM: encoding: [0x27,0xa0,0x7a,0x80]
37 # CHECK-ASM-AND-OBJ: fsw fs0, -2048(s6)
38 # CHECK-ASM: encoding: [0x27,0x20,0x8b,0x80]
40 # CHECK-ASM-AND-OBJ: fsw fs1, 999(s7)
41 # CHECK-ASM: encoding: [0xa7,0xa3,0x9b,0x3e]
44 # CHECK-ASM-AND-OBJ: fmadd.s fa0, fa1, fa2, fa3, dyn
45 # CHECK-ASM: encoding: [0x43,0xf5,0xc5,0x68]
46 fmadd.s
f10, f11, f12, f13, dyn
47 # CHECK-ASM-AND-OBJ: fmsub.s fa4, fa5, fa6, fa7, dyn
48 # CHECK-ASM: encoding: [0x47,0xf7,0x07,0x89]
49 fmsub.s
f14, f15, f16, f17, dyn
50 # CHECK-ASM-AND-OBJ: fnmsub.s fs2, fs3, fs4, fs5, dyn
51 # CHECK-ASM: encoding: [0x4b,0xf9,0x49,0xa9]
52 fnmsub.s
f18, f19, f20, f21, dyn
53 # CHECK-ASM-AND-OBJ: fnmadd.s fs6, fs7, fs8, fs9, dyn
54 # CHECK-ASM: encoding: [0x4f,0xfb,0x8b,0xc9]
55 fnmadd.s
f22, f23, f24, f25, dyn
57 # CHECK-ASM-AND-OBJ: fadd.s fs10, fs11, ft8, dyn
58 # CHECK-ASM: encoding: [0x53,0xfd,0xcd,0x01]
59 fadd.s
f26, f27, f28, dyn
60 # CHECK-ASM-AND-OBJ: fsub.s ft9, ft10, ft11, dyn
61 # CHECK-ASM: encoding: [0xd3,0x7e,0xff,0x09]
62 fsub.s
f29, f30, f31, dyn
63 # CHECK-ASM-AND-OBJ: fmul.s ft0, ft1, ft2, dyn
64 # CHECK-ASM: encoding: [0x53,0xf0,0x20,0x10]
65 fmul.s ft0
, ft1
, ft2
, dyn
66 # CHECK-ASM-AND-OBJ: fdiv.s ft3, ft4, ft5, dyn
67 # CHECK-ASM: encoding: [0xd3,0x71,0x52,0x18]
68 fdiv.s ft3
, ft4
, ft5
, dyn
69 # CHECK-ASM-AND-OBJ: fsqrt.s ft6, ft7, dyn
70 # CHECK-ASM: encoding: [0x53,0xf3,0x03,0x58]
72 # CHECK-ASM-AND-OBJ: fsgnj.s fs1, fa0, fa1
73 # CHECK-ASM: encoding: [0xd3,0x04,0xb5,0x20]
75 # CHECK-ASM-AND-OBJ: fsgnjn.s fa1, fa3, fa4
76 # CHECK-ASM: encoding: [0xd3,0x95,0xe6,0x20]
77 fsgnjn.s fa1
, fa3
, fa4
78 # CHECK-ASM-AND-OBJ: fsgnjx.s fa4, fa3, fa2
79 # CHECK-ASM: encoding: [0x53,0xa7,0xc6,0x20]
80 fsgnjx.s fa4
, fa3
, fa2
81 # CHECK-ASM-AND-OBJ: fmin.s fa5, fa6, fa7
82 # CHECK-ASM: encoding: [0xd3,0x07,0x18,0x29]
84 # CHECK-ASM-AND-OBJ: fmax.s fs2, fs3, fs4
85 # CHECK-ASM: encoding: [0x53,0x99,0x49,0x29]
87 # CHECK-ASM-AND-OBJ: fcvt.w.s a0, fs5, dyn
88 # CHECK-ASM: encoding: [0x53,0xf5,0x0a,0xc0]
90 # CHECK-ASM-AND-OBJ: fcvt.wu.s a1, fs6, dyn
91 # CHECK-ASM: encoding: [0xd3,0x75,0x1b,0xc0]
92 fcvt.wu.s a1
, fs6
, dyn
93 # CHECK-ASM-AND-OBJ: fmv.x.w a2, fs7
94 # CHECK-ASM: encoding: [0x53,0x86,0x0b,0xe0]
96 # CHECK-ASM-AND-OBJ: feq.s a1, fs8, fs9
97 # CHECK-ASM: encoding: [0xd3,0x25,0x9c,0xa1]
99 # CHECK-ASM-AND-OBJ: flt.s a2, fs10, fs11
100 # CHECK-ASM: encoding: [0x53,0x16,0xbd,0xa1]
102 # CHECK-ASM-AND-OBJ: fle.s a3, ft8, ft9
103 # CHECK-ASM: encoding: [0xd3,0x06,0xde,0xa1]
105 # CHECK-ASM-AND-OBJ: fclass.s a3, ft10
106 # CHECK-ASM: encoding: [0xd3,0x16,0x0f,0xe0]
108 # CHECK-ASM-AND-OBJ: fcvt.s.w ft11, a4, dyn
109 # CHECK-ASM: encoding: [0xd3,0x7f,0x07,0xd0]
110 fcvt.s.w ft11
, a4
, dyn
111 # CHECK-ASM-AND-OBJ: fcvt.s.wu ft0, a5, dyn
112 # CHECK-ASM: encoding: [0x53,0xf0,0x17,0xd0]
113 fcvt.s.wu ft0
, a5
, dyn
114 # CHECK-ASM-AND-OBJ: fmv.w.x ft1, a6
115 # CHECK-ASM: encoding: [0xd3,0x00,0x08,0xf0]
120 # CHECK-ASM-AND-OBJ: fmadd.s fa0, fa1, fa2, fa3, rne
121 # CHECK-ASM: encoding: [0x43,0x85,0xc5,0x68]
122 fmadd.s
f10, f11, f12, f13, rne
123 # CHECK-ASM-AND-OBJ: fmsub.s fa4, fa5, fa6, fa7, rtz
124 # CHECK-ASM: encoding: [0x47,0x97,0x07,0x89]
125 fmsub.s
f14, f15, f16, f17, rtz
126 # CHECK-ASM-AND-OBJ: fnmsub.s fs2, fs3, fs4, fs5, rdn
127 # CHECK-ASM: encoding: [0x4b,0xa9,0x49,0xa9]
128 fnmsub.s
f18, f19, f20, f21, rdn
129 # CHECK-ASM-AND-OBJ: fnmadd.s fs6, fs7, fs8, fs9, rup
130 # CHECK-ASM: encoding: [0x4f,0xbb,0x8b,0xc9]
131 fnmadd.s
f22, f23, f24, f25, rup
132 # CHECK-ASM-AND-OBJ: fmadd.s fa0, fa1, fa2, fa3, rmm
133 # CHECK-ASM: encoding: [0x43,0xc5,0xc5,0x68]
134 fmadd.s
f10, f11, f12, f13, rmm
135 # CHECK-ASM-AND-OBJ: fmsub.s fa4, fa5, fa6, fa7
136 # CHECK-ASM: encoding: [0x47,0xf7,0x07,0x89]
137 fmsub.s
f14, f15, f16, f17, dyn
139 # CHECK-ASM-AND-OBJ: fadd.s fs10, fs11, ft8, rne
140 # CHECK-ASM: encoding: [0x53,0x8d,0xcd,0x01]
141 fadd.s
f26, f27, f28, rne
142 # CHECK-ASM-AND-OBJ: fsub.s ft9, ft10, ft11, rtz
143 # CHECK-ASM: encoding: [0xd3,0x1e,0xff,0x09]
144 fsub.s
f29, f30, f31, rtz
145 # CHECK-ASM-AND-OBJ: fmul.s ft0, ft1, ft2, rdn
146 # CHECK-ASM: encoding: [0x53,0xa0,0x20,0x10]
147 fmul.s ft0
, ft1
, ft2
, rdn
148 # CHECK-ASM-AND-OBJ: fdiv.s ft3, ft4, ft5, rup
149 # CHECK-ASM: encoding: [0xd3,0x31,0x52,0x18]
150 fdiv.s ft3
, ft4
, ft5
, rup
152 # CHECK-ASM-AND-OBJ: fsqrt.s ft6, ft7, rmm
153 # CHECK-ASM: encoding: [0x53,0xc3,0x03,0x58]
154 fsqrt.s ft6
, ft7
, rmm
155 # CHECK-ASM-AND-OBJ: fcvt.w.s a0, fs5, rup
156 # CHECK-ASM: encoding: [0x53,0xb5,0x0a,0xc0]
157 fcvt.w.s a0
, fs5
, rup
158 # CHECK-ASM-AND-OBJ: fcvt.wu.s a1, fs6, rdn
159 # CHECK-ASM: encoding: [0xd3,0x25,0x1b,0xc0]
160 fcvt.wu.s a1
, fs6
, rdn
161 # CHECK-ASM-AND-OBJ: fcvt.s.w ft11, a4, rtz
162 # CHECK-ASM: encoding: [0xd3,0x1f,0x07,0xd0]
163 fcvt.s.w ft11
, a4
, rtz
164 # CHECK-ASM-AND-OBJ: fcvt.s.wu ft0, a5, rne
165 # CHECK-ASM: encoding: [0x53,0x80,0x17,0xd0]
166 fcvt.s.wu ft0
, a5
, rne