lkml.org 
[lkml]   [1999]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectQuestion on asm constraints
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.196 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site