From 930dee2c0b8a1128bd0ba23995d666899ef76c89 Mon Sep 17 00:00:00 2001 From: Sjoerd Meijer Date: Thu, 30 May 2019 12:57:04 +0000 Subject: [ARM] add target arch definitions for 8.1-M and MVE This adds: - LLVM subtarget features to make all the new instructions conditional on, - CPU and FPU names for use on clang's command line, with default FPUs set so that "armv8.1-m.main+fp" and "armv8.1-m.main+fp.dp" will select the right FPU features, - architecture extension names "mve" and "mve.fp", - ABI build attribute support for v8.1-M (a new value for Tag_CPU_arch) and MVE (a new actual tag). Patch mostly by Simon Tatham. Differential Revision: https://reviews.llvm.org/D60698 llvm-svn: 362090 --- llvm/lib/Object/ELFObjectFile.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'llvm/lib/Object') diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index 1c3469b5971..c7b71579304 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -230,6 +230,24 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { } } + if (Attributes.hasAttribute(ARMBuildAttrs::MVE_arch)) { + switch(Attributes.getAttributeValue(ARMBuildAttrs::MVE_arch)) { + default: + break; + case ARMBuildAttrs::Not_Allowed: + Features.AddFeature("mve", false); + Features.AddFeature("mve.fp", false); + break; + case ARMBuildAttrs::AllowMVEInteger: + Features.AddFeature("mve.fp", false); + Features.AddFeature("mve"); + break; + case ARMBuildAttrs::AllowMVEIntegerAndFloat: + Features.AddFeature("mve.fp"); + break; + } + } + if (Attributes.hasAttribute(ARMBuildAttrs::DIV_use)) { switch(Attributes.getAttributeValue(ARMBuildAttrs::DIV_use)) { default: -- cgit v1.2.3