This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN 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]

[patch][rfa] Add ltu,leu,gtu,geu support for unsigned modes


Dave Brolley writes:
 > Hi,
 > 
 > The attached patch adds support for the unsigned modes (UQI, UHI, USI, 
 > UDI, UINT) for the cgen rtl ops ltu, leu, gtu and geu. These calls can 
 > be generated by code like
 > 
 > (if (ltu (zext UDI op1) (zext UDI op2 ))(set op3 op1 ))
 > 
 > ok to commit?

Well ....

The first indication that you're barking up the wrong tree is that
cgen-ops.h generally doesn't have Umode support (e.g. ADDUSI).
There's a reason.  It's excessive and unnecessary and I don't want
to unnecessarily propagate them.  GCC doesn't have Umodes.
I added Umodes mostly as an escape hatch, but a controlled one.
If this patch goes in and the general direction it takes cgen-ops.h in
is allowed to proceed, I think that's a bad thing.

Do you get the desired result if you replace the above with

  (if (ltu (zext DI op1) (zext DI op2 ))(set op3 op1 ))

?

Note this: from doc/rtl.texi:

@item UQI,UHI,USI,UDI
Unsigned versions of QI,HI,SI,DI.

These modes do not appear in semantic RTL.  Instead, the RTL function
specifies the signedness of its operands where necessary.

??? I'm not entirely sure these unsigned modes are needed.
They are useful in removing any ambiguity in how to sign extend constants
which has been a source of problems in GCC.

??? Some existing ports use these modes.


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