[PATCH] D17925: [ARM] Add Cortex-R8 to target parser and tablegen

Pablo Barrio via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 04:17:29 PST 2016


pbarrio created this revision.
pbarrio added reviewers: rengolin, t.p.northover.
pbarrio added a subscriber: llvm-commits.
pbarrio changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users".
Herald added subscribers: rengolin, aemerson.

Add Cortex-R8 support on LLVM so that it can be used in the Clang and LLVM command lines, and objects compiled for this core.

Build attribute tests added. The command line tests will be added in a separate patch to Clang.

http://reviews.llvm.org/D17925

Files:
  include/llvm/Support/ARMTargetParser.def
  lib/Target/ARM/ARM.td
  test/CodeGen/ARM/build-attributes.ll

Index: test/CodeGen/ARM/build-attributes.ll
===================================================================
--- test/CodeGen/ARM/build-attributes.ll
+++ test/CodeGen/ARM/build-attributes.ll
@@ -105,6 +105,9 @@
 ; RUN: llc < %s -mtriple=armv7r-linux-gnueabi -mcpu=cortex-r7 | FileCheck %s --check-prefix=CORTEX-R7
 ; RUN: llc < %s -mtriple=armv7r-linux-gnueabi -mcpu=cortex-r7  -enable-unsafe-fp-math -disable-fp-elim -enable-no-infs-fp-math -enable-no-nans-fp-math -fp-contract=fast | FileCheck %s --check-prefix=CORTEX-R7-FAST
 ; RUN: llc < %s -mtriple=armv7r-linux-gnueabi -mcpu=cortex-r7 -enable-sign-dependent-rounding-fp-math | FileCheck %s --check-prefix=DYN-ROUNDING
+; RUN: llc < %s -mtriple=armv7r-linux-gnueabi -mcpu=cortex-r8 | FileCheck %s --check-prefix=CORTEX-R8
+; RUN: llc < %s -mtriple=armv7r-linux-gnueabi -mcpu=cortex-r8  -enable-unsafe-fp-math -disable-fp-elim -enable-no-infs-fp-math -enable-no-nans-fp-math -fp-contract=fast | FileCheck %s --check-prefix=CORTEX-R8-FAST
+; RUN: llc < %s -mtriple=armv7r-linux-gnueabi -mcpu=cortex-r8 -enable-sign-dependent-rounding-fp-math | FileCheck %s --check-prefix=DYN-ROUNDING
 ; RUN: llc < %s -mtriple=armv8-linux-gnueabi -mcpu=cortex-a35 | FileCheck %s --check-prefix=CORTEX-A35
 ; RUN: llc < %s -mtriple=armv8-linux-gnueabi -mcpu=cortex-a35  -enable-unsafe-fp-math -disable-fp-elim -enable-no-infs-fp-math -enable-no-nans-fp-math -fp-contract=fast | FileCheck %s --check-prefix=CORTEX-A35-FAST
 ; RUN: llc < %s -mtriple=armv8-linux-gnueabi -mcpu=cortex-a35 -enable-sign-dependent-rounding-fp-math | FileCheck %s --check-prefix=DYN-ROUNDING
@@ -1215,6 +1218,34 @@
 ; CORTEX-R7-FAST-NOT:  .eabi_attribute 22
 ; CORTEX-R7-FAST:  .eabi_attribute 23, 1
 
+; CORTEX-R8:  .cpu cortex-r8
+; CORTEX-R8:  .eabi_attribute 6, 10
+; CORTEX-R8:  .eabi_attribute 7, 82
+; CORTEX-R8:  .eabi_attribute 8, 1
+; CORTEX-R8:  .eabi_attribute 9, 2
+; CORTEX-R8:  .fpu vfpv3-d16-fp16
+; CORTEX-R8-NOT:   .eabi_attribute 19
+;; We default to IEEE 754 compliance
+; CORTEX-R8:  .eabi_attribute 20, 1
+; CORTEX-R8:  .eabi_attribute 21, 1
+; CORTEX-R8-NOT:  .eabi_attribute 22
+; CORTEX-R8:  .eabi_attribute 23, 3
+; CORTEX-R8:  .eabi_attribute 24, 1
+; CORTEX-R8:  .eabi_attribute 25, 1
+; CORTEX-R8-NOT:  .eabi_attribute 28
+; CORTEX-R8:  .eabi_attribute 36, 1
+; CORTEX-R8:  .eabi_attribute 38, 1
+; CORTEX-R8:  .eabi_attribute 42, 1
+; CORTEX-R8:  .eabi_attribute 44, 2
+; CORTEX-R8-NOT:  .eabi_attribute 68
+
+; CORTEX-R8-FAST-NOT:   .eabi_attribute 19
+;; The R8 has the VFPv3 FP unit, which always flushes preserving sign.
+; CORTEX-R8-FAST:  .eabi_attribute 20, 2
+; CORTEX-R8-FAST-NOT:  .eabi_attribute 21
+; CORTEX-R8-FAST-NOT:  .eabi_attribute 22
+; CORTEX-R8-FAST:  .eabi_attribute 23, 1
+
 ; CORTEX-A35:  .cpu cortex-a35
 ; CORTEX-A35:  .eabi_attribute 6, 14
 ; CORTEX-A35:  .eabi_attribute 7, 65
Index: lib/Target/ARM/ARM.td
===================================================================
--- lib/Target/ARM/ARM.td
+++ lib/Target/ARM/ARM.td
@@ -627,6 +627,18 @@
                                                          FeatureAvoidPartialCPSR,
                                                          FeatureT2XtPk]>;
 
+def : ProcessorModel<"cortex-r8",   CortexA8Model,      [ARMv7r,
+                                                         FeatureHasRAS,
+                                                         FeatureVFP3,
+                                                         FeatureD16,
+                                                         FeatureFP16,
+                                                         FeatureMP,
+                                                         FeatureSlowFPBrcc,
+                                                         FeatureHWDivARM,
+                                                         FeatureHasSlowFPVMLx,
+                                                         FeatureAvoidPartialCPSR,
+                                                         FeatureT2XtPk]>;
+
 def : ProcNoItin<"cortex-m3",                           [ARMv7m]>;
 def : ProcNoItin<"sc300",                               [ARMv7m]>;
 
Index: include/llvm/Support/ARMTargetParser.def
===================================================================
--- include/llvm/Support/ARMTargetParser.def
+++ include/llvm/Support/ARMTargetParser.def
@@ -209,6 +209,8 @@
              (AEK_MP | AEK_HWDIVARM))
 ARM_CPU_NAME("cortex-r7", AK_ARMV7R, FK_VFPV3_D16_FP16, false,
              (AEK_MP | AEK_HWDIVARM))
+ARM_CPU_NAME("cortex-r8", AK_ARMV7R, FK_VFPV3_D16_FP16, false,
+             (AEK_MP | AEK_HWDIVARM))
 ARM_CPU_NAME("sc300", AK_ARMV7M, FK_NONE, false, AEK_NONE)
 ARM_CPU_NAME("cortex-m3", AK_ARMV7M, FK_NONE, true, AEK_NONE)
 ARM_CPU_NAME("cortex-m4", AK_ARMV7EM, FK_FPV4_SP_D16, true, AEK_NONE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17925.49948.patch
Type: text/x-patch
Size: 4796 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160307/60aacfb2/attachment.bin>


More information about the llvm-commits mailing list