This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, i386]: Insert "cld" via optimize mode switching


On 12/4/06, Michael Matz <matz@suse.de> wrote:

> I think it would have been good that the ABI mandated that the flag be
> cleared...

It does, on function entry and exit (i386 and x86-64 ABI).

The we in fact need cld insn only after asm statements. MODE_ENTRY can be set to CLD_FLAG_SET (actually CLD_FLAG_CLEARED...) and call insns wouldn't set MODE_UNINITIALIZED anymore. If we specify MODE_EXIT as CLD_FLAG_CLEARED, then optimize_mode_switching pass will automatically emmit cld after every asm statement, fulfilling ABI requirement about exit mode.

Is this thinking pushing cld optimization too far?

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]