------- Comment #1 from ubizjak at gmail dot com 2008-08-03 09:16 ------- Stack asm constraints have some annoying properties. Please note, that in your testcase, value in %st1 isn't popped from the stack. Also, reverse subtract can be used to avoid fxch. I propose to rewrite your function as:
static float fraction( float _x ) { int tmp; asm ( "fld %%st\n\t" "fisttp %1\n\t" "fild %1\n\t" "fsubrp %%st, %%st(1)" : "+t"( _x ), "=m"( tmp ) : : "st(1)" ); return( _x ); } -- ubizjak at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36923