summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets/RISCV.h
diff options
context:
space:
mode:
authorAlex Bradbury <asb@lowrisc.org>2019-07-18 18:29:59 +0000
committerAlex Bradbury <asb@lowrisc.org>2019-07-18 18:29:59 +0000
commite078967adf4f4f84da52b8d739aea75ed2ce5f16 (patch)
tree9bb3bc093067c460e63ac4e4260962871ea01699 /clang/lib/Basic/Targets/RISCV.h
parentf332fe642cc576b7c52c643b7024e6839407d34b (diff)
downloadbcm5719-llvm-e078967adf4f4f84da52b8d739aea75ed2ce5f16.tar.gz
bcm5719-llvm-e078967adf4f4f84da52b8d739aea75ed2ce5f16.zip
[RISCV] Hard float ABI support
The RISC-V hard float calling convention requires the frontend to: * Detect cases where, once "flattened", a struct can be passed using int+fp or fp+fp registers under the hard float ABI and coerce to the appropriate type(s) * Track usage of GPRs and FPRs in order to gate the above, and to determine when signext/zeroext attributes must be added to integer scalars This patch attempts to do this in compliance with the documented ABI, and uses ABIArgInfo::CoerceAndExpand in order to do this. @rjmccall, as author of that code I've tagged you as reviewer for initial feedback on my usage. Note that a previous version of the ABI indicated that when passing an int+fp struct using a GPR+FPR, the int would need to be sign or zero-extended appropriately. GCC never did this and the ABI was changed, which makes life easier as ABIArgInfo::CoerceAndExpand can't currently handle sign/zero-extension attributes. Re-landed after backing out 366450 due to missed hunks. Differential Revision: https://reviews.llvm.org/D60456 llvm-svn: 366480
Diffstat (limited to 'clang/lib/Basic/Targets/RISCV.h')
-rw-r--r--clang/lib/Basic/Targets/RISCV.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Basic/Targets/RISCV.h b/clang/lib/Basic/Targets/RISCV.h
index bc814b79ce5..ce193feaeb9 100644
--- a/clang/lib/Basic/Targets/RISCV.h
+++ b/clang/lib/Basic/Targets/RISCV.h
@@ -87,8 +87,7 @@ public:
}
bool setABI(const std::string &Name) override {
- // TODO: support ilp32f and ilp32d ABIs.
- if (Name == "ilp32") {
+ if (Name == "ilp32" || Name == "ilp32f" || Name == "ilp32d") {
ABI = Name;
return true;
}
@@ -105,8 +104,7 @@ public:
}
bool setABI(const std::string &Name) override {
- // TODO: support lp64f and lp64d ABIs.
- if (Name == "lp64") {
+ if (Name == "lp64" || Name == "lp64f" || Name == "lp64d") {
ABI = Name;
return true;
}
OpenPOWER on IntegriCloud