git-svn-id: svn://svn.valgrind.org/vex/trunk@628
--- /dev/null
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void do_fstenv ( void* p )
+{
+ asm("movl 8(%esp), %eax ; fstenv (%eax)");
+}
+
+void do_fldenv ( void* p )
+{
+ asm("movl 8(%esp), %eax ; fldenv (%eax)");
+}
+
+int main ( void )
+{
+ int i;
+ unsigned short* buf = malloc(14*sizeof(short));
+ for (i = 0; i < 14; i++)
+ buf[i] = i;
+ buf[0] = 0x037f;
+
+ do_fldenv(buf);
+ do_fstenv(buf);
+ for (i = 0; i < 14; i++) {
+ printf("%04x ", buf[i]);
+ if (i > 0 && ((i % 12) == 11))
+ printf("\n");
+ }
+ printf("\n");
+ return 0;
+}
int main ( void )
{
int i;
- unsigned short* buf = malloc(54*sizeof(int));
+ unsigned short* buf = malloc(54*sizeof(short));
for (i = 0; i < 54; i++)
buf[i] = i;
buf[0] = 0x037f;
--- /dev/null
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void do_fstenv ( void* p )
+{
+ asm("fldpi ; fld1; fldln2 ; movl 8(%esp), %eax ; fstenv (%eax)");
+}
+
+int main ( void )
+{
+ int i;
+ unsigned int* buf = malloc(7*sizeof(int));
+ do_fstenv(buf);
+ for (i = 0; i < 7; i++) {
+ printf("%08x ", buf[i]);
+ if (i > 0 && ((i % 6) == 5))
+ printf("\n");
+ }
+ printf("\n");
+ return 0;
+}