This is the mail archive of the gcc@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: insns for register-move between general and floating


On 22 March 2006 00:41, Greg McGary wrote:

> I'm working on a port that has instructions to move bits between
> 64-bit floating-point and 64-bit general-purpose regs.  I say "bits"
> because there's no conversion between float and int: the bit pattern
> is unaltered.  Therefore, it's possible to use scratch FPRs for
> spilling GPRs & vice-versa, and float<->int conversions need not go
> through memory.
> 
> Among all the knobs to turn regarding register classes, reload
> classes, and modes+constraints on movM, floatMN2, fixMN2 patterns,
> I need some advice on how to do this properly.

  Off the top of my head, you could take a look at the rs6000, which uses IIRC
fp regs to move ints about in at least some circumstances[*] - sorry that I
don't remember the full details, but you'll find at least something relevant
there I think.

  The general principle would be that you'd have predicates on some insns that
accept both fprs and gprs and you'd have predicates on others that accept only
gprs and you teach reload how to move a pseudo between fpr and gpr reg classes
and the rest pretty much takes care of itself IIUIC.  HARD_REGNO_MODE_OK would
come into play here as well.....



    cheers,
      DaveK

[*] ISTR that some of those circumstances (at least /used to/) include "when
hard-float is disabled", which used to be a regular cause of surprise and
confusion back round 2.95.x time... :)
-- 
Can't think of a witty .sigline today....


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