This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] implement fmod() as built-in x87 intrinsic
- From: Roger Sayle <roger at eyesopen dot com>
- To: Uros Bizjak <uros at kss-loka dot si>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 May 2004 17:16:16 -0600 (MDT)
- Subject: Re: [PATCH] implement fmod() as built-in x87 intrinsic
On Tue, 4 May 2004, Uros Bizjak wrote:
> I forgot to say, that if I change fnstsw instruction to this:
>
> (define_insn "x86_fnstsw_1"
> [(set (match_operand:HI 0 "register_operand" "=a")
> (unspec:HI [(reg:CC 18)] UNSPEC_FNSTSW))]
> "TARGET_80387"
> "fnstsw\t%0"
> [(set_attr "length" "2")
> (set_attr "mode" "SI")
> (set_attr "unit" "i387")])
>
> Everything works as expected, instructions doesn't change places and
> (reg 18) is not marked as REG_UNUSED anymore. This is the solution, but
> I don't know what part of compiler will break with this change.
I suspect that (reg 18) should be written as (reg:CCFP 18) in both the
x86_fnstsw_1 instruction and in the fpremxf_1 clobber. The majority of
uses of reg 18 specify CCFPmode, and every use of UNSPEC_FNSTSW, except
this one, has CCFPmode as the inner/operand mode and HImode as the
outer/result mode.
Roger
--