From patchwork Wed Jul 25 14:06:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 173172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 413162C0098 for ; Thu, 26 Jul 2012 00:06:37 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343829998; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=VSGUFh6 tg1wqZyOgH4zaXKklm9E=; b=AUreZR7s2JCqWwtL+9JPPvLzWM+aRitklv6HFmu WSDC4b5f7xqGlwNxbnaD/XOqWxHDAyA3AEqd9ZlQ8HG44CgP7pTfxTUHTfUcdnK7 yDHtvsCerP86HUfn80kcqUSWsvelqr49gRhyZkTIX+p9oUSyyCXu9g92iY4i1yk6 enKY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=fp3xJnBAWfnIAjXA4SBtihGxAo8Io/24fQ4bGB+UwnTQpLAf3UTwPTTK2m5KPi dqVWPpjMA1tA1e83u7aT1xuEpZU0SA5+3fPnyyFBwpEsxIzr8e5e5Z9ukk5Powz1 fH6toQsh8cgnCt3h9P3Pao9S17GyvzWXK5kW0DJpHEHgA=; Received: (qmail 9189 invoked by alias); 25 Jul 2012 14:06:32 -0000 Received: (qmail 9167 invoked by uid 22791); 25 Jul 2012 14:06:29 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Jul 2012 14:06:16 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6PE6GJF007759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Jul 2012 10:06:16 -0400 Received: from anchor.twiddle.home (vpn-235-148.phx2.redhat.com [10.3.235.148]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6PE6Fex008762 for ; Wed, 25 Jul 2012 10:06:15 -0400 Message-ID: <500FFD57.3060806@redhat.com> Date: Wed, 25 Jul 2012 07:06:15 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: GCC Patches Subject: [PATCH] Remove FIXUNS_TRUNC_LIKE_FIX_TRUNC X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The optabs rewrite removed the special handling for FIXUNS_TRUNC_LIKE_FIX_TRUNC. This was a minor short-hand only used by two targets, and can be replaced by a grand total of two patterns in each. Cross-compiled to vax-linux and v850-elf and committed. r~ * system.h (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Poison. * config/cris/cris.h (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Remove. * config/h8300/h8300.h (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Remove. * config/mn10300/mn10300.h (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Remove. * config/rs6000/rs6000.h (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Remove comment reference. * config/v850/v850.h (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Remove. * config/v850/v850.md (fixuns_truncsfsi2, fixuns_truncdfsi2): New. (fix_truncsfsi2, fix_truncdfsi2): Avoid double FIX. * config/vax/vax.h (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Remove. * config/vax/vax.md (fixuns_trunc): New. * doc/tm.texi.in (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Remove. * doc/tm.texi: Rebuild. diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index 0ed4ced..646ba90 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -1055,8 +1055,6 @@ enum cris_pic_symbol_type /* FIXME: Investigate CASE_VECTOR_SHORTEN_MODE to make sure HImode is not used when broken-.word could possibly fail (plus testcase). */ -#define FIXUNS_TRUNC_LIKE_FIX_TRUNC - /* This is the number of bytes that can be moved in one reasonably fast instruction sequence. For CRIS, this is two instructions: mem => reg, reg => mem. */ diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 82e55f6..61e0dd2 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -566,10 +566,6 @@ struct cum_arg are unsigned. */ #define DEFAULT_SIGNED_CHAR 0 -/* This flag, if defined, says the same insns that convert to a signed fixnum - also convert validly to an unsigned one. */ -#define FIXUNS_TRUNC_LIKE_FIX_TRUNC - /* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */ #define MOVE_MAX (TARGET_H8300H || TARGET_H8300S ? 4 : 2) diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 79b20f5..eb4f2f9 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -703,10 +703,6 @@ do { \ #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND -/* This flag, if defined, says the same insns that convert to a signed fixnum - also convert validly to an unsigned one. */ -#define FIXUNS_TRUNC_LIKE_FIX_TRUNC - /* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */ #define MOVE_MAX 4 diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 97d551c..2c8a7dd 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1821,11 +1821,6 @@ do { \ /* Define this as 1 if `char' should by default be signed; else as 0. */ #define DEFAULT_SIGNED_CHAR 0 -/* This flag, if defined, says the same insns that convert to a signed fixnum - also convert validly to an unsigned one. */ - -/* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */ - /* An integer expression for the size in bits of the largest integer machine mode that should actually be used. */ diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index f5b64de..10ddd7b 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -812,10 +812,6 @@ typedef enum /* Byte and short loads sign extend the value to a word. */ #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND -/* This flag, if defined, says the same insns that convert to a signed fixnum - also convert validly to an unsigned one. */ -#define FIXUNS_TRUNC_LIKE_FIX_TRUNC - /* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */ #define MOVE_MAX 4 diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md index 4ac5653..f479ff6 100644 --- a/gcc/config/v850/v850.md +++ b/gcc/config/v850/v850.md @@ -1938,7 +1938,7 @@ ;; float -> int (define_insn "fix_truncsfsi2" [(set (match_operand:SI 0 "register_operand" "=r") - (fix:SI (fix:SF (match_operand:SF 1 "register_operand" "r"))))] + (fix:SI (match_operand:SF 1 "register_operand" "r")))] "TARGET_V850E2V3" "trncf.sw %1,%0" [(set_attr "length" "4") @@ -1947,13 +1947,23 @@ (define_insn "fix_truncdfsi2" [(set (match_operand:SI 0 "register_operand" "=r") - (fix:SI (fix:DF (match_operand:DF 1 "even_reg_operand" "r"))))] + (fix:SI (match_operand:DF 1 "even_reg_operand" "r")))] "TARGET_V850E2V3" "trncf.dw %1,%0" [(set_attr "length" "4") (set_attr "cc" "none_0hit") (set_attr "type" "fpu")]) +(define_expand "fixuns_truncsfsi2" + [(set (match_operand:SI 0 "register_operand" "=r") + (fix:SI (match_operand:SF 1 "register_operand" "r")))] + "TARGET_V850E2V3") + +(define_expand "fixuns_truncdfsi2" + [(set (match_operand:SI 0 "register_operand" "=r") + (fix:SI (match_operand:DF 1 "even_reg_operand" "r")))] + "TARGET_V850E2V3") + ;; int -> float (define_insn "floatsisf2" [(set (match_operand:SF 0 "register_operand" "=r") diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h index 37e3d10..9d23fd0 100644 --- a/gcc/config/vax/vax.h +++ b/gcc/config/vax/vax.h @@ -455,10 +455,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* Define this as 1 if `char' should by default be signed; else as 0. */ #define DEFAULT_SIGNED_CHAR 1 -/* This flag, if defined, says the same insns that convert to a signed fixnum - also convert validly to an unsigned one. */ -#define FIXUNS_TRUNC_LIKE_FIX_TRUNC - /* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */ #define MOVE_MAX 8 diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md index 32f50fd..afc3129 100644 --- a/gcc/config/vax/vax.md +++ b/gcc/config/vax/vax.md @@ -318,9 +318,14 @@ (define_insn "fix_trunc2" [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") - (fix:VAXint (fix:VAXfp (match_operand:VAXfp 1 "general_operand" "gF"))))] + (fix:VAXint (match_operand:VAXfp 1 "general_operand" "gF")))] "" "cvt %1,%0") + +(define_expand "fixuns_trunc2" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "") + (fix:VAXint (match_operand:VAXfp 1 "general_operand")))] + "") ;;- All kinds of add instructions. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 9f6b5dd..ff743c8 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -10339,12 +10339,6 @@ Define this macro if loading short immediate values into registers sign extends. @end defmac -@defmac FIXUNS_TRUNC_LIKE_FIX_TRUNC -Define this macro if the same instructions that convert a floating -point number to a signed fixed point number also convert validly to an -unsigned one. -@end defmac - @deftypefn {Target Hook} {unsigned int} TARGET_MIN_DIVISIONS_FOR_RECIP_MUL (enum machine_mode @var{mode}) When @option{-ffast-math} is in effect, GCC tries to optimize divisions by the same divisor, by turning them into multiplications by diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index df597c2..85d9d1d 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -10205,12 +10205,6 @@ Define this macro if loading short immediate values into registers sign extends. @end defmac -@defmac FIXUNS_TRUNC_LIKE_FIX_TRUNC -Define this macro if the same instructions that convert a floating -point number to a signed fixed point number also convert validly to an -unsigned one. -@end defmac - @hook TARGET_MIN_DIVISIONS_FOR_RECIP_MUL When @option{-ffast-math} is in effect, GCC tries to optimize divisions by the same divisor, by turning them into multiplications by diff --git a/gcc/system.h b/gcc/system.h index 572271c..e3a7288 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -888,7 +888,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; IDENT_ASM_OP UNALIGNED_SHORT_ASM_OP UNALIGNED_INT_ASM_OP \ UNALIGNED_LONG_ASM_OP UNALIGNED_DOUBLE_INT_ASM_OP \ USE_COMMON_FOR_ONE_ONLY IFCVT_EXTRA_FIELDS IFCVT_INIT_EXTRA_FIELDS \ - CASE_USE_BIT_TESTS + CASE_USE_BIT_TESTS FIXUNS_TRUNC_LIKE_FIX_TRUNC /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \