[Committed] S/390: Avoid true-complementary bypass problem for reg-reg compares

Andreas Krebbel Andreas.Krebbel@de.ibm.com
Sat Feb 28 10:37:00 GMT 2009


> Does that mean that r2 and/or r3 are not general purpose registers?
> Or is the destination of an add not read in an architectural sense?

You are right of course that an add (and others) reads two gprs. But
in this case we only have to care about reads via bypasses.  I don't
think both arguments to an add can be bypass receivers but I'll better
look this up first.

> register int a __asm("r14");
> register int b __asm("r14");

Ok. Using asm("x") you certainly can put every register into an
instruction but I don't consider this an important case.  However the
IFs could be easily modified to issue a NOP in that case.

Bye,

-Andreas-

>
> int
> f ()
> {
>   if (a < b)
>     a += b;
> }
> amylaar@gcc14:~/sn/s390/gcc$ ./cc1 -O tst2.c -quiet
> tst2.c:2: warning: register used for two global register variables
> amylaar@gcc14:~/sn/s390/gcc$ grep -A 7 globl tst2.s
> .globl f
>         .type   f, @function
> f:
> .LFB0:
>         cr      %r14,%r14
>         br      %r14
> .LFE0:
>         .size   f, .-f



More information about the Gcc-patches mailing list