summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/microops
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2015-10-06 17:26:50 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2015-10-06 17:26:50 -0700
commit57b9f53afa5660152a77b7f3b7affb39f5b0e176 (patch)
treea8fe858866fecdd2e1d2703a95f04b0b0b37e9ad /src/arch/x86/isa/microops
parent83e07c07f941ab496fa9cfef4807719a16b51066 (diff)
downloadgem5-57b9f53afa5660152a77b7f3b7affb39f5b0e176.tar.xz
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++.
Diffstat (limited to 'src/arch/x86/isa/microops')
-rw-r--r--src/arch/x86/isa/microops/fpop.isa2
-rw-r--r--src/arch/x86/isa/microops/ldstop.isa19
2 files changed, 21 insertions, 0 deletions
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