diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp --- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -2916,6 +2916,7 @@ {"ls64", {AArch64::FeatureLS64}}, {"xs", {AArch64::FeatureXS}}, {"pauth", {AArch64::FeaturePAuth}}, + {"flagm", {AArch64::FeatureFlagM}}, // FIXME: Unsupported extensions {"pan", {}}, {"lor", {}}, diff --git a/llvm/test/MC/AArch64/armv8.4a-flagm.s b/llvm/test/MC/AArch64/armv8.4a-flagm.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/AArch64/armv8.4a-flagm.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+flagm < %s | FileCheck %s + +cfinv + +// CHECK: .text +cfinv // encoding: [0x1f,0x40,0x00,0xd5] diff --git a/llvm/test/MC/AArch64/directive-arch_extension-negative.s b/llvm/test/MC/AArch64/directive-arch_extension-negative.s --- a/llvm/test/MC/AArch64/directive-arch_extension-negative.s +++ b/llvm/test/MC/AArch64/directive-arch_extension-negative.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -triple aarch64 \ -// RUN: -mattr=+crc,+sm4,+sha3,+sha2,+aes,+fp,+neon,+ras,+lse,+predres,+ccdp,+mte,+tlb-rmi,+pan-rwv,+ccpp,+rcpc,+ls64 \ +// RUN: -mattr=+crc,+sm4,+sha3,+sha2,+aes,+fp,+neon,+ras,+lse,+predres,+ccdp,+mte,+tlb-rmi,+pan-rwv,+ccpp,+rcpc,+ls64,+flagm \ // RUN: -filetype asm -o - %s 2>&1 | FileCheck %s .arch_extension axp64 @@ -124,3 +124,10 @@ ld64b x0, [x13] // CHECK: [[@LINE-1]]:1: error: instruction requires: ls64 // CHECK-NEXT: ld64b x0, [x13] + +cfinv +// CHECK-NOT: [[@LINE-1]]:1: error: instruction requires: flagm +.arch_extension noflagm +cfinv +// CHECK: [[@LINE-1]]:1: error: instruction requires: flagm +// CHECK-NEXT: cfinv diff --git a/llvm/test/MC/AArch64/directive-arch_extension.s b/llvm/test/MC/AArch64/directive-arch_extension.s --- a/llvm/test/MC/AArch64/directive-arch_extension.s +++ b/llvm/test/MC/AArch64/directive-arch_extension.s @@ -75,3 +75,7 @@ .arch_extension pauth paciasp // CHECK: paciasp + +.arch_extension flagm +cfinv +// CHECK: cfinv