Subject: Re: I want to rid ugly float load/stores used only for data movement
To: M L Riechers <mlr@rse.com>
From: David Edelsohn <dje@watson.ibm.com>
List: port-macppc
Date: 02/25/2003 17:44:33
> On Mon, 24 Feb 2003 11:24:30 +0000 Richard Earnshaw <rearnsha@arm.com>
> kindly advised me:
>> It ought to be possible to severely discourage use of fp registers for non
>> fp objects by arranging for MEMORY_MOVE_COST to return a large value when
>> given an FP register class and a non-FP mode.
MLR> Thanks for the tip, but it didn't work.
I needed to bump memory_move_cost quite high for the change to
have an effect, and it needs to apply only to DImode, not all float
modes. The patch is relative to more recent sources.
David
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.425
diff -c -p -r1.425 rs6000.c
*** rs6000.c 19 Feb 2003 15:54:30 -0000 1.425
--- rs6000.c 25 Feb 2003 22:43:19 -0000
*************** rs6000_memory_move_cost (mode, class, in
*** 13590,13596 ****
--- 13683,13693 ----
if (reg_classes_intersect_p (class, GENERAL_REGS))
return 4 * HARD_REGNO_NREGS (0, mode);
else if (reg_classes_intersect_p (class, FLOAT_REGS))
+ #if 1
+ return mode == DImode ? 10000 : 4 * HARD_REGNO_NREGS (32, mode);
+ #else
return 4 * HARD_REGNO_NREGS (32, mode);
+ #endif
else if (reg_classes_intersect_p (class, ALTIVEC_REGS))
return 4 * HARD_REGNO_NREGS (FIRST_ALTIVEC_REGNO, mode);
else