[PATCH] generate power6 DFP instructions

Jan Hubicka hubicka@ucw.cz
Thu Sep 6 00:21:00 GMT 2007


> This patch adds support for generating POWER6 decimal floating point
> instructions for existing options -mcpu=power6 or -mdfp.  It doesn't
> support using DFP instructions for SDmode (decimal32), which will be
> added when GCC can follow the PowerPC ELF ABIs to put SDmode in floating
> point registers; Peter Bergner is working on that.  It doesn't provide a
> conversion from TDmode to DDmode, which I will submit separately because
> I have questions about how it ought to be done.
> 
> Conversions between decimal float types and unsigned integer types are
> done a bit differently from binary float conversions to preserve
> accuracy for very large integers that are powers of ten.
> 
> Tested on powerpc64-linux with -m32/-m64, with some testing on POWER6
> hardware for DFP tests; OK for trunk?
> 
> 2007-08-17  Janis Johnson  <janis187@us.ibm.com>
> 
> gcc/
> 	* optabs.c (expand_float): Convert unsigned integer as signed only
> 	if it provides sufficient accuracy; add mode argument to real_2expN.
> 	(expand_fix): Fix comment typos; extend binary float into mode
> 	wider than destination for converion to unsigned integer; add mode
> 	argument to real_2expN.
> 	* real.c (real_2expN): Add mode argument to special-case decimal
> 	float values.
> 	* real.h (real_2expN): Ditto.

This changes need updating in i386 backend. I've checked in the
following obvious patch that lets me to bootstrap.

Honza

Index: ChangeLog
===================================================================
*** ChangeLog	(revision 128161)
--- ChangeLog	(working copy)
***************
*** 1,5 ****
--- 1,10 ----
  2007-09-06  Jan Hubicka  <jh@suse.cz>
  
+ 	* i386.c (ix86_expand_lround, ix86_expand_round): Update call of
+ 	real_2expN.
+ 
+ 2007-09-06  Jan Hubicka  <jh@suse.cz>
+ 
  	* opts.c (common_handle_option): Enable inlining functions for
  	-fprofile-generate.
  
Index: config/i386/i386.c
===================================================================
*** config/i386/i386.c	(revision 128161)
--- config/i386/i386.c	(working copy)
*************** ix86_expand_lround (rtx op0, rtx op1)
*** 23144,23150 ****
  
    /* load nextafter (0.5, 0.0) */
    fmt = REAL_MODE_FORMAT (mode);
!   real_2expN (&half_minus_pred_half, -(fmt->p) - 1);
    REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf, half_minus_pred_half);
  
    /* adj = copysign (0.5, op1) */
--- 23144,23150 ----
  
    /* load nextafter (0.5, 0.0) */
    fmt = REAL_MODE_FORMAT (mode);
!   real_2expN (&half_minus_pred_half, -(fmt->p) - 1, mode);
    REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf, half_minus_pred_half);
  
    /* adj = copysign (0.5, op1) */
*************** ix86_expand_round (rtx operand0, rtx ope
*** 23555,23561 ****
  
    /* load nextafter (0.5, 0.0) */
    fmt = REAL_MODE_FORMAT (mode);
!   real_2expN (&half_minus_pred_half, -(fmt->p) - 1);
    REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf, half_minus_pred_half);
  
    /* xa = xa + 0.5 */
--- 23555,23561 ----
  
    /* load nextafter (0.5, 0.0) */
    fmt = REAL_MODE_FORMAT (mode);
!   real_2expN (&half_minus_pred_half, -(fmt->p) - 1, mode);
    REAL_ARITHMETIC (pred_half, MINUS_EXPR, dconsthalf, half_minus_pred_half);
  
    /* xa = xa + 0.5 */



More information about the Gcc-patches mailing list