[PATCH] D48869: [AArch64][SVE] Asm: Support for SVE condition code aliases
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 4 01:55:58 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL336245: [AArch64][SVE] Asm: Support for SVE condition code aliases (authored by s.desmalen, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D48869?vs=153884&id=154065#toc
Repository:
rL LLVM
https://reviews.llvm.org/D48869
Files:
llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/trunk/test/MC/AArch64/SVE/condtion-codes.s
Index: llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -2523,6 +2523,22 @@
.Case("al", AArch64CC::AL)
.Case("nv", AArch64CC::NV)
.Default(AArch64CC::Invalid);
+
+ if (CC == AArch64CC::Invalid &&
+ getSTI().getFeatureBits()[AArch64::FeatureSVE])
+ CC = StringSwitch<AArch64CC::CondCode>(Cond.lower())
+ .Case("none", AArch64CC::EQ)
+ .Case("any", AArch64CC::NE)
+ .Case("nlast", AArch64CC::HS)
+ .Case("last", AArch64CC::LO)
+ .Case("first", AArch64CC::MI)
+ .Case("nfrst", AArch64CC::PL)
+ .Case("pmore", AArch64CC::HI)
+ .Case("plast", AArch64CC::LS)
+ .Case("tcont", AArch64CC::GE)
+ .Case("tstop", AArch64CC::LT)
+ .Default(AArch64CC::Invalid);
+
return CC;
}
Index: llvm/trunk/test/MC/AArch64/SVE/condtion-codes.s
===================================================================
--- llvm/trunk/test/MC/AArch64/SVE/condtion-codes.s
+++ llvm/trunk/test/MC/AArch64/SVE/condtion-codes.s
@@ -0,0 +1,66 @@
+// RUN: llvm-mc -triple aarch64 -show-encoding -mattr=+sve < %s | FileCheck %s
+// RUN: not llvm-mc -triple aarch64 -show-encoding -mattr=-sve < %s 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG
+
+//------------------------------------------------------------------------------
+// Condition code aliases for SVE
+//------------------------------------------------------------------------------
+
+ b.none lbl
+// CHECK: b.eq lbl // encoding: [0bAAA00000,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.none lbl
+
+ b.any lbl
+// CHECK: b.ne lbl // encoding: [0bAAA00001,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.any lbl
+
+ b.nlast lbl
+// CHECK: b.hs lbl // encoding: [0bAAA00010,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.nlast lbl
+
+ b.last lbl
+// CHECK: b.lo lbl // encoding: [0bAAA00011,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.last lbl
+
+ b.first lbl
+// CHECK: b.mi lbl // encoding: [0bAAA00100,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.first lbl
+
+ b.nfrst lbl
+// CHECK: b.pl lbl // encoding: [0bAAA00101,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.nfrst lbl
+
+ b.pmore lbl
+// CHECK: b.hi lbl // encoding: [0bAAA01000,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.pmore lbl
+
+ b.plast lbl
+// CHECK: b.ls lbl // encoding: [0bAAA01001,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.plast lbl
+
+ b.tcont lbl
+// CHECK: b.ge lbl // encoding: [0bAAA01010,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.tcont lbl
+
+ b.tstop lbl
+// CHECK: b.lt lbl // encoding: [0bAAA01011,A,A,0x54]
+// CHECK-NEXT: // fixup A - offset: 0, value: lbl, kind: fixup_aarch64_pcrel_branch19
+// CHECK-DIAG: invalid condition code
+// CHECK-DIAG-NEXT: b.tstop lbl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48869.154065.patch
Type: text/x-patch
Size: 4330 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180704/bd6da1f6/attachment.bin>
More information about the llvm-commits
mailing list