summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-10-18 22:38:17 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-10-18 22:38:17 -0700
commit2bbc058c6c5e54c032106f804dd3084ed11f0f09 (patch)
tree84d17c04577ef75098eafbe2f78631235dfafb36 /src/arch/x86/isa/insts
parent418b30602bd08646d6f260d495163ad4fb613402 (diff)
downloadgem5-2bbc058c6c5e54c032106f804dd3084ed11f0f09.tar.xz
X86: Implement the LOOP instructions.
--HG-- extra : convert_revision : 3ccd0565c83b6d9c9b63f9f7ac2b67839a2c714f
Diffstat (limited to 'src/arch/x86/isa/insts')
-rw-r--r--src/arch/x86/isa/insts/general_purpose/control_transfer/loop.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/arch/x86/isa/insts/general_purpose/control_transfer/loop.py b/src/arch/x86/isa/insts/general_purpose/control_transfer/loop.py
index d742f217f..c5674db7f 100644
--- a/src/arch/x86/isa/insts/general_purpose/control_transfer/loop.py
+++ b/src/arch/x86/isa/insts/general_purpose/control_transfer/loop.py
@@ -53,8 +53,22 @@
#
# Authors: Gabe Black
-microcode = ""
-#let {{
-# class LOOPcc(Inst):
-# "GenFault ${new UnimpInstFault}"
-#}};
+microcode = '''
+def macroop LOOP_I {
+ rdip t1
+ subi rcx, rcx, 1, flags=(EZF,), dataSize=asz
+ wripi t1, imm, flags=(nCEZF,)
+};
+
+def macroop LOOPNE_I {
+ rdip t1
+ subi rcx, rcx, 1, flags=(EZF,), dataSize=asz
+ wripi t1, imm, flags=(CSTRnZnEZF,)
+};
+
+def macroop LOOPE_I {
+ rdip t1
+ subi rcx, rcx, 1, flags=(EZF,), dataSize=asz
+ wripi t1, imm, flags=(CSTRZnEZF,)
+};
+'''