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 base extension:
14 # RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-zbb -riscv-no-aliases -show-encoding \
15 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
16 # RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-zbb -riscv-no-aliases -show-encoding \
17 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
18 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-zbb < %s \
19 # RUN: | llvm-objdump --mattr=+experimental-zbb -M no-aliases -d -r - \
20 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
21 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zbb < %s \
22 # RUN: | llvm-objdump --mattr=+experimental-zbb -M no-aliases -d -r - \
23 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
25 # CHECK-ASM-AND-OBJ: clz t0, t1
26 # CHECK-ASM: encoding: [0x93,0x12,0x03,0x60]
28 # CHECK-ASM-AND-OBJ: ctz t0, t1
29 # CHECK-ASM: encoding: [0x93,0x12,0x13,0x60]
31 # CHECK-ASM-AND-OBJ: cpop t0, t1
32 # CHECK-ASM: encoding: [0x93,0x12,0x23,0x60]
34 # CHECK-ASM-AND-OBJ: sext.b t0, t1
35 # CHECK-ASM: encoding: [0x93,0x12,0x43,0x60]
37 # CHECK-ASM-AND-OBJ: sext.h t0, t1
38 # CHECK-ASM: encoding: [0x93,0x12,0x53,0x60]
40 # CHECK-ASM-AND-OBJ: min t0, t1, t2
41 # CHECK-ASM: encoding: [0xb3,0x42,0x73,0x0a]
43 # CHECK-ASM-AND-OBJ: minu t0, t1, t2
44 # CHECK-ASM: encoding: [0xb3,0x52,0x73,0x0a]
46 # CHECK-ASM-AND-OBJ: max t0, t1, t2
47 # CHECK-ASM: encoding: [0xb3,0x62,0x73,0x0a]
49 # CHECK-ASM-AND-OBJ: maxu t0, t1, t2
50 # CHECK-ASM: encoding: [0xb3,0x72,0x73,0x0a]