This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add Cortex-R52 target to LLVM
ClosedPublic

Authored by javed.absar on Oct 3 2016, 2:19 PM.

Details

Summary

This patch adds Cortex-R52, the new ARM real-time processor, to LLVM. Cortex-R52 implements the ARMv8-R architecture. I have submitted a corresponding patch for review to clang , for clang related changes (and tests).

Diff Detail

Event Timeline

javed.absar updated this revision to Diff 73340.Oct 3 2016, 2:19 PM
javed.absar retitled this revision from to [ARM] Add Cortex-R52 target to LLVM.
javed.absar updated this object.
javed.absar added a subscriber: llvm-commits.
rengolin added inline comments.Oct 5 2016, 3:49 AM
include/llvm/Support/ARMTargetParser.def
99

Are this all minimum requirements? Or just some common implementation?

226

is CRC guaranteed to be in every R52?

lib/Support/TargetParser.cpp
726

Merge with AK_ARMV7R case

lib/Target/ARM/ARM.td
484

Same question here about minimum support.

rengolin added inline comments.Oct 5 2016, 4:06 AM
include/llvm/Support/ARMTargetParser.def
226

Shouldn't R52 be the default CPU (false -> true), given it's the only entry for ARMv8R?

jmolloy requested changes to this revision.Oct 5 2016, 4:59 AM
jmolloy edited edge metadata.
jmolloy added inline comments.
include/llvm/Support/ARMTargetParser.def
98

OK, it took me a while to get to the bottom of this list and I had to grep through a lot of pre-alpha unreleased documentation so I'll try to explain my reasoning:

  • AEK_SEC - *INCORRECT* - I think this means TrustZone and ARMv8-R does not have TrustZone.
  • AEK_MP - Multiprocessing extensions - Mandatory
  • AEK_VIRT - Virtualization extensions - My reading is that this is mandatory although I can't find that definitively stated anywhere as yet.
  • AEK_HWDIVARM | AEK_HWDIV - UDIV/SDIV in A32/T32 modes - These are transitively manadatory because of AEK_VIRT (see ARMv7AR ARMARM 4.4.4 "ARMv7 implementation requirements and options for the divide instructions")
  • AEK_DSP - Required in ARMv8-A, and not explicitly mentioned otherwise.
  • AEK_CRC - Required.
226

I don't think you should mention CRC here because it's no longer an optional extension, it's mandatory.

lib/Target/ARM/ARM.td
482

I agree with all of these except this. Why does ARMv8-R have this but ARMv8-A does not?

820

Because ARMv8-R mandates HWDiv and HWDivARM, I don't think these are required here.

This revision now requires changes to proceed.Oct 5 2016, 4:59 AM
javed.absar updated this revision to Diff 73782.Oct 6 2016, 6:32 AM
javed.absar edited edge metadata.

Revised based on comments from Renato and James. Thanks to both for the review and feedback.

jmolloy requested changes to this revision.Oct 6 2016, 6:45 AM
jmolloy edited edge metadata.
jmolloy added inline comments.
include/llvm/Support/ARMTargetParser.def
98

You removed AEK_DSP - I think it is still required here.

lib/Target/ARM/ARM.td
486

What about FeatureDSP?

This revision now requires changes to proceed.Oct 6 2016, 6:45 AM
javed.absar updated this revision to Diff 73808.Oct 6 2016, 9:28 AM
javed.absar edited edge metadata.

Added back AEK_DSP/FeatureDSP. It was a mistake to remove it seems to be indeed required.

jmolloy accepted this revision.Oct 6 2016, 9:33 AM
jmolloy edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 6 2016, 9:33 AM

Committed in rL283542. Please specify "Differential revision: <URL>" as last line of commit message.