Messages in this thread | | | From | Keith Owens <> | Subject | Question on asm constraints | Date | Sun, 27 Jun 1999 15:48:01 +1000 |
| |
The gcc info page for Extended Asm says "Some instructions clobber specific hard registers. To describe this, write a third colon after the input operands, followed by the names of the clobbered hard registers (given as strings)" and "If you refer to a particular hardware register from the assembler code, you will probably have to list the register after the third colon to tell the compiler the register's value is modified".
Some kernel asm-i386 constructs do this, others do not, they are not very consistent. For example, both strtok and strstr explicitly hit %eax but only strtok declares it in the third constraint. strstr constrains its result to "a" but is that enough? strrchr has an "a" constraint and it explicitly lists "ax" as well. Why the differences?
Is "ax" optional as a third constraint when input or output is "a" or should we always specify a third constraint of "ax", just to be on the safe side?
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |