|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH v2 12/27] tcg-ppc64: Improve and_i32 with constant |
Date: | Mon, 01 Apr 2013 08:43:24 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
On 2013-04-01 07:55, Aurelien Jarno wrote:
>+static void tcg_out_andi32(TCGContext *s, TCGReg dst, TCGReg src, uint32_t c) >+{ >+ int mb, me; >+ >+ if ((c & 0xffff) == c) { >+ tcg_out32(s, ANDI | SAI(src, dst, c)); >+ return; >+ } else if ((c & 0xffff0000) == c) { >+ tcg_out32(s, ANDIS | SAI(src, dst, c >> 16)); >+ return; >+ } else if (mask_operand(c, &mb, &me)) { >+ tcg_out_rlw(s, RLWINM, dst, src, 0, mb, me); >+ } else { >+ tcg_out_movi(s, TCG_TYPE_I32, 0, c); >+ tcg_out32(s, AND | SAB(src, dst, 0));Give it's a 32-bit constant, wouldn't it be better to use ANDI + ANDIS here?
x & 0xffff0000 & 0x0000ffff == 0. Unlike IOR and XOR... r~
[Prev in Thread] | Current Thread | [Next in Thread] |