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: CLASS_CANNOT_CHANGE_MODE* redesign


> I will, yes ;)  Although also df.* needs a change, and that's not

I thought it was all related, that's why I left it out.

> necessaryly local to new RA.  Have you looked at that already?  If not
> I'll do that to.  But I can only begin over the weekend.

That would be super!

> > Michael: regarding your request for an easy way to subtract a whole set
> > of hardregs, you could use cannot_change_mode_set_regs() in my patch.
> 
> I see, yes.  That again brings me to the performance point, sorry to
> insist so much ;-)  I think what I then want is a simple table
> HARD_REG_SET invalid_regs[NUM_MACHINE_MODES][NUM_MACHINE_MODES] which
> directly gives me that set.  Or alternatively not a HARD_REG_SET but a

Ah yes, I see your point.  I've rewritten cannot_change_mode_set_regs()
to use cannot_change_mode_regs().  The latter will get you exactly the
invalid registers you want.  See below.

If this is ok with you, we can commit (provided rth is ok with the change
below).  You can hack on the RA this weekend, and we can tackle the
performance/optimizations next week.  But at least, we can get this in,
and the interface won't change much (except later you'll use a table
instead of a function call ;-)).

How does that sound?

Aldy

+ /* Set bits in *USED which correspond to registers which can't change
+    their mode from FROM to any mode in which REGNO was encountered.  */
+ 
+ void
+ cannot_change_mode_set_regs (used, from, regno)
+      HARD_REG_SET *used;
+      enum machine_mode from;
+      unsigned int regno;
+ {
+   enum machine_mode to;
+ 
+   for (to = VOIDmode; to < MAX_MACHINE_MODE; ++to)
+     if (REGNO_REG_SET_P (&subregs_of_mode[to], regno))
+       cannot_change_mode_regs (used, from, to);
+ }
+
+ /* Set bits in *BAD which correspond to registers which can't change
+    their mode from FROM to TO.  */
+ 
+ void
+ cannot_change_mode_regs (bad, from, to)
+      HARD_REG_SET *bad;
+      enum machine_mode from, to;
+ {
+   unsigned int r;
+   enum reg_class class;
+ 
+   for (r = 0; r < FIRST_PSEUDO_REGISTER; ++r)
+     {
+       class = REGNO_REG_CLASS (r);
+       if (CLASS_CANNOT_CHANGE_MODE_P (class, from, to))
+       SET_HARD_REG_BIT (*bad, r);
+     }
+ }


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