From 7159ea669825a2a876dc3f0f2022336b517299a0 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 24 May 2017 03:09:56 -0700 Subject: x86: Rework how VEX prefixes are decoded. Remove redundant information from the ExtMachInst, hash the vex information to ensure the decode cache works properly, print the vex info when printing an ExtMachInst, consider the vex info when comparing two ExtMachInsts, fold the info from the vex prefixes into existing settings, remove redundant decode code, handle vex prefixes one byte at a time and don't bother building up the entire prefix, and let instructions that care about vex use it in their implementation, instead of developing an entire parallel decode tree. This also eliminates the error prone vex immediate decode table which was incomplete and would result in an out of bounds access for incorrectly encoded instructions or when the CPU was mispeculating, as it was (as far as I can tell) redundant with the tables that already existed for two and three byte opcodes. There were differences, but I think those may have been mistakes based on the documentation I found. Also, in 32 bit mode, the VEX prefixes might actually be LDS or LES instructions which are still legal in that mode. A valid VEX prefix would look like an LDS/LES with an otherwise invalid modrm encoding, so use that as a signal to abort processing the VEX and turn the instruction into an LES/LDS as appropriate. Change-Id: Icb367eaaa35590692df1c98862f315da4c139f5c Reviewed-on: https://gem5-review.googlesource.com/3501 Reviewed-by: Joe Gross Reviewed-by: Jason Lowe-Power Maintainer: Anthony Gutierrez --- src/arch/x86/isa/bitfields.isa | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/arch/x86/isa/bitfields.isa') diff --git a/src/arch/x86/isa/bitfields.isa b/src/arch/x86/isa/bitfields.isa index b5121f4e3..8f2dec6e7 100644 --- a/src/arch/x86/isa/bitfields.isa +++ b/src/arch/x86/isa/bitfields.isa @@ -88,11 +88,5 @@ def bitfield MODE mode; def bitfield MODE_MODE mode.mode; def bitfield MODE_SUBMODE mode.submode; -def bitfield VEX_R vex.first.r; -def bitfield VEX_X vex.first.x; -def bitfield VEX_B vex.first.b; -def bitfield VEX_MAP vex.first.map_select; -def bitfield VEX_W vex.second.w; -def bitfield VEX_VVVV vex.second.vvvv; -def bitfield VEX_L vex.second.l; -def bitfield VEX_PP vex.second.pp; +def bitfield VEX_V vex.v; +def bitfield VEX_L vex.l; -- cgit v1.2.3