summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/decoder/two_byte_opcodes.isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-09-19 02:53:37 -0700
committerGabe Black <gblack@eecs.umich.edu>2011-09-19 02:53:37 -0700
commit7701c5b1ecc128b97121f0cb99743983c9492115 (patch)
treee0e6c5a3bc6c0ed609f8769699146cd9b25cfc2e /src/arch/x86/isa/decoder/two_byte_opcodes.isa
parent10c2e37f604280fb89d800839cc965204d096c59 (diff)
downloadgem5-7701c5b1ecc128b97121f0cb99743983c9492115.tar.xz
X86: Don't use "#if FULL_SYSTEM" in the X86 ISA description.
The decoder now checks the value of FULL_SYSTEM in a switch statement to decide whether to return a real syscall instruction or one that triggers syscall emulation (or a panic in FS mode). The switch statement should devolve into an if, and also should be optimized out since it's based on constant input.
Diffstat (limited to 'src/arch/x86/isa/decoder/two_byte_opcodes.isa')
-rw-r--r--src/arch/x86/isa/decoder/two_byte_opcodes.isa30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
index e4df4ac66..2471b61ce 100644
--- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa
+++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
@@ -216,18 +216,17 @@
default: Inst::UD2();
}
}
-#if FULL_SYSTEM
- 0x05: decode MODE_MODE {
- 0x0: decode MODE_SUBMODE {
- 0x0: Inst::SYSCALL_64();
- 0x1: Inst::SYSCALL_COMPAT();
+ 0x05: decode FULL_SYSTEM {
+ 0: SyscallInst::syscall('xc->syscall(Rax)',
+ IsSyscall, IsNonSpeculative, IsSerializeAfter);
+ default: decode MODE_MODE {
+ 0x0: decode MODE_SUBMODE {
+ 0x0: Inst::SYSCALL_64();
+ 0x1: Inst::SYSCALL_COMPAT();
+ }
+ 0x1: Inst::SYSCALL_LEGACY();
}
- 0x1: Inst::SYSCALL_LEGACY();
}
-#else
- 0x05: SyscallInst::syscall('xc->syscall(Rax)',
- IsSyscall, IsNonSpeculative, IsSerializeAfter);
-#endif
0x06: Inst::CLTS();
0x07: decode MODE_SUBMODE {
0x0: decode OPSIZE {
@@ -399,12 +398,11 @@
0x1: Inst::RDTSC();
0x2: Inst::RDMSR();
0x3: rdpmc();
-#if FULL_SYSTEM
- 0x4: sysenter();
-#else
- 0x4: SyscallInst::sysenter('xc->syscall(Rax)',
- IsSyscall, IsNonSpeculative, IsSerializeAfter);
-#endif
+ 0x4: decode FULL_SYSTEM {
+ 0: SyscallInst::sysenter('xc->syscall(Rax)',
+ IsSyscall, IsNonSpeculative, IsSerializeAfter);
+ default: sysenter();
+ }
0x5: sysexit();
0x6: Inst::UD2();
0x7: getsec();