summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/decoder/decoder.isa
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2014-12-04 15:53:54 -0800
committerGabe Black <gabeblack@google.com>2014-12-04 15:53:54 -0800
commit22aaa5867f2449e2a73b7891fc34072c12c199b3 (patch)
tree6083ecfd34307076c8d9c55a450e6cc118025b95 /src/arch/x86/isa/decoder/decoder.isa
parent3069c28a021d3f8c29221e537d48ee382c30646f (diff)
downloadgem5-22aaa5867f2449e2a73b7891fc34072c12c199b3.tar.xz
x86: Rework opcode parsing to support 3 byte opcodes properly.
Instead of counting the number of opcode bytes in an instruction and recording each byte before the actual opcode, we can represent the path we took to get to the actual opcode byte by using a type code. That has a couple of advantages. First, we can disambiguate the properties of opcodes of the same length which have different properties. Second, it reduces the amount of data stored in an ExtMachInst, making them slightly easier/faster to create and process. This also adds some flexibility as far as how different types of opcodes are handled, which might come in handy if we decide to support VEX or XOP instructions. This change also adds tables to support properly decoding 3 byte opcodes. Before we would fall off the end of some arrays, on top of the ambiguity described above. This change doesn't measureably affect performance on the twolf benchmark. --HG-- rename : src/arch/x86/isa/decoder/three_byte_opcodes.isa => src/arch/x86/isa/decoder/three_byte_0f38_opcodes.isa rename : src/arch/x86/isa/decoder/three_byte_opcodes.isa => src/arch/x86/isa/decoder/three_byte_0f3a_opcodes.isa
Diffstat (limited to 'src/arch/x86/isa/decoder/decoder.isa')
-rw-r--r--src/arch/x86/isa/decoder/decoder.isa10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/arch/x86/isa/decoder/decoder.isa b/src/arch/x86/isa/decoder/decoder.isa
index 9b2ce0ba0..eaa579817 100644
--- a/src/arch/x86/isa/decoder/decoder.isa
+++ b/src/arch/x86/isa/decoder/decoder.isa
@@ -43,16 +43,12 @@
decode LEGACY_LOCK default Unknown::unknown()
{
//No lock prefix
- 0x0: decode OPCODE_NUM default Unknown::unknown()
+ 0x0: decode OPCODE_TYPE default Unknown::unknown()
{
- 0x0: M5InternalError::error(
- {{"Saw an ExtMachInst with zero opcode bytes!"}});
- //1 byte opcodes
##include "one_byte_opcodes.isa"
- //2 byte opcodes
##include "two_byte_opcodes.isa"
- //3 byte opcodes
- ##include "three_byte_opcodes.isa"
+ ##include "three_byte_0f38_opcodes.isa"
+ ##include "three_byte_0f3a_opcodes.isa"
}
//Lock prefix
##include "locked_opcodes.isa"