summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/formats/string.isa
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/isa/formats/string.isa')
-rw-r--r--src/arch/x86/isa/formats/string.isa28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/arch/x86/isa/formats/string.isa b/src/arch/x86/isa/formats/string.isa
index cd182ff62..b1d3c4bbe 100644
--- a/src/arch/x86/isa/formats/string.isa
+++ b/src/arch/x86/isa/formats/string.isa
@@ -61,7 +61,7 @@
//
//////////////////////////////////////////////////////////////////////////
-def format StringInst(*opTypeSet) {{
+def format StringTestInst(*opTypeSet) {{
allBlocks = OutputBlocks()
regBlocks = specializeInst(Name, list(opTypeSet), EmulEnv())
@@ -86,3 +86,29 @@ def format StringInst(*opTypeSet) {{
(header_output, decoder_output,
decode_block, exec_output) = allBlocks.makeList()
}};
+
+def format StringInst(*opTypeSet) {{
+ allBlocks = OutputBlocks()
+
+ regBlocks = specializeInst(Name, list(opTypeSet), EmulEnv())
+ eBlocks = specializeInst(Name + "_E", list(opTypeSet), EmulEnv())
+
+ for blocks in (regBlocks, eBlocks):
+ allBlocks.header_output += blocks.header_output
+ allBlocks.decoder_output += blocks.decoder_output
+ allBlocks.exec_output += blocks.exec_output
+
+ allBlocks.decode_block = '''
+ if (LEGACY_REP) {
+ %s
+ } else if (LEGACY_REPNE) {
+ // The repne prefix is illegal
+ return new MicroFault(machInst, "illprefix", new InvalidOpcode);
+ } else {
+ %s
+ }
+ ''' % (eBlocks.decode_block, regBlocks.decode_block)
+
+ (header_output, decoder_output,
+ decode_block, exec_output) = allBlocks.makeList()
+}};