Skip to content

[AArch64][llvm] Unify AArch64 tests into a single file (2/4) (NFC) #146329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: users/jthackray/unify-tests1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 129 additions & 55 deletions llvm/test/MC/AArch64/armv9.2a-mec.s
Original file line number Diff line number Diff line change
@@ -1,55 +1,129 @@
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+mec < %s | FileCheck %s
// RUN: not llvm-mc -triple aarch64-none-linux-gnu < %s 2>&1 | FileCheck --check-prefix=CHECK-NO-MEC %s

mrs x0, MECIDR_EL2
// CHECK: mrs x0, MECIDR_EL2 // encoding: [0xe0,0xa8,0x3c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
mrs x0, MECID_P0_EL2
// CHECK: mrs x0, MECID_P0_EL2 // encoding: [0x00,0xa8,0x3c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
mrs x0, MECID_A0_EL2
// CHECK: mrs x0, MECID_A0_EL2 // encoding: [0x20,0xa8,0x3c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
mrs x0, MECID_P1_EL2
// CHECK: mrs x0, MECID_P1_EL2 // encoding: [0x40,0xa8,0x3c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
mrs x0, MECID_A1_EL2
// CHECK: mrs x0, MECID_A1_EL2 // encoding: [0x60,0xa8,0x3c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
mrs x0, VMECID_P_EL2
// CHECK: mrs x0, VMECID_P_EL2 // encoding: [0x00,0xa9,0x3c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
mrs x0, VMECID_A_EL2
// CHECK: mrs x0, VMECID_A_EL2 // encoding: [0x20,0xa9,0x3c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
mrs x0, MECID_RL_A_EL3
// CHECK: mrs x0, MECID_RL_A_EL3 // encoding: [0x20,0xaa,0x3e,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
msr MECID_P0_EL2, x0
// CHECK: msr MECID_P0_EL2, x0 // encoding: [0x00,0xa8,0x1c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
msr MECID_A0_EL2, x0
// CHECK: msr MECID_A0_EL2, x0 // encoding: [0x20,0xa8,0x1c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
msr MECID_P1_EL2, x0
// CHECK: msr MECID_P1_EL2, x0 // encoding: [0x40,0xa8,0x1c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
msr MECID_A1_EL2, x0
// CHECK: msr MECID_A1_EL2, x0 // encoding: [0x60,0xa8,0x1c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
msr VMECID_P_EL2, x0
// CHECK: msr VMECID_P_EL2, x0 // encoding: [0x00,0xa9,0x1c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
msr VMECID_A_EL2, x0
// CHECK: msr VMECID_A_EL2, x0 // encoding: [0x20,0xa9,0x1c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
msr MECID_RL_A_EL3, x0
// CHECK: msr MECID_RL_A_EL3, x0 // encoding: [0x20,0xaa,0x1e,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate

dc cigdpae, x0
// CHECK: dc cigdpae, x0 // encoding: [0xe0,0x7e,0x0c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:14: error: DC CIGDPAE requires: mec
dc cipae, x0
// CHECK: dc cipae, x0 // encoding: [0x00,0x7e,0x0c,0xd5]
// CHECK-NO-MEC: [[@LINE-2]]:14: error: DC CIPAE requires: mec
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+mec < %s \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-ERROR
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
// RUN: | llvm-objdump -d --mattr=+mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
// RUN: | llvm-objdump -d --mattr=-mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+mec < %s \
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
// RUN: | llvm-mc -triple=aarch64 -mattr=+mec -disassemble -show-encoding \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: llvm-mc -triple aarch64 -disassemble < %s 2>&1 | FileCheck --check-prefix=CHECK-NO-MEC %s


mrs x0, MECIDR_EL2
// CHECK-INST: mrs x0, MECIDR_EL2
// CHECK-ENCODING: encoding: [0xe0,0xa8,0x3c,0xd5]
// CHECK-ERROR: error: expected readable system register
// CHECK-UNKNOWN: d53ca8e0 mrs x0, S3_4_C10_C8_7

mrs x0, MECID_P0_EL2
// CHECK-INST: mrs x0, MECID_P0_EL2
// CHECK-ENCODING: encoding: [0x00,0xa8,0x3c,0xd5]
// CHECK-ERROR: error: expected readable system register
// CHECK-UNKNOWN: d53ca800 mrs x0, S3_4_C10_C8_0

mrs x0, MECID_A0_EL2
// CHECK-INST: mrs x0, MECID_A0_EL2
// CHECK-ENCODING: encoding: [0x20,0xa8,0x3c,0xd5]
// CHECK-ERROR: error: expected readable system register
// CHECK-UNKNOWN: d53ca820 mrs x0, S3_4_C10_C8_1

mrs x0, MECID_P1_EL2
// CHECK-INST: mrs x0, MECID_P1_EL2
// CHECK-ENCODING: encoding: [0x40,0xa8,0x3c,0xd5]
// CHECK-ERROR: error: expected readable system register
// CHECK-UNKNOWN: d53ca840 mrs x0, S3_4_C10_C8_2

mrs x0, MECID_A1_EL2
// CHECK-INST: mrs x0, MECID_A1_EL2
// CHECK-ENCODING: encoding: [0x60,0xa8,0x3c,0xd5]
// CHECK-ERROR: error: expected readable system register
// CHECK-UNKNOWN: d53ca860 mrs x0, S3_4_C10_C8_3

mrs x0, VMECID_P_EL2
// CHECK-INST: mrs x0, VMECID_P_EL2
// CHECK-ENCODING: encoding: [0x00,0xa9,0x3c,0xd5]
// CHECK-ERROR: error: expected readable system register
// CHECK-UNKNOWN: d53ca900 mrs x0, S3_4_C10_C9_0

mrs x0, VMECID_A_EL2
// CHECK-INST: mrs x0, VMECID_A_EL2
// CHECK-ENCODING: encoding: [0x20,0xa9,0x3c,0xd5]
// CHECK-ERROR: error: expected readable system register
// CHECK-UNKNOWN: d53ca920 mrs x0, S3_4_C10_C9_1

mrs x0, MECID_RL_A_EL3
// CHECK-INST: mrs x0, MECID_RL_A_EL3
// CHECK-ENCODING: encoding: [0x20,0xaa,0x3e,0xd5]
// CHECK-ERROR: error: expected readable system register
// CHECK-UNKNOWN: d53eaa20 mrs x0, S3_6_C10_C10_1

msr MECID_P0_EL2, x0
// CHECK-INST: msr MECID_P0_EL2, x0
// CHECK-ENCODING: encoding: [0x00,0xa8,0x1c,0xd5]
// CHECK-ERROR: error: expected writable system register or pstate
// CHECK-UNKNOWN: d51ca800 msr S3_4_C10_C8_0, x0

msr MECID_A0_EL2, x0
// CHECK-INST: msr MECID_A0_EL2, x0
// CHECK-ENCODING: encoding: [0x20,0xa8,0x1c,0xd5]
// CHECK-ERROR: error: expected writable system register or pstate
// CHECK-UNKNOWN: d51ca820 msr S3_4_C10_C8_1, x0

msr MECID_P1_EL2, x0
// CHECK-INST: msr MECID_P1_EL2, x0
// CHECK-ENCODING: encoding: [0x40,0xa8,0x1c,0xd5]
// CHECK-ERROR: error: expected writable system register or pstate
// CHECK-UNKNOWN: d51ca840 msr S3_4_C10_C8_2, x0

msr MECID_A1_EL2, x0
// CHECK-INST: msr MECID_A1_EL2, x0
// CHECK-ENCODING: encoding: [0x60,0xa8,0x1c,0xd5]
// CHECK-ERROR: error: expected writable system register or pstate
// CHECK-UNKNOWN: d51ca860 msr S3_4_C10_C8_3, x0

msr VMECID_P_EL2, x0
// CHECK-INST: msr VMECID_P_EL2, x0
// CHECK-ENCODING: encoding: [0x00,0xa9,0x1c,0xd5]
// CHECK-ERROR: error: expected writable system register or pstate
// CHECK-UNKNOWN: d51ca900 msr S3_4_C10_C9_0, x0

msr VMECID_A_EL2, x0
// CHECK-INST: msr VMECID_A_EL2, x0
// CHECK-ENCODING: encoding: [0x20,0xa9,0x1c,0xd5]
// CHECK-ERROR: error: expected writable system register or pstate
// CHECK-UNKNOWN: d51ca920 msr S3_4_C10_C9_1, x0

msr MECID_RL_A_EL3, x0
// CHECK-INST: msr MECID_RL_A_EL3, x0
// CHECK-ENCODING: encoding: [0x20,0xaa,0x1e,0xd5]
// CHECK-ERROR: error: expected writable system register or pstate
// CHECK-UNKNOWN: d51eaa20 msr S3_6_C10_C10_1, x0

dc cigdpae, x0
// CHECK-INST: dc cigdpae, x0
// CHECK-ENCODING: encoding: [0xe0,0x7e,0x0c,0xd5]
// CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIGDPAE requires: mec
// CHECK-UNKNOWN: d50c7ee0 sys #4, c7, c14, #7, x0
// CHECK-NO-MEC: sys #4, c7, c14, #7, x0

dc cipae, x0
// CHECK-INST: dc cipae, x0
// CHECK-ENCODING: encoding: [0x00,0x7e,0x0c,0xd5]
// CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIPAE requires: mec
// CHECK-UNKNOWN: d50c7e00 sys #4, c7, c14, #0, x0
// CHECK-NO-MEC: sys #4, c7, c14, #0, x0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are also missing the test that CHECK-NO-MEC was doing, that they disassemble to a clean sys without +mec.

We should probably also be checking that the sys instructions correctly assemble somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, both fixed.


sys #4, c7, c14, #7, x0
// CHECK-INST: dc cigdpae, x0
// CHECK-ENCODING: encoding: [0xe0,0x7e,0x0c,0xd5]
// CHECK-UNKNOWN: d50c7ee0 sys #4, c7, c14, #7, x0

sys #4, c7, c14, #0, x0
// CHECK-INST: dc cipae, x0
// CHECK-ENCODING: encoding: [0x00,0x7e,0x0c,0xd5]
// CHECK-UNKNOWN: d50c7e00 sys #4, c7, c14, #0, x0
98 changes: 0 additions & 98 deletions llvm/test/MC/AArch64/armv9.4-lse128.s

This file was deleted.

Loading
Loading