[PATCH] Patch to make AArch64 AsmParser be case insensitive about accepting vector register names

James Molloy james at jamesmolloy.co.uk
Mon Jun 8 14:24:56 PDT 2015


Hi Ranjeet,

This looks good to me.

Cheers,

James
On Mon, 8 Jun 2015 at 21:44, Ranjeet Singh <ranjeet.singh at arm.com> wrote:

> The AArch64 AsmParser doesn't accept vector register names that start with
> an upper-case 'V'. GAS is case insensitive about these register names and
> so is armasm, this patch will make armclang behave the same way.
>
> http://reviews.llvm.org/D10320
>
> Files:
>   lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
>   test/MC/AArch64/case-insen-reg-names.s
>
> Index: lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
> ===================================================================
> --- lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
> +++ lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
> @@ -1764,7 +1764,7 @@
>  /// }
>
>  static unsigned matchVectorRegName(StringRef Name) {
> -  return StringSwitch<unsigned>(Name)
> +  return StringSwitch<unsigned>(Name.lower())
>        .Case("v0", AArch64::Q0)
>        .Case("v1", AArch64::Q1)
>        .Case("v2", AArch64::Q2)
> Index: test/MC/AArch64/case-insen-reg-names.s
> ===================================================================
> --- test/MC/AArch64/case-insen-reg-names.s
> +++ test/MC/AArch64/case-insen-reg-names.s
> @@ -0,0 +1,8 @@
> +// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding < %s |
> FileCheck %s
> +
> +fadd v0.2d, v5.2d, v6.2d
> +fadd V0.2d, V5.2d, V6.2d
> +fadd v0.2d, V5.2d, v6.2d
> +// CHECK: fadd v0.2d, v5.2d, v6.2d          // encoding:
> [0xa0,0xd4,0x66,0x4e]
> +// CHECK: fadd v0.2d, v5.2d, v6.2d          // encoding:
> [0xa0,0xd4,0x66,0x4e]
> +// CHECK: fadd v0.2d, v5.2d, v6.2d          // encoding:
> [0xa0,0xd4,0x66,0x4e]
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150608/8e336bd8/attachment.html>


More information about the llvm-commits mailing list