summaryrefslogtreecommitdiff
path: root/tests/x86call.asm
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2003-06-28 01:24:35 +0200
committerKevin Ryde <user42@zip.com.au>2003-06-28 01:24:35 +0200
commite45f8c9a14414197538c635d40827caf8d59aa52 (patch)
tree30370bba3072e2e0557e3b816d94db184499c1e0 /tests/x86call.asm
parent0b1c185e752a76f3656118cee4912cfbdc4b0bc5 (diff)
downloadgmp-e45f8c9a14414197538c635d40827caf8d59aa52.tar.gz
* tests/x86call.asm, test/tests.h (x86_fldcw, x86_fstcw): New
functions.
Diffstat (limited to 'tests/x86call.asm')
-rw-r--r--tests/x86call.asm34
1 files changed, 33 insertions, 1 deletions
diff --git a/tests/x86call.asm b/tests/x86call.asm
index 8baaa69be..3ee044f55 100644
--- a/tests/x86call.asm
+++ b/tests/x86call.asm
@@ -1,6 +1,6 @@
dnl x86 calling conventions checking.
-dnl Copyright 2000 Free Software Foundation, Inc.
+dnl Copyright 2000, 2003 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
@@ -23,6 +23,38 @@ dnl Suite 330, Boston, MA 02111-1307, USA.
include(`../config.m4')
+C void x86_fldcw (unsigned short cw);
+C
+C Execute an fldcw, setting the x87 control word to cw.
+
+PROLOGUE(x86_fldcw)
+ fldcw 4(%esp)
+ ret
+EPILOGUE()
+
+
+C unsigned short x86_fstcw (void);
+C
+C Execute an fstcw, returning the current x87 control word.
+
+PROLOGUE(x86_fstcw)
+ xorl %eax, %eax
+ pushl %eax
+ fstcw (%esp)
+ popl %eax
+ ret
+EPILOGUE()
+
+
+dnl Instrumented profiling doesn't come out quite right below, since we
+dnl don't do an actual "ret". There's only a few instructions here, so
+dnl there's no great need to get them separately accounted, just let them
+dnl get attributed to the caller.
+
+ifelse(WANT_PROFILING,instrument,
+`define(`WANT_PROFILING',no)')
+
+
C int calling_conventions (...);
C
C The global variable "calling_conventions_function" is the function to