public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43871]  New: -mcpu=power4 -mtune=cell emits power7/cell-only opcodes
@ 2010-04-23 19:01 marcus at jet dot franken dot de
  2010-04-23 19:04 ` [Bug target/43871] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: marcus at jet dot franken dot de @ 2010-04-23 19:01 UTC (permalink / raw)
  To: gcc-bugs

my kernel does not boot anymore on a ppc970 (powermac g5) due to an illegal
instruction caused by gcc 4.5

research showed that the DI bswap64 operation is optimized to ldbrx even on
power4, but causes an sigill there.

gcc -m64 -c -O2 -mcpu=power4 -mtune=cell
gcc/testsuite/gcc.target/powerpc/optimize-bswapdi-3.c ; objdump -d
optimize-bswapdi-3.o
0000000000000000 <.swap64_load>:
   0:   7c 00 1c 28     .long 0x7c001c28
   4:   7c 03 03 78     mr      r3,r0
   8:   4e 80 00 20     blr


while:

gcc -m64 -c -O2 -mcpu=power4
gcc/testsuite/gcc.target/powerpc/optimize-bswapdi-3.c ; objdump -d
optimize-bswapdi-3.o
0000000000000000 <.swap64_load>:
   0:   39 20 00 04     li      r9,4
   4:   7c 00 1c 2c     lwbrx   r0,0,r3
   8:   7d 69 1c 2c     lwbrx   r11,r9,r3
   c:   79 6a 07 c6     rldicr  r10,r11,32,31
  10:   7d 4a 03 78     or      r10,r10,r0
  14:   7d 43 53 78     mr      r3,r10
  18:   4e 80 00 20     blr


-mcpu=power4 -mtune=cell should not start to emit opcodes invalid on power4.

I think the bswap64 emitter logic in config/rs6000/rs6000.md is incorrect


-- 
           Summary: -mcpu=power4 -mtune=cell emits power7/cell-only opcodes
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marcus at jet dot franken dot de
 GCC build triplet: powerpc-unknown-linux-gnu
  GCC host triplet: powerpc-unknown-linux-gnu
GCC target triplet: powerpc-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43871


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/43871] -mcpu=power4 -mtune=cell emits power7/cell-only opcodes
  2010-04-23 19:01 [Bug target/43871] New: -mcpu=power4 -mtune=cell emits power7/cell-only opcodes marcus at jet dot franken dot de
@ 2010-04-23 19:04 ` pinskia at gcc dot gnu dot org
  2010-04-23 19:12 ` marcus at jet dot franken dot de
  2010-05-19 11:38 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-04-23 19:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-04-23 19:04 -------
This was my fault to some extend; when I added =cell support I asked about if
we should emit the cell instructions for -mtune= and the answer was that using
-mtune=cell is most likely not going to be used.  In fact -mtune=cell most
likely produce much slower code on most other processors because of the non use
of the dot instructions (and other stuff).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43871


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/43871] -mcpu=power4 -mtune=cell emits power7/cell-only opcodes
  2010-04-23 19:01 [Bug target/43871] New: -mcpu=power4 -mtune=cell emits power7/cell-only opcodes marcus at jet dot franken dot de
  2010-04-23 19:04 ` [Bug target/43871] " pinskia at gcc dot gnu dot org
@ 2010-04-23 19:12 ` marcus at jet dot franken dot de
  2010-05-19 11:38 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: marcus at jet dot franken dot de @ 2010-04-23 19:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from marcus at jet dot franken dot de  2010-04-23 19:12 -------
well, the kernel now does easier ... 

in arch/powerpc/Makefile:

ifeq ($(CONFIG_TUNE_CELL),y)
        KBUILD_CFLAGS += $(call cc-option,-mtune=cell)
endif


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43871


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/43871] -mcpu=power4 -mtune=cell emits power7/cell-only opcodes
  2010-04-23 19:01 [Bug target/43871] New: -mcpu=power4 -mtune=cell emits power7/cell-only opcodes marcus at jet dot franken dot de
  2010-04-23 19:04 ` [Bug target/43871] " pinskia at gcc dot gnu dot org
  2010-04-23 19:12 ` marcus at jet dot franken dot de
@ 2010-05-19 11:38 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-19 11:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-05-19 11:38 -------
Confirmed.  Adding spu maintainers to CC.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uweigand at de dot ibm dot
                   |                            |com, dje at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-05-19 11:38:26
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43871


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-19 11:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-23 19:01 [Bug target/43871] New: -mcpu=power4 -mtune=cell emits power7/cell-only opcodes marcus at jet dot franken dot de
2010-04-23 19:04 ` [Bug target/43871] " pinskia at gcc dot gnu dot org
2010-04-23 19:12 ` marcus at jet dot franken dot de
2010-05-19 11:38 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).