[llvm-commits] [llvm] r113996 - in /llvm/trunk: include/llvm/MC/MCInst.h lib/Target/ARM/ARMMCInstLower.cpp lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp

Stephen Canon scanon at apple.com
Wed Sep 15 13:19:36 PDT 2010


On Sep 15, 2010, at 1:05 PM, Dale Johannesen wrote:

> On Sep 15, 2010, at 11:47 AMPDT, Jim Grosbach wrote:
> 
>> Author: grosbach
>> Date: Wed Sep 15 13:47:08 2010
>> New Revision: 113996
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=113996&view=rev
>> Log:
>> Add support for floating point immediates to MC instruction printing. ARM
>> VFP instructions use it for loading some constants, so implement that
>> handling.
>> 
>> Not thrilled with adding a member to MCOperand, but not sure there's much of
>> a better option that's not pretty fragile (like putting a double in the
>> union instead and just assuming that's good enough). Suggestions welcome...
> 
> This doesn't seem to handle NaNs and infinities.  Also, I wonder whether you're guaranteed to get enough precision to represent the value accurately with << (printf does not guarantee this).  Will the assembler take a hex format?  That would be better.

Fortunately, ARM doesn't support NaN or infinity as FP immediates; the allowed FP immediates of the form:

	+/-(1 + m/16)*2^e

where m is an integer in [0,15] and e is an integer in [-3,4].

I agree with Dale that the hex format would be ideal if the assembler will swallow it.  Leave conversions between binary and decimal out of it.



More information about the llvm-commits mailing list