This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: x86 code generation question
Jack Lloyd <lloyd@randombit.net> writes:
> On Thu, Apr 29, 2004 at 05:03:19PM -0400, Paul Koning wrote:
>
>> Given a machine with conditional move instructions, either version
>> should translate into straight line code with conditional moves, but
>> (apparently -- I'm no x86 expert) the x86 isn't one of those. Arm and
>> Alpha are, though.
>
> IIRC x86 has cmov in ppro and up, so it's possible the OP just needs
> to use -march=i586 (or up) to get the desired behavior. It seems
> unlikely that GCC would not know about i586 instructions, though the
> optimizer might not be able to use cmov well due to register
> pressure.
CMOV is a Pentium Pro feature, so you have to use -march=pentiumpro
(maybe -march=i686 works as well, I haven't checked). If you activate
this option, GCC can and does generate CMOV instructions.
--
Current mail filters: many dial-up/DSL/cable modem hosts, and the
following domains: atlas.cz, bigpond.com, di-ve.com, hotmail.com,
netscape.net, postino.it, tiscali.co.uk, tiscali.cz, tiscali.it, voila.fr.