All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: identifier scorpio <cidentifier@yahoo.com.cn>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Porting TCG to alpha platform
Date: Fri, 29 Jan 2010 09:37:27 -0800	[thread overview]
Message-ID: <4B631CD7.3010900@twiddle.net> (raw)
In-Reply-To: <4B5E4311.10707@twiddle.net>

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

On 01/25/2010 05:19 PM, Richard Henderson wrote:
> +    } else if (~val == (uint8_t)~val) {
> +        tcg_out_fmt_opi(s, INSN_BIC, ra, ~val, rc);

Bug here.  I've applied the following to my local tree.


r~

[-- Attachment #2: commit-2ecce92 --]
[-- Type: text/plain, Size: 1115 bytes --]

commit 2ecce92da6eee4b3496c7655da45259308abb536
Author: Richard Henderson <rth@twiddle.net>
Date:   Fri Jan 29 09:36:28 2010 -0800

    tcg-alpha: Fix cast error with immediate op to BIC.
    
    The cast was in the wrong place.  A change to ~(uint8_t)val would
    technically produce the correct result, but via a string of implicit
    conversions that are more difficult to follow than simply using the
    0xff mask with the original type.
    
    Adjust the AND test to match, lexically, for cleanliness.

diff --git a/tcg/alpha/tcg-target.c b/tcg/alpha/tcg-target.c
index dcf23f2..5b7dd25 100644
--- a/tcg/alpha/tcg-target.c
+++ b/tcg/alpha/tcg-target.c
@@ -344,9 +344,9 @@ static inline void tcg_out_addi(TCGContext *s, int reg, long val)
 
 static void tcg_out_andi(TCGContext *s, int ra, long val, int rc)
 {
-    if (val == (uint8_t)val) {
+    if (val == (val & 0xff)) {
         tcg_out_fmt_opi(s, INSN_AND, ra, val, rc);
-    } else if (~val == (uint8_t)~val) {
+    } else if (~val == ~(val & 0xff)) {
         tcg_out_fmt_opi(s, INSN_BIC, ra, ~val, rc);
     } else {
         long mask0, maskff;

  parent reply	other threads:[~2010-01-29 17:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22 15:47 [Qemu-devel] [PATCH] Porting TCG to alpha platform identifier scorpio
2010-01-22 18:00 ` Richard Henderson
2010-01-26  1:19 ` Richard Henderson
2010-01-29  1:55   ` identifier scorpio
2010-01-29 17:04     ` Richard Henderson
2010-01-29 21:38       ` Edgar E. Iglesias
2010-01-29 23:04         ` Stefan Weil
2010-01-30  0:38           ` Edgar E. Iglesias
2010-01-30  1:14           ` Laurent Desnogues
2010-01-30  9:30             ` [Qemu-devel] [BUG] qemu-x86_64 crash when running bntest (was: [PATCH] Porting TCG to alpha platform) Stefan Weil
2010-01-30  9:59               ` Laurent Desnogues
2010-01-30 14:47               ` Laurent Desnogues
2010-01-29 17:37   ` Richard Henderson [this message]
2010-01-29 19:19   ` [Qemu-devel] [PATCH] Porting TCG to alpha platform Richard Henderson
2010-01-30  2:45     ` identifier scorpio
2010-01-31 23:09       ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2010-01-21  3:42 identifier scorpio
2010-01-21 18:18 ` Stefan Weil
2010-01-20 17:19 identifier scorpio
2010-01-20 21:26 ` Richard Henderson
2010-01-19  8:47 identifier scorpio
2010-01-19 20:18 ` Richard Henderson
2010-01-19 21:35   ` malc
2010-01-19 21:42 ` Stefan Weil

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=4B631CD7.3010900@twiddle.net \
    --to=rth@twiddle.net \
    --cc=cidentifier@yahoo.com.cn \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.