* question about directive ".set"
@ 2009-11-02 3:01 loody
2009-11-02 3:59 ` Jie Zhang
0 siblings, 1 reply; 3+ messages in thread
From: loody @ 2009-11-02 3:01 UTC (permalink / raw)
To: binutils
Dear all:
The manual as.pdf describe ".set" as ".set symbol , expression" but I
saw some real case in kernel like below:
__asm__ __volatile__ (
" .set noreorder \n"
" .align 3 \n"
"1: bnez %0, 1b \n"
" subu %0, 1 \n"
" .set reorder \n"
: "=r" (loops)
: "0" (loops));
What is ".set noreorder" and ".set reorder" mean?
if ".set" loses the expression part, does that mean the default value
is 0 or something else?
appreciate your help,
miloody
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question about directive ".set"
2009-11-02 3:01 question about directive ".set" loody
@ 2009-11-02 3:59 ` Jie Zhang
2009-11-03 23:54 ` Maciej W. Rozycki
0 siblings, 1 reply; 3+ messages in thread
From: Jie Zhang @ 2009-11-02 3:59 UTC (permalink / raw)
To: loody; +Cc: binutils
loody wrote:
> Dear all:
> The manual as.pdf describe ".set" as ".set symbol , expression" but I
This is the generic use of .set.
> saw some real case in kernel like below:
> __asm__ __volatile__ (
> " .set noreorder \n"
> " .align 3 \n"
> "1: bnez %0, 1b \n"
> " subu %0, 1 \n"
> " .set reorder \n"
> : "=r" (loops)
> : "0" (loops));
> What is ".set noreorder" and ".set reorder" mean?
This is the target specific use of .set. GAS of some targets can reorder
instructions for optimization, like alpha and mips. These two directives
are for control of whether or not do the instruction reordering.
Jie
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question about directive ".set"
2009-11-02 3:59 ` Jie Zhang
@ 2009-11-03 23:54 ` Maciej W. Rozycki
0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2009-11-03 23:54 UTC (permalink / raw)
To: Jie Zhang; +Cc: loody, binutils
On Mon, 2 Nov 2009, Jie Zhang wrote:
> > The manual as.pdf describe ".set" as ".set symbol , expression" but I
>
> This is the generic use of .set.
>
> > saw some real case in kernel like below:
> > __asm__ __volatile__ (
> > " .set noreorder \n"
> > " .align 3 \n"
> > "1: bnez %0, 1b \n"
> > " subu %0, 1 \n"
> > " .set reorder \n"
> > : "=r" (loops)
> > : "0" (loops));
> > What is ".set noreorder" and ".set reorder" mean?
>
> This is the target specific use of .set. GAS of some targets can reorder
> instructions for optimization, like alpha and mips. These two directives are
> for control of whether or not do the instruction reordering.
Some of these settings are documented in the "MIPS Dependent Features"
section of the manual. Regrettably, the list is not exhaustive -- anyone
is welcome to update the manual; the reference available within the source
code in gas/config/tc-mips.c should be good enough for a start.
Maciej
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-03 23:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-02 3:01 question about directive ".set" loody
2009-11-02 3:59 ` Jie Zhang
2009-11-03 23:54 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).