summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets
diff options
context:
space:
mode:
authorSam Elliott <selliott@lowrisc.org>2019-07-31 09:45:55 +0000
committerSam Elliott <selliott@lowrisc.org>2019-07-31 09:45:55 +0000
commit9e6b2e1605825f852d59034e053a22b712f8fcb9 (patch)
tree0bd2d3e2193272fd1f04540a7a0696d6de560831 /clang/lib/Basic/Targets
parent5ea07f7c072c10c517cae51e67d84f711f0007ed (diff)
downloadbcm5719-llvm-9e6b2e1605825f852d59034e053a22b712f8fcb9.tar.gz
bcm5719-llvm-9e6b2e1605825f852d59034e053a22b712f8fcb9.zip
[RISCV] Support 'f' Inline Assembly Constraint
Summary: This adds the 'f' inline assembly constraint, as supported by GCC. An 'f'-constrained operand is passed in a floating point register. Exactly which kind of floating-point register (32-bit or 64-bit) is decided based on the operand type and the available standard extensions (-f and -d, respectively). This patch adds support in both the clang frontend, and LLVM itself. Reviewers: asb, lewis-revill Reviewed By: asb Subscribers: hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65500 llvm-svn: 367403
Diffstat (limited to 'clang/lib/Basic/Targets')
-rw-r--r--clang/lib/Basic/Targets/RISCV.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets/RISCV.cpp b/clang/lib/Basic/Targets/RISCV.cpp
index 788ae693939..a634ba69f3c 100644
--- a/clang/lib/Basic/Targets/RISCV.cpp
+++ b/clang/lib/Basic/Targets/RISCV.cpp
@@ -71,6 +71,10 @@ bool RISCVTargetInfo::validateAsmConstraint(
// A 5-bit unsigned immediate for CSR access instructions.
Info.setRequiresImmediate(0, 31);
return true;
+ case 'f':
+ // A floating-point register.
+ Info.setAllowsRegister();
+ return true;
}
}
OpenPOWER on IntegriCloud