From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33627 invoked by alias); 9 Dec 2016 12:59:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 33606 invoked by uid 89); 9 Dec 2016 12:59:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=HIGH, xxx X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Dec 2016 12:59:26 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C909F707; Fri, 9 Dec 2016 04:59:24 -0800 (PST) Received: from localhost (e105548-lin.manchester.arm.com [10.45.32.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 746163F477 for ; Fri, 9 Dec 2016 04:59:24 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [10/67] Make assemble_real take a scalar_float_mode References: <87h96dp8u6.fsf@e105548-lin.cambridge.arm.com> Date: Fri, 09 Dec 2016 12:59:00 -0000 In-Reply-To: <87h96dp8u6.fsf@e105548-lin.cambridge.arm.com> (Richard Sandiford's message of "Fri, 09 Dec 2016 12:48:01 +0000") Message-ID: <87a8c5ntqt.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2016-12/txt/msg00779.txt.bz2 As per subject. gcc/ 2016-11-24 Richard Sandiford Alan Hayward David Sherwood * output.h (assemble_real): Take a scalar_float_mode. * config/arm/arm.c (arm_assemble_integer): Update accordingly. * config/arm/arm.md (consttable_4): Likewise. (consttable_8): Likewise. (consttable_16): Likewise. * config/mips/mips.md (consttable_float): Likewise. * config/s390/s390.c (s390_output_pool_entry): Likewise. * varasm.c (assemble_real): Take a scalar_float_mode. (output_constant_pool_2): Update accordingly. (output_constant): Likewise. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index aeec412..6922c4e 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -22397,8 +22397,9 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) for (i = 0; i < units; i++) { rtx elt = CONST_VECTOR_ELT (x, i); - assemble_real - (*CONST_DOUBLE_REAL_VALUE (elt), GET_MODE_INNER (mode), + assemble_real + (*CONST_DOUBLE_REAL_VALUE (elt), + as_a (GET_MODE_INNER (mode)), i == 0 ? BIGGEST_ALIGNMENT : size * BITS_PER_UNIT); } diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index d561a4b..4a911a0 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -11226,13 +11226,11 @@ { rtx x = operands[0]; making_const_table = TRUE; - switch (GET_MODE_CLASS (GET_MODE (x))) + scalar_float_mode float_mode; + if (is_a (GET_MODE (x), &float_mode)) + assemble_real (*CONST_DOUBLE_REAL_VALUE (x), float_mode, BITS_PER_WORD); + else { - case MODE_FLOAT: - assemble_real (*CONST_DOUBLE_REAL_VALUE (x), GET_MODE (x), - BITS_PER_WORD); - break; - default: /* XXX: Sometimes gcc does something really dumb and ends up with a HIGH in a constant pool entry, usually because it's trying to load into a VFP register. We know this will always be used in @@ -11242,7 +11240,6 @@ x = XEXP (x, 0); assemble_integer (x, 4, BITS_PER_WORD, 1); mark_symbol_refs_as_used (x); - break; } return \"\"; }" @@ -11256,16 +11253,12 @@ "* { making_const_table = TRUE; - switch (GET_MODE_CLASS (GET_MODE (operands[0]))) - { - case MODE_FLOAT: - assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]), - GET_MODE (operands[0]), BITS_PER_WORD); - break; - default: - assemble_integer (operands[0], 8, BITS_PER_WORD, 1); - break; - } + scalar_float_mode float_mode; + if (is_a (GET_MODE (operands[0]), &float_mode)) + assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]), + float_mode, BITS_PER_WORD); + else + assemble_integer (operands[0], 8, BITS_PER_WORD, 1); return \"\"; }" [(set_attr "length" "8") @@ -11278,16 +11271,12 @@ "* { making_const_table = TRUE; - switch (GET_MODE_CLASS (GET_MODE (operands[0]))) - { - case MODE_FLOAT: - assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]), - GET_MODE (operands[0]), BITS_PER_WORD); - break; - default: - assemble_integer (operands[0], 16, BITS_PER_WORD, 1); - break; - } + scalar_float_mode float_mode; + if (is_a (GET_MODE (operands[0]), &float_mode)) + assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]), + float_mode, BITS_PER_WORD); + else + assemble_integer (operands[0], 16, BITS_PER_WORD, 1); return \"\"; }" [(set_attr "length" "16") diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index b2e5f97..73ca2fe 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -7371,7 +7371,7 @@ { gcc_assert (GET_CODE (operands[0]) == CONST_DOUBLE); assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]), - GET_MODE (operands[0]), + as_a (GET_MODE (operands[0])), GET_MODE_BITSIZE (GET_MODE (operands[0]))); return ""; } diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index a48663d..a3bb952 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -9225,7 +9225,8 @@ s390_output_pool_entry (rtx exp, machine_mode mode, unsigned int align) case MODE_DECIMAL_FLOAT: gcc_assert (GET_CODE (exp) == CONST_DOUBLE); - assemble_real (*CONST_DOUBLE_REAL_VALUE (exp), mode, align); + assemble_real (*CONST_DOUBLE_REAL_VALUE (exp), + as_a (mode), align); break; case MODE_INT: diff --git a/gcc/output.h b/gcc/output.h index 6c99381..c94fe08 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -281,7 +281,7 @@ extern section *get_named_text_section (tree, const char *, const char *); /* Assemble the floating-point constant D into an object of size MODE. ALIGN is the alignment of the constant in bits. If REVERSE is true, D is output in reverse storage order. */ -extern void assemble_real (REAL_VALUE_TYPE, machine_mode, unsigned, +extern void assemble_real (REAL_VALUE_TYPE, scalar_float_mode, unsigned, bool = false); /* Write the address of the entity given by SYMBOL to SEC. */ diff --git a/gcc/varasm.c b/gcc/varasm.c index 5b15847..320a5a6 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2764,7 +2764,7 @@ assemble_integer (rtx x, unsigned int size, unsigned int align, int force) in reverse storage order. */ void -assemble_real (REAL_VALUE_TYPE d, machine_mode mode, unsigned int align, +assemble_real (REAL_VALUE_TYPE d, scalar_float_mode mode, unsigned int align, bool reverse) { long data[4] = {0, 0, 0, 0}; @@ -3830,7 +3830,8 @@ output_constant_pool_2 (machine_mode mode, rtx x, unsigned int align) case MODE_DECIMAL_FLOAT: { gcc_assert (CONST_DOUBLE_AS_FLOAT_P (x)); - assemble_real (*CONST_DOUBLE_REAL_VALUE (x), mode, align, false); + assemble_real (*CONST_DOUBLE_REAL_VALUE (x), + as_a (mode), align, false); break; } @@ -4805,7 +4806,8 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align, if (TREE_CODE (exp) != REAL_CST) error ("initializer for floating value is not a floating constant"); else - assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)), + assemble_real (TREE_REAL_CST (exp), + SCALAR_FLOAT_TYPE_MODE (TREE_TYPE (exp)), align, reverse); break;