Fix rs6000 fix_trunc TFmode.

Richard Henderson rth@redhat.com
Thu Jan 8 23:23:00 GMT 2004


On Thu, Jan 08, 2004 at 02:50:32PM -0800, Geoffrey Keating wrote:
> + (define_insn "fix_trunc_helper"
> +   [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
> + 	(unspec:DF [(match_operand:TF 1 "gpc_reg_operand" "f")]
> + 		   UNSPEC_FIX_TRUNC_TF))
> +    (clobber (match_operand:DF 2 "gpc_reg_operand" "=&f"))]
> +   "TARGET_HARD_FLOAT && TARGET_FPRS"
> +   "mffs %2\n\tmtfsb1 31\n\tmtfsb0 30\n\tfadd %0,%1,%L1\n\tmtfsf 1,%2"
> +   [(set_attr "type" "fp")
> +    (set_attr "length" "20")])
> + 
>   (define_insn_and_split "fix_trunctfdi2"
>     [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
>           (fix:DI (match_operand:TF 1 "gpc_reg_operand" "f")))
> !    (clobber (match_scratch:DF 2 "=f"))
> !    (clobber (match_scratch:DF 3 "=&f"))]
>     "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
>      && TARGET_POWERPC64
>      && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
>     "#"
>     "&& reload_completed"
> !   [(pc)]
> ! {
> !   emit_insn (gen_fix_trunc_helper (operands[2], operands[1], operands[3]));
> !   emit_insn (gen_fix_truncdfdi2 (operands[0], operands[2]));
> ! })

Um, how can you possibly go through DFmode going from TFmode to DImode?
Seems to me you'd miss values like (2**60 - 1) entirely.

You're also missing a DONE from the end of that splitter.


r~



More information about the Gcc-patches mailing list