From 57b9f53afa5660152a77b7f3b7affb39f5b0e176 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 6 Oct 2015 17:26:50 -0700 Subject: x86: implement fild, fucomi, and fucomip x87 insts fild loads an integer value into the x87 top of stack register. fucomi/fucomip compare two x87 register values (the latter also doing a stack pop). These instructions are used by some versions of GNU libstdc++. --- src/arch/x86/isa/microops/fpop.isa | 2 ++ src/arch/x86/isa/microops/ldstop.isa | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'src/arch/x86/isa/microops') diff --git a/src/arch/x86/isa/microops/fpop.isa b/src/arch/x86/isa/microops/fpop.isa index 39162d392..6ba292977 100644 --- a/src/arch/x86/isa/microops/fpop.isa +++ b/src/arch/x86/isa/microops/fpop.isa @@ -1,5 +1,7 @@ // Copyright (c) 2007 The Hewlett-Packard Development Company // Copyright (c) 2012-2013 Mark D. Hill and David A. Wood +// Copyright (c) 2015 Advanced Micro Devices, Inc. +// // All rights reserved. // // The license below extends only to copyright in the software and shall diff --git a/src/arch/x86/isa/microops/ldstop.isa b/src/arch/x86/isa/microops/ldstop.isa index bccec36fe..a7c201f44 100644 --- a/src/arch/x86/isa/microops/ldstop.isa +++ b/src/arch/x86/isa/microops/ldstop.isa @@ -427,6 +427,25 @@ let {{ } ''', big = False) + # Load integer from memory into x87 top-of-stack register. + # Used to implement fild instruction. + defineMicroLoadOp('Ldifp87', code=''' + switch (dataSize) + { + case 2: + FpData_df = (int64_t)sext<16>(Mem); + break; + case 4: + FpData_df = (int64_t)sext<32>(Mem); + break; + case 8: + FpData_df = (int64_t)Mem; + break; + default: + panic("Unhandled data size in LdIFp87.\\n"); + } + ''', big = False) + def defineMicroStoreOp(mnemonic, code, completeCode="", mem_flags="0"): global header_output global decoder_output -- cgit v1.2.3