• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc %s -triple=riscv32 -mattr=+d -riscv-no-aliases -show-encoding \
2# RUN:     | FileCheck -check-prefixes=CHECK,CHECK-INST %s
3# RUN: llvm-mc %s -triple=riscv64 -mattr=+d -riscv-no-aliases -show-encoding \
4# RUN:     | FileCheck -check-prefixes=CHECK,CHECK-INST %s
5# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+d < %s \
6# RUN:     | llvm-objdump -mattr=+d -riscv-no-aliases -d - \
7# RUN:     | FileCheck -check-prefix=CHECK-INST %s
8# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+d < %s \
9# RUN:     | llvm-objdump -mattr=+d -riscv-no-aliases -d - \
10# RUN:     | FileCheck -check-prefix=CHECK-INST %s
11
12# Support for the 'D' extension implies support for 'F'
13# CHECK-INST: fadd.s fs10, fs11, ft8
14# CHECK: encoding: [0x53,0xfd,0xcd,0x01]
15fadd.s f26, f27, f28
16
17# CHECK-INST: fld ft0, 12(a0)
18# CHECK: encoding: [0x07,0x30,0xc5,0x00]
19fld f0, 12(a0)
20# CHECK-INST: fld ft1, 4(ra)
21# CHECK: encoding: [0x87,0xb0,0x40,0x00]
22fld f1, +4(ra)
23# CHECK-INST: fld ft2, -2048(a3)
24# CHECK: encoding: [0x07,0xb1,0x06,0x80]
25fld f2, -2048(x13)
26# CHECK-INST: fld ft3, -2048(s1)
27# CHECK: encoding: [0x87,0xb1,0x04,0x80]
28fld f3, %lo(2048)(s1)
29# CHECK-INST: fld ft4, 2047(s2)
30# CHECK: encoding: [0x07,0x32,0xf9,0x7f]
31fld f4, 2047(s2)
32# CHECK-INST: fld ft5, 0(s3)
33# CHECK: encoding: [0x87,0xb2,0x09,0x00]
34fld f5, 0(s3)
35
36# CHECK-INST: fsd ft6, 2047(s4)
37# CHECK: encoding: [0xa7,0x3f,0x6a,0x7e]
38fsd f6, 2047(s4)
39# CHECK-INST: fsd ft7, -2048(s5)
40# CHECK: encoding: [0x27,0xb0,0x7a,0x80]
41fsd f7, -2048(s5)
42# CHECK-INST: fsd fs0, -2048(s6)
43# CHECK: encoding: [0x27,0x30,0x8b,0x80]
44fsd f8, %lo(2048)(s6)
45# CHECK-INST: fsd fs1, 999(s7)
46# CHECK: encoding: [0xa7,0xb3,0x9b,0x3e]
47fsd f9, 999(s7)
48
49# CHECK-INST: fmadd.d fa0, fa1, fa2, fa3, dyn
50# CHECK: encoding: [0x43,0xf5,0xc5,0x6a]
51fmadd.d f10, f11, f12, f13, dyn
52# CHECK-INST: fmsub.d fa4, fa5, fa6, fa7, dyn
53# CHECK: encoding: [0x47,0xf7,0x07,0x8b]
54fmsub.d f14, f15, f16, f17, dyn
55# CHECK-INST: fnmsub.d fs2, fs3, fs4, fs5, dyn
56# CHECK: encoding: [0x4b,0xf9,0x49,0xab]
57fnmsub.d f18, f19, f20, f21, dyn
58# CHECK-INST: fnmadd.d fs6, fs7, fs8, fs9, dyn
59# CHECK: encoding: [0x4f,0xfb,0x8b,0xcb]
60fnmadd.d f22, f23, f24, f25, dyn
61
62# CHECK-INST: fadd.d fs10, fs11, ft8, dyn
63# CHECK: encoding: [0x53,0xfd,0xcd,0x03]
64fadd.d f26, f27, f28, dyn
65# CHECK-INST: fsub.d ft9, ft10, ft11, dyn
66# CHECK: encoding: [0xd3,0x7e,0xff,0x0b]
67fsub.d f29, f30, f31, dyn
68# CHECK-INST: fmul.d ft0, ft1, ft2, dyn
69# CHECK: encoding: [0x53,0xf0,0x20,0x12]
70fmul.d ft0, ft1, ft2, dyn
71# CHECK-INST: fdiv.d ft3, ft4, ft5, dyn
72# CHECK: encoding: [0xd3,0x71,0x52,0x1a]
73fdiv.d ft3, ft4, ft5, dyn
74# CHECK-INST: fsqrt.d ft6, ft7, dyn
75# CHECK: encoding: [0x53,0xf3,0x03,0x5a]
76fsqrt.d ft6, ft7, dyn
77# CHECK-INST: fsgnj.d fs1, fa0, fa1
78# CHECK: encoding: [0xd3,0x04,0xb5,0x22]
79fsgnj.d fs1, fa0, fa1
80# CHECK-INST: fsgnjn.d fa1, fa3, fa4
81# CHECK: encoding: [0xd3,0x95,0xe6,0x22]
82fsgnjn.d fa1, fa3, fa4
83# CHECK-INST: fsgnjx.d fa3, fa2, fa1
84# CHECK: encoding: [0xd3,0x26,0xb6,0x22]
85fsgnjx.d fa3, fa2, fa1
86# CHECK-INST: fmin.d fa5, fa6, fa7
87# CHECK: encoding: [0xd3,0x07,0x18,0x2b]
88fmin.d fa5, fa6, fa7
89# CHECK-INST: fmax.d fs2, fs3, fs4
90# CHECK: encoding: [0x53,0x99,0x49,0x2b]
91fmax.d fs2, fs3, fs4
92
93# CHECK-INST: fcvt.s.d fs5, fs6, dyn
94# CHECK: encoding: [0xd3,0x7a,0x1b,0x40]
95fcvt.s.d fs5, fs6, dyn
96# CHECK-INST: fcvt.d.s fs7, fs8
97# CHECK: encoding: [0xd3,0x0b,0x0c,0x42]
98fcvt.d.s fs7, fs8
99# CHECK-INST: feq.d a1, fs8, fs9
100# CHECK: encoding: [0xd3,0x25,0x9c,0xa3]
101feq.d a1, fs8, fs9
102# CHECK-INST: flt.d a2, fs10, fs11
103# CHECK: encoding: [0x53,0x16,0xbd,0xa3]
104flt.d a2, fs10, fs11
105# CHECK-INST: fle.d a3, ft8, ft9
106# CHECK: encoding: [0xd3,0x06,0xde,0xa3]
107fle.d a3, ft8, ft9
108# CHECK-INST: fclass.d a3, ft10
109# CHECK: encoding: [0xd3,0x16,0x0f,0xe2]
110fclass.d a3, ft10
111
112# CHECK-INST: fcvt.w.d a4, ft11, dyn
113# CHECK: encoding: [0x53,0xf7,0x0f,0xc2]
114fcvt.w.d a4, ft11, dyn
115# CHECK-INST: fcvt.d.w ft0, a5
116# CHECK: encoding: [0x53,0x80,0x07,0xd2]
117fcvt.d.w ft0, a5
118# CHECK-INST: fcvt.d.wu ft1, a6
119# CHECK: encoding: [0xd3,0x00,0x18,0xd2]
120fcvt.d.wu ft1, a6
121
122# Rounding modes
123
124# CHECK-INST: fmadd.d fa0, fa1, fa2, fa3, rne
125# CHECK: encoding: [0x43,0x85,0xc5,0x6a]
126fmadd.d f10, f11, f12, f13, rne
127# CHECK-INST: fmsub.d fa4, fa5, fa6, fa7, rtz
128# CHECK: encoding: [0x47,0x97,0x07,0x8b]
129fmsub.d f14, f15, f16, f17, rtz
130# CHECK-INST: fnmsub.d fs2, fs3, fs4, fs5, rdn
131# CHECK: encoding: [0x4b,0xa9,0x49,0xab]
132fnmsub.d f18, f19, f20, f21, rdn
133# CHECK-INST: fnmadd.d fs6, fs7, fs8, fs9, rup
134# CHECK: encoding: [0x4f,0xbb,0x8b,0xcb]
135fnmadd.d f22, f23, f24, f25, rup
136
137# CHECK-INST: fadd.d fs10, fs11, ft8, rmm
138# CHECK: encoding: [0x53,0xcd,0xcd,0x03]
139fadd.d f26, f27, f28, rmm
140# CHECK-INST: fsub.d ft9, ft10, ft11
141# CHECK: encoding: [0xd3,0x7e,0xff,0x0b]
142fsub.d f29, f30, f31, dyn
143# CHECK-INST: fmul.d ft0, ft1, ft2, rne
144# CHECK: encoding: [0x53,0x80,0x20,0x12]
145fmul.d ft0, ft1, ft2, rne
146# CHECK-INST: fdiv.d ft3, ft4, ft5, rtz
147# CHECK: encoding: [0xd3,0x11,0x52,0x1a]
148fdiv.d ft3, ft4, ft5, rtz
149
150# CHECK-INST: fsqrt.d ft6, ft7, rdn
151# CHECK: encoding: [0x53,0xa3,0x03,0x5a]
152fsqrt.d ft6, ft7, rdn
153# CHECK-INST: fcvt.s.d fs5, fs6, rup
154# CHECK: encoding: [0xd3,0x3a,0x1b,0x40]
155fcvt.s.d fs5, fs6, rup
156# CHECK-INST: fcvt.w.d a4, ft11, rmm
157# CHECK: encoding: [0x53,0xc7,0x0f,0xc2]
158fcvt.w.d a4, ft11, rmm
159# CHECK-INST: fcvt.wu.d a5, ft10, dyn
160# CHECK: encoding: [0xd3,0x77,0x1f,0xc2]
161fcvt.wu.d a5, ft10, dyn
162