1 # RUN: llvm-mc %s -triple=riscv32 -mattr=+f -riscv-no-aliases \
2 # RUN: | FileCheck -check-prefix=CHECK-INST %s
3 # RUN: llvm-mc %s -triple=riscv32 -mattr=+f \
4 # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s
5 # RUN: llvm-mc %s -triple=riscv64 -mattr=+f -riscv-no-aliases \
6 # RUN: | FileCheck -check-prefix=CHECK-INST %s
7 # RUN: llvm-mc %s -triple=riscv64 -mattr=+f \
8 # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s
9 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+f < %s \
10 # RUN: | llvm-objdump -d -mattr=+f -riscv-no-aliases - \
11 # RUN: | FileCheck -check-prefix=CHECK-INST %s
12 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+f < %s \
13 # RUN: | llvm-objdump -d -mattr=+f - \
14 # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s
15 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+f < %s \
16 # RUN: | llvm-objdump -d -mattr=+f -riscv-no-aliases - \
17 # RUN: | FileCheck -check-prefix=CHECK-INST %s
18 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+f < %s \
19 # RUN: | llvm-objdump -d -mattr=+f - \
20 # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s
22 ##===----------------------------------------------------------------------===##
23 ## Assembler Pseudo Instructions (User-Level ISA, Version 2.2, Chapter 20)
24 ##===----------------------------------------------------------------------===##
29 # CHECK-INST: fsgnj.s ft0, ft1, ft1
30 # CHECK-ALIAS: fmv.s ft0, ft1
32 # CHECK-INST: fsgnjx.s ft1, ft2, ft2
33 # CHECK-ALIAS: fabs.s ft1, ft2
35 # CHECK-INST: fsgnjn.s ft2, ft3, ft3
36 # CHECK-ALIAS: fneg.s ft2, ft3
39 # CHECK-INST: flt.s tp, ft6, ft5
40 # CHECK-ALIAS: flt.s tp, ft6, ft5
42 # CHECK-INST: fle.s t2, fs1, fs0
43 # CHECK-ALIAS: fle.s t2, fs1, fs0
46 # The following instructions actually alias instructions from the base ISA.
47 # However, it only makes sense to support them when the F extension is enabled.
48 # CHECK-INST: csrrs t0, fcsr, zero
49 # CHECK-ALIAS: frcsr t0
51 # CHECK-INST: csrrw t1, fcsr, t2
52 # CHECK-ALIAS: fscsr t1, t2
54 # CHECK-INST: csrrw zero, fcsr, t3
55 # CHECK-ALIAS: fscsr t3
58 # CHECK-INST: csrrs t4, frm, zero
59 # CHECK-ALIAS: frrm t4
61 # CHECK-INST: csrrw t5, frm, t4
62 # CHECK-ALIAS: fsrm t5, t4
64 # CHECK-INST: csrrw zero, frm, t6
65 # CHECK-ALIAS: fsrm t6
67 # CHECK-INST: csrrwi a0, frm, 31
68 # CHECK-ALIAS: fsrmi a0, 31
70 # CHECK-INST: csrrwi zero, frm, 30
71 # CHECK-ALIAS: fsrmi 30
74 # CHECK-INST: csrrs a1, fflags, zero
75 # CHECK-ALIAS: frflags a1
77 # CHECK-INST: csrrw a2, fflags, a1
78 # CHECK-ALIAS: fsflags a2, a1
80 # CHECK-INST: csrrw zero, fflags, a3
81 # CHECK-ALIAS: fsflags a3
83 # CHECK-INST: csrrwi a4, fflags, 29
84 # CHECK-ALIAS: fsflagsi a4, 29
86 # CHECK-INST: csrrwi zero, fflags, 28
87 # CHECK-ALIAS: fsflagsi 28
90 # CHECK-INST: fmv.x.w a2, fs7
91 # CHECK-ALIAS: fmv.x.w a2, fs7
93 # CHECK-INST: fmv.w.x ft1, a6
94 # CHECK-ALIAS: fmv.w.x ft1, a6
97 # CHECK-INST: flw ft0, 0(a0)
98 # CHECK-ALIAS: flw ft0, 0(a0)
100 # CHECK-INST: fsw ft0, 0(a0)
101 # CHECK-ALIAS: fsw ft0, 0(a0)
104 ##===----------------------------------------------------------------------===##
105 ## Aliases which omit the rounding mode.
106 ##===----------------------------------------------------------------------===##
108 # CHECK-INST: fmadd.s fa0, fa1, fa2, fa3, dyn
109 # CHECK-ALIAS: fmadd.s fa0, fa1, fa2, fa3{{[[:space:]]}}
110 fmadd.s
f10, f11, f12, f13
111 # CHECK-INST: fmsub.s fa4, fa5, fa6, fa7, dyn
112 # CHECK-ALIAS: fmsub.s fa4, fa5, fa6, fa7{{[[:space:]]}}
113 fmsub.s
f14, f15, f16, f17
114 # CHECK-INST: fnmsub.s fs2, fs3, fs4, fs5, dyn
115 # CHECK-ALIAS: fnmsub.s fs2, fs3, fs4, fs5{{[[:space:]]}}
116 fnmsub.s
f18, f19, f20, f21
117 # CHECK-INST: fnmadd.s fs6, fs7, fs8, fs9, dyn
118 # CHECK-ALIAS: fnmadd.s fs6, fs7, fs8, fs9{{[[:space:]]}}
119 fnmadd.s
f22, f23, f24, f25
120 # CHECK-INST: fadd.s fs10, fs11, ft8, dyn
121 # CHECK-ALIAS: fadd.s fs10, fs11, ft8{{[[:space:]]}}
123 # CHECK-INST: fsub.s ft9, ft10, ft11, dyn
124 # CHECK-ALIAS: fsub.s ft9, ft10, ft11{{[[:space:]]}}
126 # CHECK-INST: fmul.s ft0, ft1, ft2, dyn
127 # CHECK-ALIAS: fmul.s ft0, ft1, ft2{{[[:space:]]}}
129 # CHECK-INST: fdiv.s ft3, ft4, ft5, dyn
130 # CHECK-ALIAS: fdiv.s ft3, ft4, ft5{{[[:space:]]}}
132 # CHECK-INST: fsqrt.s ft6, ft7, dyn
133 # CHECK-ALIAS: fsqrt.s ft6, ft7{{[[:space:]]}}
135 # CHECK-INST: fcvt.w.s a0, fs5, dyn
136 # CHECK-ALIAS: fcvt.w.s a0, fs5{{[[:space:]]}}
138 # CHECK-INST: fcvt.wu.s a1, fs6, dyn
139 # CHECK-ALIAS: fcvt.wu.s a1, fs6{{[[:space:]]}}
141 # CHECK-INST: fcvt.s.w ft11, a4, dyn
142 # CHECK-ALIAS: fcvt.s.w ft11, a4{{[[:space:]]}}
144 # CHECK-INST: fcvt.s.wu ft0, a5, dyn
145 # CHECK-ALIAS: fcvt.s.wu ft0, a5{{[[:space:]]}}