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.
Differential D19265
[Sparc] Add Soft Float support jacob_hansen on Apr 19 2016, 8:33 AM. Authored by
Details 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 TimelineComment Actions Reintroduced the header on line 1 of SparcISelLowering.h which was accidentally removed. Comment Actions I 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). 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.
Comment Actions Removed 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. 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.
Comment Actions The following have been updated in this patch:
Comment Actions Accidentally removed two tests from 32abi.ll in the previous revision, this revision reintroduces them. |
Can you do this constification in a separate patch? (Feel free to just submit it).