From c7b894a06f16ea4bf9d02d8dc310f80e1fae0bf6 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 6 Aug 2009 21:44:41 -0700 Subject: X86: Make scas compare its operands in the right order. --- src/arch/x86/isa/insts/general_purpose/string/scan_string.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/arch/x86/isa/insts/general_purpose/string/scan_string.py b/src/arch/x86/isa/insts/general_purpose/string/scan_string.py index 5b0e74aad..5115fe8a2 100644 --- a/src/arch/x86/isa/insts/general_purpose/string/scan_string.py +++ b/src/arch/x86/isa/insts/general_purpose/string/scan_string.py @@ -62,7 +62,7 @@ def macroop SCAS_M { mov t2, t2, t3, flags=(nCEZF,), dataSize=asz ld t1, es, [1, t0, rdi] - sub t0, t1, rax, flags=(OF, SF, ZF, AF, PF, CF) + sub t0, rax, t1, flags=(OF, SF, ZF, AF, PF, CF) add rdi, rdi, t2, dataSize=asz }; @@ -84,7 +84,7 @@ def macroop SCAS_E_M { topOfLoop: ld t1, es, [1, t0, rdi] - sub t0, t1, rax, flags=(OF, SF, ZF, AF, PF, CF) + sub t0, rax, t1, flags=(OF, SF, ZF, AF, PF, CF) subi rcx, rcx, 1, flags=(EZF,), dataSize=asz add rdi, rdi, t2, dataSize=asz @@ -105,7 +105,7 @@ def macroop SCAS_N_M { topOfLoop: ld t1, es, [1, t0, rdi] - sub t0, t1, rax, flags=(OF, SF, ZF, AF, PF, CF) + sub t0, rax, t1, flags=(OF, SF, ZF, AF, PF, CF) subi rcx, rcx, 1, flags=(EZF,), dataSize=asz add rdi, rdi, t2, dataSize=asz -- cgit v1.2.3