From 3e644b48bbbc3c0c3f3dd6bb158ea7b9c2024424 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 2 Oct 2007 22:57:33 -0700 Subject: X86: Fix x87 floating point stack register indexing. --HG-- extra : convert_revision : b515ec20cbfc50b38aa7da6cf4d465acf9054c08 --- src/arch/x86/insts/static_inst.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/arch/x86/insts') diff --git a/src/arch/x86/insts/static_inst.cc b/src/arch/x86/insts/static_inst.cc index 4f6ec5390..510295157 100644 --- a/src/arch/x86/insts/static_inst.cc +++ b/src/arch/x86/insts/static_inst.cc @@ -198,13 +198,18 @@ namespace X86ISA return; } fpindex -= NumMMXRegs; - if(fpindex < NumXMMRegs) { + if(fpindex < NumXMMRegs * 2) { ccprintf(os, "%%xmm%d_%s", fpindex / 2, (fpindex % 2) ? "high": "low"); return; } - fpindex -= NumXMMRegs; - ccprintf(os, "%%ufp%d", fpindex); + fpindex -= NumXMMRegs * 2; + if(fpindex < NumMicroFpRegs) { + ccprintf(os, "%%ufp%d", fpindex); + return; + } + fpindex -= NumMicroFpRegs; + ccprintf(os, "%%st(%d)", fpindex); } else { switch (reg - Ctrl_Base_DepTag) { default: -- cgit v1.2.3