[PATCH] D19265: [Sparc] Add Soft Float support

Jacob Baungard Hansen via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 10:00:56 PDT 2016


jacob_hansen added a comment.

The change should use the same calling convention as GCC does, yes. I tested the change by linking with libgcc (from http://www.gaisler.com/index.php/products/operating-systems/bcc) which contains implementation of all the floating point procedures, that seemed to work perfectly. I also tested it by manually compiling a library of the builtins from the Compiler-RT project (Compiler-RT builtins are compatible with libgcc as noted on http://compiler-rt.llvm.org/), and that worked as well.


================
Comment at: lib/Target/Sparc/SparcTargetMachine.cpp:87
@@ +86,3 @@
+  // function, so we can enable it as a subtarget feature.                      
+  bool softFloat =                                                              
+      F.hasFnAttribute("use-soft-float") &&                                     
----------------
jyknight wrote:
> I wonder what the point of having this redundant way of specifying soft-float via "use-soft-float" is. Clang seems to emit *both* use-soft-float=true and +soft-float. Hopefully this isn't needed these days. @echristo?
I was wondering as well actually, didn't really find an answer to why this might be, but all targets seem to do this at the moment.

================
Comment at: lib/Target/Sparc/SparcTargetMachine.h:25
@@ -24,2 +24,3 @@
   std::unique_ptr<TargetLoweringObjectFile> TLOF;
   SparcSubtarget Subtarget;
+  mutable StringMap<std::unique_ptr<SparcSubtarget>> SubtargetMap;
----------------
jyknight wrote:
> Pretty sure this ought to be deleted while adding the SubtargetMap.
I think you are right. Currently I use that object on line 100 of SparcTargetMachine.cpp to determine whether the target is currently 32 or 64 bit (using is64Bit()). Should I just create a new boolean variable here to determine this value instead of using the Subtarget object, or is there a better way?


http://reviews.llvm.org/D19265





More information about the llvm-commits mailing list