summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@imgtec.com>2015-12-14 17:57:33 +0000
committerPetar Jovanovic <petar.jovanovic@imgtec.com>2015-12-14 17:57:33 +0000
commit280f7101e8c82ae7e09a71f439dbcce18f2e18fc (patch)
tree46ffe72c522706e397f64850268c843496364b46 /llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
parent88a328fbbede8750a401a62c9e3677d681619999 (diff)
downloadbcm5719-llvm-280f7101e8c82ae7e09a71f439dbcce18f2e18fc.tar.gz
bcm5719-llvm-280f7101e8c82ae7e09a71f439dbcce18f2e18fc.zip
[Power PC] llvm soft float support for ppc32
This is the second in a set of patches for soft float support for ppc32, it enables soft float operations. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D13700 llvm-svn: 255516
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetMachine.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
index 946e0f10cdd..d24b590317f 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -239,6 +239,19 @@ PPCTargetMachine::getSubtargetImpl(const Function &F) const {
? FSAttr.getValueAsString().str()
: TargetFS;
+ // FIXME: This is related to the code below to reset the target options,
+ // we need to know whether or not the soft float flag is set on the
+ // function before we can generate a subtarget. We also need to use
+ // it as a key for the subtarget since that can be the only difference
+ // between two functions.
+ bool SoftFloat =
+ F.hasFnAttribute("use-soft-float") &&
+ F.getFnAttribute("use-soft-float").getValueAsString() == "true";
+ // If the soft float attribute is set on the function turn on the soft float
+ // subtarget feature.
+ if (SoftFloat)
+ FS += FS.empty() ? "+soft-float" : ",+soft-float";
+
auto &I = SubtargetMap[CPU + FS];
if (!I) {
// This needs to be done before we create a new subtarget since any
OpenPOWER on IntegriCloud