changeset a2f497ff53e4 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=a2f497ff53e4
description:
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:
src/arch/x86/isa/decoder/one_byte_opcodes.isa | 20 +++++++----------
src/arch/x86/isa/decoder/two_byte_opcodes.isa | 30 ++++++++++++--------------
2 files changed, 22 insertions(+), 28 deletions(-)
diffs (80 lines):
diff -r f44572edfba3 -r a2f497ff53e4
src/arch/x86/isa/decoder/one_byte_opcodes.isa
--- a/src/arch/x86/isa/decoder/one_byte_opcodes.isa Mon Sep 19 02:46:48
2011 -0700
+++ b/src/arch/x86/isa/decoder/one_byte_opcodes.isa Mon Sep 19 02:53:37
2011 -0700
@@ -394,19 +394,15 @@
default: Inst::RET_FAR();
}
0x4: int3();
-#if FULL_SYSTEM
- 0x5: int_Ib();
-#else
- // Really only the LSB matters, but the predecoder will sign
- // extend it, and there's no easy way to specify only checking
- // the first byte.
- 0x5: decode IMMEDIATE {
- -0x80:
- SyscallInst::int80('xc->syscall(Rax)',
- IsSyscall, IsNonSpeculative,
IsSerializeAfter);
- default: int_Ib();
+ 0x5: decode FULL_SYSTEM default int_Ib() {
+ 0: decode IMMEDIATE {
+ // Really only the LSB matters, but the predecoder
+ // will sign extend it, and there's no easy way to
+ // specify only checking the first byte.
+ -0x80: SyscallInst::int80('xc->syscall(Rax)',
+ IsSyscall, IsNonSpeculative, IsSerializeAfter);
+ }
}
-#endif
0x6: decode MODE_SUBMODE {
0x0: Inst::UD2();
default: into();
diff -r f44572edfba3 -r a2f497ff53e4
src/arch/x86/isa/decoder/two_byte_opcodes.isa
--- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa Mon Sep 19 02:46:48
2011 -0700
+++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa Mon Sep 19 02:53:37
2011 -0700
@@ -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();
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev