This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: "rep ret" even for Intel CPUs?
- From: Zuxy Meng <zuxy dot meng at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 22 Mar 2011 10:18:02 +0800
- Subject: Re: "rep ret" even for Intel CPUs?
- References: <im6u51$to0$1@dough.gmane.org> <mcripvcfc4i.fsf@google.com>
Hi,
2011/3/22 Ian Lance Taylor <iant@google.com>:
> "Zuxy Meng" <zuxy.meng@gmail.com> writes:
>
>> I found that gcc 4.5 generates "rep ret" even under -march=core2. Does
>> an Intel CPU benefit from this optimization too?
>
> As far as I know no Intel CPU benefits. ?Note that -march selects the
> architecture but not the tuning. ?The default tuning uses "rep; ret"
> when appropriate. ?If you want to avoid it, use a -mtune option.
'info gcc' tells me that '-march=CPU-TYPE' implies '-mtune=CPU-TYPE',
at least for x86...
--
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6