This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] [PPC] Convert peephole to peephole2


	* config/rs6000/rs6000.c (registers_ok_for_quad_peep):
	Return false if we have pseudo registers.
	(addrs_ok_for_quad_peep): Rename to ...
	(mems_ok_for_quad_peep): this.
	Add check for volatile memory.
	* config/rs6000/rs6000-protos.h (addrs_ok_for_quad_peep):
	Rename to ...
	(mems_ok_for_quad_peep): this.
	* config/rs6000/rs6000.md: Change peephole's for lfq/stq
	to peephole2's.
	(lfq_power2): New instruction.
	(stfq_power2): Likewise.


This is okay, except:

+   /* We might have been passed a pseudo register.   */
+   if (!HARD_REGISTER_NUM_P (REGNO (reg1))
+       || !HARD_REGISTER_NUM_P (REGNO (reg2)))
+     return 0;

Can't you just test FP_REGNO_P (REGNO (reg1)), instead of
HARD_REGISTER_NUM_P()?  If we're testing for FP mode and hard registers,
we might as well ensure the operand is in FPRs before getting to the
register constraints.

David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]