1 # SCIE - SiFive Custom Instructions Extension.
2 # RUN: llvm-mc %s -triple=riscv32 -mattr=+xsfcie -riscv-no-aliases -show-encoding \
3 # RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s
4 # RUN: llvm-mc %s -triple=riscv64 -mattr=+xsfcie -riscv-no-aliases -show-encoding \
5 # RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s
6 # RUN: llvm-mc %s -triple=riscv32 -mattr=+xsfcie -riscv-no-aliases -show-encoding 2>&1 \
7 # RUN: | FileCheck -check-prefixes=CHECK-WARN %s
8 # RUN: llvm-mc %s -triple=riscv64 -mattr=+xsfcie -riscv-no-aliases -show-encoding 2>&1 \
9 # RUN: | FileCheck -check-prefixes=CHECK-WARN %s
10 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+xsfcie < %s \
11 # RUN: | llvm-objdump --mattr=+xsfcie -M no-aliases -d - \
12 # RUN: | FileCheck -check-prefix=CHECK-INST %s
13 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+xsfcie < %s \
14 # RUN: | llvm-objdump --mattr=+xsfcie -M no-aliases -d - \
15 # RUN: | FileCheck -check-prefix=CHECK-INST %s
16 # RUN: llvm-mc %s -triple=riscv64 -mcpu=sifive-s76 -riscv-no-aliases -show-encoding \
17 # RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s
18 # RUN: llvm-mc %s -triple=riscv64 -mcpu=sifive-s76 -riscv-no-aliases -show-encoding 2>&1 \
19 # RUN: | FileCheck -check-prefixes=CHECK-WARN %s
20 # RUN: llvm-mc -filetype=obj -triple riscv64 -mcpu=sifive-s76 < %s \
21 # RUN: | llvm-objdump --mcpu=sifive-s76 -M no-aliases -d - \
22 # RUN: | FileCheck -check-prefix=CHECK-INST %s
24 # CHECK-INST: cflush.d.l1 zero
25 # CHECK-ENC: encoding: [0x73,0x00,0x00,0xfc]
26 # CHECK-INST: cflush.d.l1 zero
27 # CHECK-ENC: encoding: [0x73,0x00,0x00,0xfc]
31 # CHECK-INST: cflush.d.l1 t2
32 # CHECK-ENC: encoding: [0x73,0x80,0x03,0xfc]
35 # CHECK-INST: cdiscard.d.l1 zero
36 # CHECK-ENC: encoding: [0x73,0x00,0x20,0xfc]
37 # CHECK-INST: cdiscard.d.l1 zero
38 # CHECK-ENC: encoding: [0x73,0x00,0x20,0xfc]
42 # CHECK-INST: cdiscard.d.l1 t2
43 # CHECK-ENC: encoding: [0x73,0x80,0x23,0xfc]
47 # CHECK-ENC: encoding: [0x73,0x00,0x50,0x30]
52 # CHECK-INST: csrrs t2, mbpm, zero
53 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x7c]
55 # CHECK-INST: csrrs t2, mbpm, zero
56 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x7c]
64 # CHECK-INST: csrrs t2, mfd, zero
65 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x7c]
67 # CHECK-INST: csrrs t2, mfd, zero
68 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x7c]
76 # CHECK-INST: csrrs t2, mpd, zero
77 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0x7c]
79 # CHECK-INST: csrrs t2, mpd, zero
80 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0x7c]
88 # CHECK-INST: csrrs t1, mnscratch, zero
89 # CHECK-ENC: encoding: [0x73,0x23,0x00,0x35]
90 # CHECK-WARN: warning: 'miselect' CSR is not available on the current subtarget. Instead 'mnscratch' CSR will be used.
92 # CHECK-INST: csrrs t2, mnscratch, zero
93 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x35]
95 csrrs t1
, mnscratch
, zero
96 csrrs t1
, miselect
, zero
102 # CHECK-INST: csrrs t1, mnepc, zero
103 # CHECK-ENC: encoding: [0x73,0x23,0x10,0x35]
104 # CHECK-WARN: warning: 'mireg' CSR is not available on the current subtarget. Instead 'mnepc' CSR will be used.
106 # CHECK-INST: csrrs t2, mnepc, zero
107 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x35]
109 csrrs t1
, mnepc
, zero
110 csrrs t1
, mireg
, zero
112 csrrs t2
, 0x351, zero
116 # CHECK-INST: csrrs t1, mncause, zero
117 # CHECK-ENC: encoding: [0x73,0x23,0x20,0x35]
119 # CHECK-INST: csrrs t2, mncause, zero
120 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0x35]
122 csrrs t1
, mncause
, zero
124 csrrs t2
, 0x352, zero
128 # CHECK-INST: csrrs t1, mnstatus, zero
129 # CHECK-ENC: encoding: [0x73,0x23,0x30,0x35]
131 # CHECK-INST: csrrs t2, mnstatus, zero
132 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0x35]
134 csrrs t1
, mnstatus
, zero
136 csrrs t2
, 0x353, zero