qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Julian Seward <jseward@acm.org>
To: "J. Mayer" <l_indien@magic.fr>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] emu errors for creqv,crnand,crnor,crorc ?
Date: Wed, 31 Oct 2007 12:37:22 +0100	[thread overview]
Message-ID: <200710311237.22174.jseward@acm.org> (raw)


Hi Jocelyn

I ran valgrind's ppc32 insn set tests and got the impression that
the above insns are not correctly implemented.  It seems like 7 bits
of CR are set to 1 and one is set to 0, when it should be the other
way around.  Below is a simple test case.  On QEMU it prints

  result is 000fc000

and on a real 7447

  result is 00004000

Similar behaviour for creqv, crnand, crnor.  But cror, crand, crxor work
OK.  So maybe it is related to the inverted-result-sense?  But the strange
thing is, ~0xFC != 0x04.

J

#include <stdio.h>
void do_crorc_17_14_15 ( void )
{
  UInt res = 0xFFFFFFFF;
  __asm__ __volatile__(
"li 9,0\n"
"\tmtcr 9\n"
"\tmtxer 9\n"
"\tcrorc 17,14,15\n"
"\tmfcr %0"
: /*out*/"=b"(res) : /*in*/ : /*trash*/ "9"
);
  printf("result is %08x\n", res );
}

int main ( void )
{
  do_crorc_17_14_15();
  return 0;
}

             reply	other threads:[~2007-10-31 11:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31 11:37 Julian Seward [this message]
2007-10-31 13:27 ` [Qemu-devel] Re: emu errors for creqv,crnand,crnor,crorc ? Jocelyn Mayer
2007-10-31 13:39   ` Julian Seward
2007-10-31 13:56     ` Jocelyn Mayer

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=200710311237.22174.jseward@acm.org \
    --to=jseward@acm.org \
    --cc=l_indien@magic.fr \
    --cc=qemu-devel@nongnu.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 NNTP newsgroup(s).