RFC: constraint reshuffle for SH gcc target port

Joern Rennecke joern.rennecke@superh.com
Fri Jun 13 19:25:00 GMT 2003


The gcc.dg/compat/scalar-return-4 c_compat_x_tst.o compile failure
is yet another of these little bugs that can be easily solved with
another constraint - but there are more problems like this, the SH
port is already very low on free constraint letters, and the existing
constraint letters are also somewhat haphazard.  For instance, the
'Z' constraint really belongs into the CONST_OK_FOR_CONSTRAINT space,
but it didn't fit there because all the letters had been used up.
Thus, I think it is time to reshuffle some constraints to get some
more order in the existing constraints and make room for new ones.
This will affect assembler templates that use any of the renamed
constraints.  I have attached an outline of the existing usage of
uppercase constraint letters (lowercase letters that are not defined
in a machine-independent way are used for register classes on the SH),
what constraints I want to change, and list of the uppercase constraints
after the reshuffle.

-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
-------------- next part --------------
Status quo:

E F : CONST_DOUBLE / CONST_VECTOR & MODE_VECTOR_FLOAT
G H : CONST_DOUBLE & CONST_DOUBLE_OK_FOR_LETTER_P
I J K L M N O P : CONST_OK_FOR_LETTER_P
V : memory operand with non-offsettable address
X : match anything

remaining for extra constraints:
A B C D
Q R S T U W Y Z
\-------/
classic extra constraints

currently not used for SH:
A C D R

constant letter assignments
 I -128 .. 127
 J -32768 .. 32767
 K 1 | 2 | 8 | 16
 L 0 .. 255
 M 1
 N 0
 O -32 .. 31
 P -512 .. 511

B: SCRATCH - for the scratch register in movsi_ie in the fldi0 / fldi0 cases
   (only SuperH local)
S: 16 bit constant, literal or symbolic
T: label or symbol
U: zero in any mode
Y: non-explicit constants that can be directly loaded into a general purpose
   register in PIC code.  like 's' except we don't allow PIC_DIRECT_ADDR_P
   (only SuperH local)
Z: 0xffffffff00000000 | 0x00000000ffffffff

remapping:

Z->J16
U->Z
I->I08
J->I16
O->I06
P->I10
L->K08
K->P27
S->C16
T->Csy
Y->Cpg
b->B00

new CONST_OK_FOR_CONSTRAINT / EXTRA_CONSTRAINT_STR list:

A: Addresses (constraint len == 3)
 Ac4: sh4 cache operations
 Ac5: sh5 cache operations
Bxx: miscellaneous constraints
 Bsc: SCRATCH - for the scratch register in movsi_ie in the fldi0 / fldi0 cases
C: Constants other than only CONST_INT (constraint len == 3)
 C16: 16 bit constant, literal or symbolic
 Csy: label or symbol
 Cpg: non-explicit constants that can be directly loaded into a general purpose
   register in PIC code.  like 's' except we don't allow PIC_DIRECT_ADDR_P
IJKLMNOP: CONT_INT constants
 Ixx: signed xx bit
 J16: 0xffffffff00000000 | 0x00000000ffffffff
 Kxx: unsigned xx bit
 M: 1
 N: 0
 P27: 1 | 2 | 8 | 16
Q: pc relative load operand
Rxx: reserved for exotic register classes.
S: extra memory (storage) constraints (constraint len == 3)
 Sr0: operations using r0 (to fix testsuite failure involving CQI value in r0)
 Sua: unaligned memory operations
W: vector
Z: zero in any mode

unused CONST_INT constraint letters: LO
unused EXTRA_CONSTRAINT letters: D T U Y


More information about the Gcc mailing list