This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Why is x86_sahf_1 pattern disabled in x86_64?
- From: Uros Bizjak <uros at kss-loka dot si>
- To: gcc at gcc dot gnu dot org
- Cc: Jan Hubicka <jh at suse dot cz>
- Date: Fri, 07 May 2004 13:11:54 +0200
- Subject: Why is x86_sahf_1 pattern disabled in x86_64?
Hello Jan!
According too ChangeLog, x86_sahf_1 pattern is disabled in x86_64 mode:
Mon Mar 12 15:41:08 CET 2001 Jan Hubicka <jh@suse.cz>
* i386.md (all XFmode patterns except swapxf): Disable for 64bit.
* i386.md (x86_sahf_1): Disable for 64bit.
(popsi*, pophi*): Likewise.
...
However, AMD64 software optimization guide shows sahf instruction as
DirectPath, latency 1 instruction. This instruction is needed in
modf()/drem() patterns to perform conditional jump on P flag set
[ix86_emit_fp_unordered_jump()) function in config/i386/i386.c].
What is the preferred way to perform this conditional jump in x86_64?
Instead of sahf; jp label; we could also emit test ah; jnz label;
instructions.
Thanks,
Uros.