#include
int main(char **argv, int argc)
{
int result;
__asm__("movl $0x10000000,%%eax; shl $3,%%eax; jno x; movl $1,%0; jmp end; x: movl $2,%0; end:"
:"=c"(result)::"%eax");
printf("The result is %d\n",result);
}
The SHL instruction is not setting the overflow flag on the Core Duo.
Update: Andy Hefner in #lisp says "overflow flag is undefined if the shift count is not equal to 1". So its not a bug after all.
1 comment:
To be accurate, I should amend that statement. The overflow flag is undefined if the shift count is >1. It is defined for 0 or 1.
Post a Comment