[llvm-commits] [patch] Expose RTLIB/float-softening to targets

Tim Northover Tim.Northover at arm.com
Mon Jan 7 08:58:38 PST 2013


Hi all,

This patch moves the two functions softenSetCCOperands and makeLibCall to 
TargetLowering so that they're accessible from target-specific code (as 
opposed to LegalizeTypes only).

This is mostly because of the slightly awkward situation in AArch64 where 
"long double" is IEEE-754 quad-precision (and passed in floating-point 
registers), but there are no actual hardware operations to support operations.

There were two options to deal with this:
  + Mark the type as legal (with associated register class) and expand/lower 
    operations in the Target, using these functions.
  + Make Clang produce a compatible type for argument-passing purposes.

The latter is problematic because SIMD is optional, so there isn't necessarily 
an appropriate type in existence. Something could probably be made to work by 
abusing byval pointers again, but this certainly isn't a nice solution.

So I favour the latter, which has another advantage that we *could* 
potentially optimise some accesses in hardware if it was profitable (e.g you 
might be able to do "fneg -0.0, x" with an "eor", though I haven't 
investigated whether you actually can).

As with the others, it's part of the change to generic LLVM code that we had 
to implement while developing the AArch64 backend. These are the changes that 
no other target exercises, so sending them to the list before would have been 
a little motive-less, and often untestable.

Getting less trivially correct now, but can I commit it?

Cheers.

Tim.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtlib-expose.diff
Type: text/x-patch
Size: 52314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130107/1a874ade/attachment.bin>


More information about the llvm-commits mailing list