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: [Committed] S/390: Avoid true-complementary bypass problem for reg-reg compares


Quoting Andreas Krebbel <Andreas.Krebbel@de.ibm.com>:

This is expected behavior.  The function is intended to only return
true if the register is solely read outside an address.  The bypass
problem does not occur with the store you mentioned.

So far, so convincing. And quite interesting.


S/390 does not have instructions which read 2 general purpose
registers outside an address and a comparison with 2 identical
registers will not occur.

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? (I suppose each GPR could have its own adder and then you send it a value to add to itself, kind of object-oriented. But that would seem to require quite a number of gates.)

amylaar@gcc14:~/sn/s390/gcc$ ./cc1 --version
GNU C (GCC) version 4.4.0 20090227 (experimental) (s390-ibm-linux-gnu)
compiled by GNU C version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21), GMP version 4.2.1, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
amylaar@gcc14:~/sn/s390/gcc$ cat tst.c
int
f (int a, int b)
{
if (a < b)
a += b;
return a;
}
amylaar@gcc14:~/sn/s390/gcc$ ./cc1 -O tst.c -quiet
amylaar@gcc14:~/sn/s390/gcc$ grep -A 7 globl tst.s
.globl f
.type f, @function
f:
.LFB0:
cr %r2,%r3
jhe .L2
ar %r2,%r3
.L2:
amylaar@gcc14:~/sn/s390/gcc$ cat tst2.c
register int a __asm("r14");
register int b __asm("r14");


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


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