From: behanw@converseincode.com (Behan Webster)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: teach __asmeq that r12 and ip are the same register
Date: Wed, 28 Jan 2015 14:47:36 -0800 [thread overview]
Message-ID: <54C96708.6080300@converseincode.com> (raw)
In-Reply-To: <CAKv+Gu_zXwLdREs1NogW4GaoYiXQz-d4HqJ6KsEPV0q-gPrVTQ@mail.gmail.com>
On 01/28/15 14:00, Ard Biesheuvel wrote:
> On 28 January 2015 at 21:46, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
>> On Wed, 28 Jan 2015, Ard Biesheuvel wrote:
>>
>>> The __asmeq macro is used inside inline asm statements to ensure that
>>> register asm variables that explicitly specify a register are mapped
>>> correctly onto those registers when used in inline asm input and output
>>> constraints. However, the string based matching fails to take into account
>>> that 'ip' may also be referred to as 'r12', (e.g., by clang), causing false
>>> negatives.
>>>
>>> Fix this by making __asmeq consider the ("ip","r12") and ("r12","ip")
>>> cases specifically.
>>>
>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> gcc is likely to do the same substitution with r10 ("sl") and r11
>> ("fp"). Might as well add them right away for completeness.
>>
> I just checked with my 4.8 gcc toolchain: r11 indeed gets emitted as
> fp when used in inline asm, but r10 is just r10.
> So I should update the patch to include fp as well.
>
>> Then, does clang call sp, lr, pc as r13, r14 and r15? I guess not as
>> this is probably against the latest ARM assembly conventions.
>>
> @Behan, could you answer this one?
These are aliased in clang as one would expect.
Behan
--
Behan Webster
behanw at converseincode.com
prev parent reply other threads:[~2015-01-28 22:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 21:30 [PATCH] ARM: teach __asmeq that r12 and ip are the same register Ard Biesheuvel
2015-01-28 21:46 ` Nicolas Pitre
2015-01-28 22:00 ` Ard Biesheuvel
2015-01-28 22:47 ` Behan Webster [this message]
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=54C96708.6080300@converseincode.com \
--to=behanw@converseincode.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).