From: Fabien Chouteau <chouteau@adacore.com>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>
Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] SPARC: Add and use CPU_FEATURE_CASA
Date: Thu, 13 Feb 2014 15:55:19 +0100 [thread overview]
Message-ID: <52FCDCD7.3070903@adacore.com> (raw)
In-Reply-To: <52FCC1F3.9020205@embedded-brains.de>
On 02/13/2014 02:00 PM, Sebastian Huber wrote:
> On 2014-02-13 13:01, Fabien Chouteau wrote:
>> On 02/13/2014 10:52 AM, Sebastian Huber wrote:
>>> The LEON3 processor has support for the CASA instruction which is
>>> normally only available for SPARC V9 processors. Binutils 2.24
>>> and GCC 4.9 will support this instruction for LEON3. GCC uses it to
>>> generate C11 atomic operations.
>>>
>>> The CAS synthetic instruction uses an ASI of 0x80. If TARGET_SPARC64 is
>>> not defined use a supervisor data load/store for an ASI of 0x80 in
>>> helper_ld_asi()/helper_st_asi().
>>>
>>
>> Hello Sebastian,
>>
>> If I understand correctly, the difference with V1 is that ASI 0x80. Why
>> did you chose Supervisor data access against User data access?
>
> User data access would work also. I don't have a preference here.
>
>> (I cannot
>> find documentation about 0x80 ASI)
>
> GCC will generate CAS instructions, e.g.
...
> In the GNU Binutils you find:
>
> opcodes/sparc-opc.c:{ "cas", F3(3, 0x3c, 0)|ASI(0x80), F3(~3, ~0x3c, ~0)|ASI(~0x80), "[1],2,d", F_ALIAS, 0, v9andleon }, /* casa [rs1]ASI_P,rs2,rd */
>
> This is where the 0x80 comes from.
>
In some leon3 doc I found this:
62.2.7 Compare and Swap instruction (CASA)
LEON3 implements the SPARC V9 Compare and Swap Alternative (CASA) instruction. The CASA
is enabled the interger load delay is set to 1 and the NOTAG generic is 0. The CASA operates as
described in the SPARC V9 manual. The instruction is privileged but setting ASI = 0xA (user data)
will allow it to be used in user mode.
Which confirm privileged instruction. I will ask our GCC expert if they
know where that 0x80 ASI comes from.
next prev parent reply other threads:[~2014-02-13 14:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 9:52 [Qemu-devel] [PATCH v2] SPARC: Add and use CPU_FEATURE_CASA Sebastian Huber
2014-02-13 12:01 ` Fabien Chouteau
2014-02-13 13:00 ` Sebastian Huber
2014-02-13 14:55 ` Fabien Chouteau [this message]
2014-02-13 15:50 ` Fabien Chouteau
2014-02-14 8:41 ` Sebastian Huber
2014-02-14 13:44 ` Fabien Chouteau
2014-02-14 13:55 ` Andreas Färber
-- strict thread matches above, loose matches on Subject: below --
2013-11-26 14:04 [Qemu-devel] [PATCH] " Sebastian Huber
2013-11-28 10:27 ` [Qemu-devel] [PATCH v2] " Sebastian Huber
2013-12-10 8:09 ` Sebastian Huber
2013-12-10 17:16 ` Fabien Chouteau
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=52FCDCD7.3070903@adacore.com \
--to=chouteau@adacore.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=sebastian.huber@embedded-brains.de \
/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).