projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
add1615
)
tcg/i386: optimize and $0xff(ff), reg
author
Aurelien Jarno
<aurelien@aurel32.net>
Sun, 27 Sep 2009 17:36:05 +0000
(19:36 +0200)
committer
Aurelien Jarno
<aurelien@aurel32.net>
Sun, 27 Sep 2009 18:00:38 +0000
(20:00 +0200)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/i386/tcg-target.c
patch
|
blob
|
history
diff --git
a/tcg/i386/tcg-target.c
b/tcg/i386/tcg-target.c
index
a95fe4c
..
d318443
100644
(file)
--- a/
tcg/i386/tcg-target.c
+++ b/
tcg/i386/tcg-target.c
@@
-281,6
+281,12
@@
static inline void tgen_arithi(TCGContext *s, int c, int r0, int32_t val)
if (val == (int8_t)val) {
tcg_out_modrm(s, 0x83, c, r0);
tcg_out8(s, val);
+ } else if (c == ARITH_AND && val == 0xffu && r0 < 4) {
+ /* movzbl */
+ tcg_out_modrm(s, 0xb6 | P_EXT, r0, r0);
+ } else if (c == ARITH_AND && val == 0xffffu) {
+ /* movzwl */
+ tcg_out_modrm(s, 0xb7 | P_EXT, r0, r0);
} else {
tcg_out_modrm(s, 0x81, c, r0);
tcg_out32(s, val);