From 15c2eb13f2af1f0e75bb7d961515e29bd7253962 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 17 May 2008 18:13:27 -0600 Subject: [PATCH] don't generate code for a move from a register to itself --- src/x86.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/x86.cpp b/src/x86.cpp index 2e1cec2fc8..544e08a495 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -714,9 +714,11 @@ moveRR(Context* c, unsigned size, Assembler::Register* a, case 8: case 4: - rex(c); - c->code.append(0x89); - c->code.append(0xc0 | (a->low << 3) | b->low); + if (a->low != b->low) { + rex(c); + c->code.append(0x89); + c->code.append(0xc0 | (a->low << 3) | b->low); + } break; } }