From: Pranith Kumar <bobby.prani@gmail.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: Richard Henderson <rth@twiddle.net>,
"open list:All patches CC here" <qemu-devel@nongnu.org>,
serge.fdrv@gmail.com
Subject: Re: [Qemu-devel] [RFC PATCH] tcg: Optimize fence instructions
Date: Tue, 19 Jul 2016 14:33:44 -0400 [thread overview]
Message-ID: <871t2pfpfb.fsf@gmail.com> (raw)
In-Reply-To: <87bn1tmxk4.fsf@linaro.org>
Alex Bennée writes:
> Pranith Kumar <bobby.prani@gmail.com> writes:
>
>> This patch applies on top of the fence generation patch series.
>>
>> This commit optimizes fence instructions. Two optimizations are
>> currently implemented. These are:
>>
>> 1. Unnecessary duplicate fence instructions
>>
>> If the same fence instruction is detected consecutively, we remove
>> one instance of it.
>>
>> ex: mb; mb => mb, strl; strl => strl
>>
>> 2. Merging weaker fence with subsequent/previous stronger fence
>>
>> load-acquire/store-release fence can be combined with a full fence
>> without relaxing the ordering constraint.
>>
>> ex: a) ld; ldaq; mb => ld; mb
>> b) mb; strl; st => mb; st
>
> What test cases do you have for this?
>
> Currently the litmus tests don't fire (as they have exactly what they
> need). Most programs don't seem to trigger multiple barriers.
>
Indeed, these cases are not so commonly seen in the wild. To test it I wrote
small test programs using C11 builtins to generate appropriate
instructions. Then verified it by running 'qemu-aarch64 -d in_asm,out_asm'.
_Atomic int val;
int main()
{
val = __atomic_load_n(&val, __ATOMIC_ACQUIRE);
__atomic_store_n(&val, val, __ATOMIC_RELEASE);
barrier();
barrier();
}
--
Pranith
next prev parent reply other threads:[~2016-07-19 18:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 20:29 [Qemu-devel] [RFC PATCH] tcg: Optimize fence instructions Pranith Kumar
2016-07-19 3:53 ` Richard Henderson
2016-07-19 18:28 ` Pranith Kumar
2016-07-19 14:36 ` Alex Bennée
2016-07-19 18:29 ` Pranith Kumar
2016-07-19 15:56 ` Alex Bennée
2016-07-19 18:33 ` Pranith Kumar [this message]
2016-07-19 17:16 ` Paolo Bonzini
2016-07-19 18:55 ` Pranith Kumar
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=871t2pfpfb.fsf@gmail.com \
--to=bobby.prani@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=serge.fdrv@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.