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] 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
--


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