From 8cb320b856252c5dc5da29f3d7c27ec4bcf2c5c4 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Mon, 14 Feb 2005 20:21:10 +0000 Subject: [PATCH] re PR target/19019 (GCC ldouble format incompatibility with XLC long double) PR target/19019 * config/rs6000/rs6000.md (trunctfdf2): Change to define_expand. (trunctfdf2_internal1): New. (trunctfdf2_internal2): Renamed from trunctfdf2. From-SVN: r95042 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/rs6000.md | 28 +++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e20036f..0ec0e84 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-02-14 David Edelsohn + + PR target/19019 + * config/rs6000/rs6000.md (truntfdf2): Change to define_expand. + (trunctfdf2_internal1): New. + (trunctfdf2_internal2): XLC-compatible fadd version. + 2005-02-14 Diego Novillo PR tree-optimization/19853 diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 515bb05..3fdb165 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -8325,14 +8325,36 @@ DONE; }) -(define_insn "trunctfdf2" +(define_expand "trunctfdf2" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))] "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" +"") + +(define_insn_and_split "trunctfdf2_internal1" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f,?f") + (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "0,f")))] + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && !TARGET_XL_COMPAT + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" + "@ + # + fmr %0,%1" + "&& reload_completed && REGNO (operands[0]) == REGNO (operands[1])" + [(const_int 0)] +{ + emit_note (NOTE_INSN_DELETED); + DONE; +} + [(set_attr "type" "fp")]) + +(define_insn "trunctfdf2_internal2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f") + (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))] + "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && TARGET_XL_COMPAT + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "fadd %0,%1,%L1" - [(set_attr "type" "fp") - (set_attr "length" "4")]) + [(set_attr "type" "fp")]) (define_insn_and_split "trunctfsf2" [(set (match_operand:SF 0 "gpc_reg_operand" "=f") -- 2.7.4