[PATCH] D104776: [llvm][ARM] Treat xscale arch as an alias of armv5te

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 04:17:16 PDT 2021


DavidSpickett created this revision.
Herald added subscribers: jeroen.dobbelaere, danielkiss, hiraditya, kristof.beyls.
DavidSpickett requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Previously xscale was known to everything apart
from the ELF streamer so we would crash as soon
as you tried to output an object file.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104776

Files:
  llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
  llvm/test/MC/ARM/directive-arch-xscale.s


Index: llvm/test/MC/ARM/directive-arch-xscale.s
===================================================================
--- /dev/null
+++ llvm/test/MC/ARM/directive-arch-xscale.s
@@ -0,0 +1,34 @@
+@@ Test the .arch directive for xscale
+
+@@ This test case will check the default .ARM.attributes value for the
+@@ xscale architecture.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype asm %s \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ASM
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - | FileCheck %s -check-prefix CHECK-ATTR
+
+	.syntax	unified
+	.arch	xscale
+
+@ CHECK-ASM: 	.arch	xscale
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: CPU_name
+@ CHECK-ATTR:     Value: xscale
+@ CHECK-ATTR:   }
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: CPU_arch
+@ CHECK-ATTR:     Description: ARM v5TE
+@ CHECK-ATTR:   }
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: ARM_ISA_use
+@ CHECK-ATTR:     Description: Permitted
+@ CHECK-ATTR:   }
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: THUMB_ISA_use
+@ CHECK-ATTR:     Description: Thumb-1
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
+
Index: llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
===================================================================
--- llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
@@ -834,6 +834,7 @@
 
   case ARM::ArchKind::ARMV4T:
   case ARM::ArchKind::ARMV5T:
+  case ARM::ArchKind::XSCALE:
   case ARM::ArchKind::ARMV5TE:
   case ARM::ArchKind::ARMV6:
     setAttributeItem(ARM_ISA_use, Allowed, false);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104776.353923.patch
Type: text/x-patch
Size: 1659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210623/baf30851/attachment.bin>


More information about the llvm-commits mailing list