xref: /llvm-project/llvm/test/MC/AArch64/CSSC/cnt_32.s (revision cb261e30fbb174085d2eea4f4afc3cef2838b7f7)
1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+v9.4a < %s \
2// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
4// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
5// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+v9.4a < %s \
6// RUN:        | llvm-objdump -d --mattr=+v9.4a - | FileCheck %s --check-prefix=CHECK-INST
7// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+v9.4a < %s \
9// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
10// RUN:        | llvm-mc -triple=aarch64 -mattr=+v9.4a -disassemble -show-encoding \
11// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12
13cnt     w0, w0
14// CHECK-INST: cnt     w0, w0
15// CHECK-ENCODING: [0x00,0x1c,0xc0,0x5a]
16// CHECK-ERROR: instruction requires: cssc
17
18cnt     w21, w10
19// CHECK-INST: cnt     w21, w10
20// CHECK-ENCODING: [0x55,0x1d,0xc0,0x5a]
21// CHECK-ERROR: instruction requires: cssc
22
23cnt     w23, w13
24// CHECK-INST: cnt     w23, w13
25// CHECK-ENCODING: [0xb7,0x1d,0xc0,0x5a]
26// CHECK-ERROR: instruction requires: cssc
27
28cnt     wzr, wzr
29// CHECK-INST: cnt     wzr, wzr
30// CHECK-ENCODING: [0xff,0x1f,0xc0,0x5a]
31// CHECK-ERROR: instruction requires: cssc
32