public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "christian dot metzler at bmw-carit dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/26398]  New: Wrong code generated with SPE-Extensions on PowerPC
Date: Tue, 21 Feb 2006 16:23:00 -0000	[thread overview]
Message-ID: <bug-26398-12234@http.gcc.gnu.org/bugzilla/> (raw)

Hello,

I got some problems with the SPE-extensions. Quite a severe as I think.

For
        float t;
        char u;

        t = 1.0;
        u = ( ( t<0.0)?-1:((t>0.0)?1:0));

with the following compiler flags

-mcpu=8540 -meabi -mspe=yes -mabi=spe -mfloat-gprs=yes
-fsingle-precision-constant -fshort-double -mno-sdata -c -g -D__EMB_RPE__

the result for u is either -1 if t < 0.0 or 0 else. The case if t > 0.0 is
never taken. My diab shows correct results. 

Generated assembler:

        t = 1.0;

lis       r0,0x3F80 
stw       r0,0x1EC(r31)

        u = ( ( t<0.0)?-1:((t>0.0)?1:0));

lwz       r9,0x1EC(r31)
li        r0,0x0
efscmplt  cr7,r9,r0 
bgt       cr7,0x39F04
b         0x39F10
li        r0,-0x1
stb       r0,0x1F1(r31)
b         0x39F28
lwz       r9,0x1EC(r31)
li        r0,0x0 
efscmpgt  cr7,r9,r0
mfcr      r0
extrwi    r0,r0,0x1,0x1E ; r0,r0,1,30
stb       r0,0x1F1(r31)
lbz       r0,0x1F1(r31)
stb       r0,0x1F0(r31)

Looking in the e500-core-manual it shows that the GT-compare-result is stored
in bit 61 of CR. I suppose in this case the extrwi (or rlwinm-Instruction in
case of objdump) should check for bit 29 (=61-32), which is not the case.

Sincery yours,
Christian Metzler.


-- 
           Summary: Wrong code generated with SPE-Extensions on PowerPC
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: christian dot metzler at bmw-carit dot de
  GCC host triplet: i686-pc-cygwin
GCC target triplet: powerpc-unknown-eabi


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


             reply	other threads:[~2006-02-21 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-21 16:23 christian dot metzler at bmw-carit dot de [this message]
2006-02-21 16:32 ` [Bug target/26398] " pinskia at gcc dot gnu dot org
2006-02-22  5:47 ` pinskia at gcc dot gnu dot org
2006-02-22  8:11 ` christian dot metzler at bmw-carit dot de
2006-02-23 12:25 ` christian dot metzler at bmw-carit dot de
2006-02-27  3:42 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26398-12234@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).