[PATCH] D20709: Support ARM subtarget feature +long64

Pirama Arumuga Nainar via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 16:01:57 PDT 2016


pirama created this revision.
pirama added a reviewer: kristof.beyls.
pirama added subscribers: srhines, cfe-commits.
Herald added subscribers: rengolin, aemerson.

Set alignment and width of long datatype to be 64-bits if the ARM
subtarget feature +long64 is set.

http://reviews.llvm.org/D20709

Files:
  lib/Basic/Targets.cpp
  test/CodeGen/arm-types.c

Index: test/CodeGen/arm-types.c
===================================================================
--- /dev/null
+++ test/CodeGen/arm-types.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -triple arm -DLONG_SIZE_AND_ALIGN=4
+// RUN: %clang_cc1 -triple arm -target-feature +long64 -DLONG_SIZE_AND_ALIGN=8
+
+_Static_assert(sizeof(long) == LONG_SIZE_AND_ALIGN, "sizeof long is wrong");
+_Static_assert(_Alignof(long) == LONG_SIZE_AND_ALIGN, "alignof long is wrong");
Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp
+++ lib/Basic/Targets.cpp
@@ -4955,6 +4955,8 @@
         Unaligned = 0;
       } else if (Feature == "+fp16") {
         HW_FP |= HW_FP_HP;
+      } else if (Feature == "+long64") {
+        LongWidth = LongAlign = 64;
       }
     }
     HW_FP &= ~HW_FP_remove;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20709.58713.patch
Type: text/x-patch
Size: 843 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160526/9d4aead0/attachment.bin>


More information about the cfe-commits mailing list