[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / RISCV / rv32zbs-valid.s
blob2101b106d8b1ee300826d27e3e2595d801514420
1 # With B extension:
2 # RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-b -show-encoding \
3 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
4 # RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-b -show-encoding \
5 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
6 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-b < %s \
7 # RUN: | llvm-objdump --mattr=+experimental-b -d -r - \
8 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
9 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-b < %s \
10 # RUN: | llvm-objdump --mattr=+experimental-b -d -r - \
11 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
13 # With Bitmanip single bit extension:
14 # RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-zbs -show-encoding \
15 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
16 # RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-zbs -show-encoding \
17 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
18 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-zbs < %s \
19 # RUN: | llvm-objdump --mattr=+experimental-zbs -d -r - \
20 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
21 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zbs < %s \
22 # RUN: | llvm-objdump --mattr=+experimental-zbs -d -r - \
23 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
25 # CHECK-ASM-AND-OBJ: bclr t0, t1, t2
26 # CHECK-ASM: encoding: [0xb3,0x12,0x73,0x48]
27 bclr t0, t1, t2
28 # CHECK-ASM-AND-OBJ: bset t0, t1, t2
29 # CHECK-ASM: encoding: [0xb3,0x12,0x73,0x28]
30 bset t0, t1, t2
31 # CHECK-ASM-AND-OBJ: binv t0, t1, t2
32 # CHECK-ASM: encoding: [0xb3,0x12,0x73,0x68]
33 binv t0, t1, t2
34 # CHECK-ASM-AND-OBJ: bext t0, t1, t2
35 # CHECK-ASM: encoding: [0xb3,0x52,0x73,0x48]
36 bext t0, t1, t2
37 # CHECK-ASM-AND-OBJ: bclri t0, t1, 1
38 # CHECK-ASM: encoding: [0x93,0x12,0x13,0x48]
39 bclri t0, t1, 1
40 # CHECK-ASM-AND-OBJ: bseti t0, t1, 1
41 # CHECK-ASM: encoding: [0x93,0x12,0x13,0x28]
42 bseti t0, t1, 1
43 # CHECK-ASM-AND-OBJ: binvi t0, t1, 1
44 # CHECK-ASM: encoding: [0x93,0x12,0x13,0x68]
45 binvi t0, t1, 1
46 # CHECK-ASM-AND-OBJ: bexti t0, t1, 1
47 # CHECK-ASM: encoding: [0x93,0x52,0x13,0x48]
48 bexti t0, t1, 1