From: Julian Seward Date: Sat, 19 Mar 2005 14:25:49 +0000 (+0000) Subject: Test for the x87 'tst' instruction. In the wrong place unfortunately. X-Git-Tag: svn/VALGRIND_3_0_1^2~279 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02e4273032d1c0a82c883314565dbf82f174afae;p=thirdparty%2Fvalgrind.git Test for the x87 'tst' instruction. In the wrong place unfortunately. git-svn-id: svn://svn.valgrind.org/vex/trunk@1055 --- diff --git a/VEX/x87tst.c b/VEX/x87tst.c new file mode 100644 index 0000000000..d079477359 --- /dev/null +++ b/VEX/x87tst.c @@ -0,0 +1,27 @@ + +#include +#include + +double d; +int i; + +extern void do_tst ( void ); + +asm( +"\n" +"do_tst:\n" +"\txorl %eax,%eax\n" +"\tfld d\n" +"\tftst\n" +"\tfnstsw %ax\n" +"\tmovl %eax, i\n" +"\tret\n" +); + +int main ( void ) +{ + d = -1.23; do_tst(); printf("%f -> 0x%x\n", d, i ); + d = 0.0; do_tst(); printf("%f -> 0x%x\n", d, i ); + d = 9.87; do_tst(); printf("%f -> 0x%x\n", d, i ); + return 0; +}