[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / RISCV / rv32zbp-valid.s
blob0d7fc033c6a8c8563484a139adb760f2a503f962
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-prefixes=CHECK-OBJ,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-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s
13 # With Bitmanip permutation extension:
14 # RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-zbp -show-encoding \
15 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
16 # RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-zbp -show-encoding \
17 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
18 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-zbp < %s \
19 # RUN: | llvm-objdump --mattr=+experimental-zbp -d -r - \
20 # RUN: | FileCheck --check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s
21 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zbp < %s \
22 # RUN: | llvm-objdump --mattr=+experimental-zbp -d -r - \
23 # RUN: | FileCheck --check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s
25 # CHECK-ASM-AND-OBJ: gorc t0, t1, t2
26 # CHECK-ASM: encoding: [0xb3,0x52,0x73,0x28]
27 gorc t0, t1, t2
28 # CHECK-ASM-AND-OBJ: grev t0, t1, t2
29 # CHECK-ASM: encoding: [0xb3,0x52,0x73,0x68]
30 grev t0, t1, t2
31 # CHECK-ASM-AND-OBJ: gorci t0, t1, 0
32 # CHECK-ASM: encoding: [0x93,0x52,0x03,0x28]
33 gorci t0, t1, 0
34 # CHECK-ASM-AND-OBJ: grevi t0, t1, 0
35 # CHECK-ASM: encoding: [0x93,0x52,0x03,0x68]
36 grevi t0, t1, 0
37 # CHECK-ASM-AND-OBJ: shfl t0, t1, t2
38 # CHECK-ASM: encoding: [0xb3,0x12,0x73,0x08]
39 shfl t0, t1, t2
40 # CHECK-ASM-AND-OBJ: unshfl t0, t1, t2
41 # CHECK-ASM: encoding: [0xb3,0x52,0x73,0x08]
42 unshfl t0, t1, t2
43 # CHECK-ASM-AND-OBJ: shfli t0, t1, 0
44 # CHECK-ASM: encoding: [0x93,0x12,0x03,0x08]
45 shfli t0, t1, 0
46 # CHECK-ASM-AND-OBJ: unshfli t0, t1, 0
47 # CHECK-ASM: encoding: [0x93,0x52,0x03,0x08]
48 unshfli t0, t1, 0
49 # CHECK-ASM-AND-OBJ: pack t0, t1, t2
50 # CHECK-ASM: encoding: [0xb3,0x42,0x73,0x08]
51 pack t0, t1, t2
52 # CHECK-ASM-AND-OBJ: packu t0, t1, t2
53 # CHECK-ASM: encoding: [0xb3,0x42,0x73,0x48]
54 packu t0, t1, t2
55 # CHECK-ASM-AND-OBJ: packh t0, t1, t2
56 # CHECK-ASM: encoding: [0xb3,0x72,0x73,0x08]
57 packh t0, t1, t2
58 # CHECK-ASM: gorci t0, t1, 7
59 # CHECK-OBJ: orc.b t0, t1
60 # CHECK-ASM: encoding: [0x93,0x52,0x73,0x28]
61 gorci t0, t1, 7
62 # CHECK-ASM-AND-OBJ: xperm.n t0, t1, t2
63 # CHECK-ASM: encoding: [0xb3,0x22,0x73,0x28]
64 xperm.n t0, t1, t2
65 # CHECK-ASM-AND-OBJ: xperm.b t0, t1, t2
66 # CHECK-ASM: encoding: [0xb3,0x42,0x73,0x28]
67 xperm.b t0, t1, t2
68 # CHECK-ASM-AND-OBJ: xperm.h t0, t1, t2
69 # CHECK-ASM: encoding: [0xb3,0x62,0x73,0x28
70 xperm.h t0, t1, t2