From 7701c5b1ecc128b97121f0cb99743983c9492115 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 19 Sep 2011 02:53:37 -0700 Subject: 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. --- src/arch/x86/isa/decoder/one_byte_opcodes.isa | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/arch/x86/isa/decoder/one_byte_opcodes.isa') diff --git a/src/arch/x86/isa/decoder/one_byte_opcodes.isa b/src/arch/x86/isa/decoder/one_byte_opcodes.isa index 71d161231..4a5cf32d0 100644 --- a/src/arch/x86/isa/decoder/one_byte_opcodes.isa +++ b/src/arch/x86/isa/decoder/one_byte_opcodes.isa @@ -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(); -- cgit v1.2.3