From: Gabe Black Date: Thu, 12 Jun 2008 04:46:04 +0000 (-0400) Subject: X86: Fix the implementation of BSF. X-Git-Tag: m5_2.0_beta6~167 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e2991b529fd63f4d7c56518ebfbd2424f964172;p=gem5.git X86: Fix the implementation of BSF. --- diff --git a/src/arch/x86/isa/insts/general_purpose/compare_and_test/bit_scan.py b/src/arch/x86/isa/insts/general_purpose/compare_and_test/bit_scan.py index a18437df3..f2a3db8a3 100644 --- a/src/arch/x86/isa/insts/general_purpose/compare_and_test/bit_scan.py +++ b/src/arch/x86/isa/insts/general_purpose/compare_and_test/bit_scan.py @@ -250,33 +250,39 @@ def macroop BSF_R_R { # Bit 6 srli t3, t1, 32, dataSize=8 - andi t3, t3, 32 - or reg, reg, t3 + andi t4, t3, 32, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 5 srli t3, t1, 16, dataSize=8 - andi t3, t3, 16 - or reg, reg, t3 + andi t4, t3, 16, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 4 srli t3, t1, 8, dataSize=8 - andi t3, t3, 8 - or reg, reg, t3 + andi t4, t3, 8, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 3 srli t3, t1, 4, dataSize=8 - andi t3, t3, 4 - or reg, reg, t3 + andi t4, t3, 4, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 2 srli t3, t1, 2, dataSize=8 - andi t3, t3, 2 - or reg, reg, t3 + andi t4, t3, 2, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 1 srli t3, t1, 1, dataSize=8 - andi t3, t3, 1 - or reg, reg, t3 + andi t4, t3, 1, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) end: fault "NoFault" @@ -299,33 +305,39 @@ def macroop BSF_R_M { # Bit 6 srli t3, t1, 32, dataSize=8 - andi t3, t3, 32 - or reg, reg, t3 + andi t4, t3, 32, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 5 srli t3, t1, 16, dataSize=8 - andi t3, t3, 16 - or reg, reg, t3 + andi t4, t3, 16, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 4 srli t3, t1, 8, dataSize=8 - andi t3, t3, 8 - or reg, reg, t3 + andi t4, t3, 8, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 3 srli t3, t1, 4, dataSize=8 - andi t3, t3, 4 - or reg, reg, t3 + andi t4, t3, 4, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 2 srli t3, t1, 2, dataSize=8 - andi t3, t3, 2 - or reg, reg, t3 + andi t4, t3, 2, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 1 srli t3, t1, 1, dataSize=8 - andi t3, t3, 1 - or reg, reg, t3 + andi t4, t3, 1, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) end: fault "NoFault" @@ -349,33 +361,39 @@ def macroop BSF_R_P { # Bit 6 srli t3, t1, 32, dataSize=8 - andi t3, t3, 32 - or reg, reg, t3 + andi t4, t3, 32, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 5 srli t3, t1, 16, dataSize=8 - andi t3, t3, 16 - or reg, reg, t3 + andi t4, t3, 16, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 4 srli t3, t1, 8, dataSize=8 - andi t3, t3, 8 - or reg, reg, t3 + andi t4, t3, 8, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 3 srli t3, t1, 4, dataSize=8 - andi t3, t3, 4 - or reg, reg, t3 + andi t4, t3, 4, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 2 srli t3, t1, 2, dataSize=8 - andi t3, t3, 2 - or reg, reg, t3 + andi t4, t3, 2, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) # Bit 1 srli t3, t1, 1, dataSize=8 - andi t3, t3, 1 - or reg, reg, t3 + andi t4, t3, 1, flags=(EZF,) + or reg, reg, t4 + mov t1, t1, t3, flags=(nCEZF,) end: fault "NoFault"