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 -filetype=obj -triple=riscv32 -mattr=+experimental-b < %s \
5# RUN:     | llvm-objdump --mattr=+experimental-b -d -r - \
6# RUN:     | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
7
8# With Bitmanip base extension:
9# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-zbb -show-encoding \
10# RUN:     | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
11# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-zbb < %s \
12# RUN:     | llvm-objdump --mattr=+experimental-zbb -d -r - \
13# RUN:     | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
14
15# CHECK-ASM-AND-OBJ: slo t0, t1, t2
16# CHECK-ASM: encoding: [0xb3,0x12,0x73,0x20]
17slo t0, t1, t2
18# CHECK-ASM-AND-OBJ: sro t0, t1, t2
19# CHECK-ASM: encoding: [0xb3,0x52,0x73,0x20]
20sro t0, t1, t2
21# CHECK-ASM-AND-OBJ: sloi t0, t1, 0
22# CHECK-ASM: encoding: [0x93,0x12,0x03,0x20]
23sloi t0, t1, 0
24# CHECK-ASM-AND-OBJ: sroi t0, t1, 0
25# CHECK-ASM: encoding: [0x93,0x52,0x03,0x20]
26sroi t0, t1, 0
27# CHECK-ASM-AND-OBJ: clz t0, t1
28# CHECK-ASM: encoding: [0x93,0x12,0x03,0x60]
29clz t0, t1
30# CHECK-ASM-AND-OBJ: ctz t0, t1
31# CHECK-ASM: encoding: [0x93,0x12,0x13,0x60]
32ctz t0, t1
33# CHECK-ASM-AND-OBJ: pcnt t0, t1
34# CHECK-ASM: encoding: [0x93,0x12,0x23,0x60]
35pcnt t0, t1
36# CHECK-ASM-AND-OBJ: sext.b t0, t1
37# CHECK-ASM: encoding: [0x93,0x12,0x43,0x60]
38sext.b t0, t1
39# CHECK-ASM-AND-OBJ: sext.h t0, t1
40# CHECK-ASM: encoding: [0x93,0x12,0x53,0x60]
41sext.h t0, t1
42# CHECK-ASM-AND-OBJ: min t0, t1, t2
43# CHECK-ASM: encoding: [0xb3,0x42,0x73,0x0a]
44min t0, t1, t2
45# CHECK-ASM-AND-OBJ: max t0, t1, t2
46# CHECK-ASM: encoding: [0xb3,0x52,0x73,0x0a]
47max t0, t1, t2
48# CHECK-ASM-AND-OBJ: minu t0, t1, t2
49# CHECK-ASM: encoding: [0xb3,0x62,0x73,0x0a]
50minu t0, t1, t2
51# CHECK-ASM-AND-OBJ: maxu t0, t1, t2
52# CHECK-ASM: encoding: [0xb3,0x72,0x73,0x0a]
53maxu t0, t1, t2
54