This patch adds support for software floating point operations for Sparc targets.
This is the first in a set of patches to enable software floating point on Sparc. The next patch will enable the option to be used with Clang.
Paths
| Differential D19265
[Sparc] Add Soft Float support ClosedPublic Authored by jacob_hansen on Apr 19 2016, 8:33 AM.
Details Summary This patch adds support for software floating point operations for Sparc targets. This is the first in a set of patches to enable software floating point on Sparc. The next patch will enable the option to be used with Clang.
Diff Detail Event Timelinejacob_hansen updated this object. Comment Actions Reintroduced the header on line 1 of SparcISelLowering.h which was accidentally removed. jacob_hansen updated this object. Comment ActionsI had initially planned to do this over two patches but changed my mind a decided it was better to do it in one. This updated patch ensures that the soft-float attribute is retained when the target options are being reset (this change is identical to how other targets handles this situation). This revision is now accepted and ready to land.Apr 21 2016, 8:28 AM Comment Actions What's the ABI impact of this? Will this use the same calling convention as GCC does?
Comment Actions 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.
jacob_hansen mentioned this in D19797: [Sparc] Constification of TargetMachine arguments.May 2 2016, 2:23 AM jacob_hansen added inline comments. jacob_hansen edited edge metadata. Comment ActionsRemoved the subtarget object from the TargetMachine and changed the way 32/64 bit ness is determined as requested. The constification of TargetMachine arguments in SparcISelLowering and SparcSubtarget has been moved to D19797, which is now a dependency for this patch. jacob_hansen added a parent revision: D19797: [Sparc] Constification of TargetMachine arguments.May 2 2016, 2:48 AM Comment Actions Looks pretty good to me, but here's a few issues:
Like this, for example: define i1 @test_gtdf2(double %a, double %b) #0 { ; CHECK-LABEL: test_gtdf2: ; CHECK: call __gtdf2 %cmp = fcmp ogt double %a, %b ret i1 %cmp }
E.g. for 64abi.ll ; RUN: llc < %s -march=sparcv9 -disable-sparc-delay-filler -disable-sparc-leaf-proc | FileCheck %s --check-prefix=CHECK --check-prefix=HARD ; RUN: llc < %s -march=sparcv9 -disable-sparc-delay-filler -disable-sparc-leaf-proc -mattr=soft-float | FileCheck %s --check-prefix=CHECK --check-prefix=SOFT And then you just expand the CHECK: lines which differ for hard/soft-float to have a separate HARD: and SOFT: case, instead.
jacob_hansen marked 5 inline comments as done. Comment ActionsThe following have been updated in this patch:
Comment Actions Accidentally removed two tests from 32abi.ll in the previous revision, this revision reintroduces them.
Revision Contents
Diff 56877 lib/Target/Sparc/Sparc.td
lib/Target/Sparc/SparcISelLowering.h
lib/Target/Sparc/SparcISelLowering.cpp
lib/Target/Sparc/SparcSubtarget.h
lib/Target/Sparc/SparcSubtarget.cpp
lib/Target/Sparc/SparcTargetMachine.h
lib/Target/Sparc/SparcTargetMachine.cpp
test/CodeGen/SPARC/32abi.ll
test/CodeGen/SPARC/64abi.ll
test/CodeGen/SPARC/soft-float.ll
|
Can you do this constification in a separate patch? (Feel free to just submit it).