Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / MC / RISCV / rvf-aliases-valid.s
blob3307b9e03b4736c5f7cb0aa3ca1c2ca9971459b5
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 ##===----------------------------------------------------------------------===##
26 # TODO flw
27 # TODO fsw
29 # CHECK-INST: fsgnj.s ft0, ft1, ft1
30 # CHECK-ALIAS: fmv.s ft0, ft1
31 fmv.s f0, f1
32 # CHECK-INST: fsgnjx.s ft1, ft2, ft2
33 # CHECK-ALIAS: fabs.s ft1, ft2
34 fabs.s f1, f2
35 # CHECK-INST: fsgnjn.s ft2, ft3, ft3
36 # CHECK-ALIAS: fneg.s ft2, ft3
37 fneg.s f2, f3
39 # CHECK-INST: flt.s tp, ft6, ft5
40 # CHECK-ALIAS: flt.s tp, ft6, ft5
41 fgt.s x4, f5, f6
42 # CHECK-INST: fle.s t2, fs1, fs0
43 # CHECK-ALIAS: fle.s t2, fs1, fs0
44 fge.s x7, f8, f9
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
50 frcsr x5
51 # CHECK-INST: csrrw t1, fcsr, t2
52 # CHECK-ALIAS: fscsr t1, t2
53 fscsr x6, x7
54 # CHECK-INST: csrrw zero, fcsr, t3
55 # CHECK-ALIAS: fscsr t3
56 fscsr x28
58 # CHECK-INST: csrrs t4, frm, zero
59 # CHECK-ALIAS: frrm t4
60 frrm x29
61 # CHECK-INST: csrrw t5, frm, t4
62 # CHECK-ALIAS: fsrm t5, t4
63 fsrm x30, x29
64 # CHECK-INST: csrrw zero, frm, t6
65 # CHECK-ALIAS: fsrm t6
66 fsrm x31
67 # CHECK-INST: csrrwi a0, frm, 31
68 # CHECK-ALIAS: fsrmi a0, 31
69 fsrmi x10, 0x1f
70 # CHECK-INST: csrrwi zero, frm, 30
71 # CHECK-ALIAS: fsrmi 30
72 fsrmi 0x1e
74 # CHECK-INST: csrrs a1, fflags, zero
75 # CHECK-ALIAS: frflags a1
76 frflags x11
77 # CHECK-INST: csrrw a2, fflags, a1
78 # CHECK-ALIAS: fsflags a2, a1
79 fsflags x12, x11
80 # CHECK-INST: csrrw zero, fflags, a3
81 # CHECK-ALIAS: fsflags a3
82 fsflags x13
83 # CHECK-INST: csrrwi a4, fflags, 29
84 # CHECK-ALIAS: fsflagsi a4, 29
85 fsflagsi x14, 0x1d
86 # CHECK-INST: csrrwi zero, fflags, 28
87 # CHECK-ALIAS: fsflagsi 28
88 fsflagsi 0x1c
90 # CHECK-INST: fmv.x.w a2, fs7
91 # CHECK-ALIAS: fmv.x.w a2, fs7
92 fmv.x.s a2, fs7
93 # CHECK-INST: fmv.w.x ft1, a6
94 # CHECK-ALIAS: fmv.w.x ft1, a6
95 fmv.s.x ft1, a6
97 ##===----------------------------------------------------------------------===##
98 ## Aliases which omit the rounding mode.
99 ##===----------------------------------------------------------------------===##
101 # CHECK-INST: fmadd.s fa0, fa1, fa2, fa3, dyn
102 # CHECK-ALIAS: fmadd.s fa0, fa1, fa2, fa3{{[[:space:]]}}
103 fmadd.s f10, f11, f12, f13
104 # CHECK-INST: fmsub.s fa4, fa5, fa6, fa7, dyn
105 # CHECK-ALIAS: fmsub.s fa4, fa5, fa6, fa7{{[[:space:]]}}
106 fmsub.s f14, f15, f16, f17
107 # CHECK-INST: fnmsub.s fs2, fs3, fs4, fs5, dyn
108 # CHECK-ALIAS: fnmsub.s fs2, fs3, fs4, fs5{{[[:space:]]}}
109 fnmsub.s f18, f19, f20, f21
110 # CHECK-INST: fnmadd.s fs6, fs7, fs8, fs9, dyn
111 # CHECK-ALIAS: fnmadd.s fs6, fs7, fs8, fs9{{[[:space:]]}}
112 fnmadd.s f22, f23, f24, f25
113 # CHECK-INST: fadd.s fs10, fs11, ft8, dyn
114 # CHECK-ALIAS: fadd.s fs10, fs11, ft8{{[[:space:]]}}
115 fadd.s f26, f27, f28
116 # CHECK-INST: fsub.s ft9, ft10, ft11, dyn
117 # CHECK-ALIAS: fsub.s ft9, ft10, ft11{{[[:space:]]}}
118 fsub.s f29, f30, f31
119 # CHECK-INST: fmul.s ft0, ft1, ft2, dyn
120 # CHECK-ALIAS: fmul.s ft0, ft1, ft2{{[[:space:]]}}
121 fmul.s ft0, ft1, ft2
122 # CHECK-INST: fdiv.s ft3, ft4, ft5, dyn
123 # CHECK-ALIAS: fdiv.s ft3, ft4, ft5{{[[:space:]]}}
124 fdiv.s ft3, ft4, ft5
125 # CHECK-INST: fsqrt.s ft6, ft7, dyn
126 # CHECK-ALIAS: fsqrt.s ft6, ft7{{[[:space:]]}}
127 fsqrt.s ft6, ft7
128 # CHECK-INST: fcvt.w.s a0, fs5, dyn
129 # CHECK-ALIAS: fcvt.w.s a0, fs5{{[[:space:]]}}
130 fcvt.w.s a0, fs5
131 # CHECK-INST: fcvt.wu.s a1, fs6, dyn
132 # CHECK-ALIAS: fcvt.wu.s a1, fs6{{[[:space:]]}}
133 fcvt.wu.s a1, fs6
134 # CHECK-INST: fcvt.s.w ft11, a4, dyn
135 # CHECK-ALIAS: fcvt.s.w ft11, a4{{[[:space:]]}}
136 fcvt.s.w ft11, a4
137 # CHECK-INST: fcvt.s.wu ft0, a5, dyn
138 # CHECK-ALIAS: fcvt.s.wu ft0, a5{{[[:space:]]}}
139 fcvt.s.wu ft0, a5