From: "Michael S. Zick" <mszick@morethan.org>
To: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] Does it lakes some cloberred r1 in __put_kernel_asm() 64bit?
Date: Tue, 18 Apr 2006 17:35:02 -0500 [thread overview]
Message-ID: <200604181735.02973.mszick@morethan.org> (raw)
In-Reply-To: <119aab440604181335r585ab489je1bef3c952a5a79b@mail.gmail.com>
On Tue April 18 2006 15:35, Carlos O'Donell wrote:
> On 4/16/06, Joel Soete <soete.joel@tiscali.be> wrote:
> > Hello all,
> >
> > I tried to apply my 'beautify' asm template to some uaccess.h and figure out that
> > this hunk din't mentioned that "r1" was cloberred (iirc in fixup text) while
> > the 32bit one did:
> >
> > mmm, doesn't seems to change anything (I just check sys_parisc32.s) but may be elsewhere?
>
> Please put on your thinking cap.
>
Please do not assume that was not step 1.
>
> a) What does a clobber mean from the viewpoint of an __asm?
>
Why not from the syntax used?
Two possibilities:
1) Compiler can not distinguish the effects of assemble statements
on register usage. It has to be told, as a general rule.
2) Compiler can distinguish the effects of assemble statements.
In this case, there is no reason for the clobber field.
Since there IS a clobber field in the syntax, then (2) must be
the intended assumption.
> b) Which insn clobber r1?
>
If (1) holds, it does not matter, the compiler already knows
when r1 will be trashed.
If (2) holds, the code author should know.
> Research both and return with the answer.
> Double marks if you solve...
>
> c) Should any of the __put_kernel_asm's have r1 listed as a clobber?
>
if (1) holds, it does not matter.
if (2) holds, then at least two more possibilities:
3) The compiler never carries a live value in r1 across an __asm block.
This is the same result as if r1 was listed as a clobber from the viewpoint
of preserving a value in r1 - there isn't one to preserve.
4) The compiler considers r1 a general purpose register.
In this case, the code author should not make an exception from the
general rule implied by the supplied syntax of __asm blocks.
Q.E.D:
Safe coding practice over the lifetime of changing compiler versions
answers the question - r1 should appear in the clobber list of any
block that changes its value.
Either:
a) It makes no difference for some combinations of the above;
Or:
b) It is required.
> Cheers,
Your welcome,
Mike
> Carlos.
> _______________________________________________
> parisc-linux mailing list
> parisc-linux@lists.parisc-linux.org
> http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
>
>
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
next prev parent reply other threads:[~2006-04-18 22:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-11 9:37 [parisc-linux] some whitespace rework and attempt to beautify inline asm stuff? Joel Soete
2006-04-16 20:14 ` [parisc-linux] Does it lakes some cloberred r1 in __put_kernel_asm() 64bit? Joel Soete
2006-04-18 20:35 ` Carlos O'Donell
2006-04-18 22:35 ` Michael S. Zick [this message]
2006-04-16 20:37 ` [parisc-linux] more whitespace rework and attempt to beautify inline asm stuff? Joel Soete
[not found] <IY13E1$80C55BA8C044E2D421CA2D8B24C31D6A@scarlet.be>
2006-04-20 17:09 ` [parisc-linux] Does it lakes some cloberred r1 in __put_kernel_asm() 64bit? Carlos O'Donell
-- strict thread matches above, loose matches on Subject: below --
2006-04-21 9:13 Joel Soete
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200604181735.02973.mszick@morethan.org \
--to=mszick@morethan.org \
--cc=parisc-linux@lists.parisc-linux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox