[PATCH][ARM] Fix %N output modifier

Kyrill Tkachov kyrylo.tkachov@arm.com
Tue Sep 2 15:34:00 GMT 2014

Hi all,

Following the transition to UAL I noticed that the %N output modifier 
doesn't really work. It calls fp_const_from_val to get the VFP encoding 
from a real value, but fp_const_from_val only supports the floating 
point zero constant and ICEs for all other values, making it useless for 
pretty much all purposes.
For example, the testcase in this patch ICEs.

With the conversion to UAL we no longer output the VFP encoded form of 
floating point constants but rather their natural representation. This 
patch makes sure that %N negates its operand properly and outputs it as 
a normal floating point number. It also handles operand lossage (if, for 
example, the user passed in a register instead of a constant).

Ok for upstream?

2014-09-02  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/arm/arm.c (fp_const_from_val): Delete prototype and
     (arm_print_operand): Don't use fp_const_from_val in the 'N' case.
     Report unsupported operand.

2014-09-02  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * gcc.target/arm/n_output_modifier_1.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-modn.patch
Type: text/x-patch
Size: 2721 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140902/b6ca130d/attachment.bin>

More information about the Gcc-patches mailing list