From patchwork Thu Jul 13 08:41:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 107596 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1926204qge; Thu, 13 Jul 2017 01:42:20 -0700 (PDT) X-Received: by 10.98.23.3 with SMTP id 3mr60158413pfx.55.1499935340400; Thu, 13 Jul 2017 01:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499935340; cv=none; d=google.com; s=arc-20160816; b=oNhsrnim5eHO9RNvAf3eh+N/zEq713rgBi8WatPghlBa9aQkWl5Ifhw9h5gBMRKmQy lOqUO6Cpx1e3SRW4//WqAR01qwfok8HvlQxLSpRuFK6Hixh2x987qM9LDFCum80AtjTr irboKU5BvXsOTsnIgqxzv+C3egr9nif4SfoasRUlzWFG34pGTD/VTI+goU1SPNNIDqDv BnxqytLwq3l5HUMg9ftANXLsu2goCXrYiia4AkZmjrYc2gXjpbAwnm5Gyjjg3mCdn2F6 dicJTlBtuSXSwyaI8n7+6vVug8omZHYrw3NWaanIJStFXHrazZ2yL19ZgmHEltNzzjZA oLhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=/QtbBeLApNce57myQENfqquVVPfTlPo11c0BWfMKlrk=; b=gIG9hHe2S28v5qzuS/6pHXp03AcMvKWVE2JCeZ3zrs4dnsIjsVE1msVV6N/CXKW1CC J2SjZJOvN5HVv5OPkaUT96887RgRncJMM32ZGpraRJs3ihVkAvLUQadm/hkHvbWTkhN4 qCd+HjALdirVyyewXut98nhvMOLwOFbzwaF5f0hcFZ4SxBcjDoFXrWDvx7qotBMHmUM4 +Re/yHz1bv3UuLkjIsq0LUiTSU90QPKNPz2lSTKbJMHC4WSY3NPYFIfGpPaZvHkpmDyR Z877Gisgeh8h98G1esLEbPmX+NXWsntkn7FGs3bUcnp6xJAnpIx4l1Fq3Fye1Atr9u80 iIPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=sLPdRRbl; spf=pass (google.com: domain of gcc-patches-return-458000-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458000-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i7si4049831plk.473.2017.07.13.01.42.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 01:42:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-458000-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=sLPdRRbl; spf=pass (google.com: domain of gcc-patches-return-458000-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458000-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=bpaGFlTd1X6ZUtjuxXXkIknPZfXS0 OzEZzOtKPP7xvkg+/UfNuOIxyfSUnswJPvoKKuRRwZhQlRyLi0O8TSP9CNcZaawQ oZzv+KGVOFK2wSBkcwQY4BqVbhLUz5i+xflD+TT22YSlP4egIfSBiCg5mO53uj+y 9lkHQySY0taq/0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=xeQNPERO6cpQolheXCjGdEvPcXM=; b=sLP dRRblUUKXWzbOwSalpXeljrBtOa3WGHaIF3P8R4l+HweBHKRO49S2rl2ez58eO/e shp9uZtzKIuoY2YfoZI7IHmADKuj72xb9tBhap1zSvcI1Q0v7jghMiiFaGagh3w0 pJWjMgfR/KYe6L8mnVuav8+ZlnFOwVHBT5bMKgEg= Received: (qmail 92853 invoked by alias); 13 Jul 2017 08:42:05 -0000 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 Received: (qmail 91400 invoked by uid 89); 13 Jul 2017 08:42:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=assemble, HIGH, SEC, REVERSE X-HELO: mail-wm0-f44.google.com Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 08:42:03 +0000 Received: by mail-wm0-f44.google.com with SMTP id t70so2156387wmt.0 for ; Thu, 13 Jul 2017 01:42:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=/QtbBeLApNce57myQENfqquVVPfTlPo11c0BWfMKlrk=; b=RA4+OiaiFWlHH0I4Ol0QYfXin+BvDONRFOVj8G2M6LolZR+y/2TRY4Y0OeLVGYZFHA T5ZSBudhQ13/2Hk/8TrDugZy96GRXKSK86xj53ohfe9LM0qgdHbX0YpVKpNGbw4uht4O 9y77hwA+pGzr3w3eNsCJY7PNCCnFBX6ra3YSxAvNOZLTy/rbZ4CQVbf6bins5aHah5Wm Z/eWVXGxtcNHyu5tNB6NIoRUsyT7B07W3CRt99j3NEtlV6+v0lUmqL4sH/p/yIFKdyGr 992ioY+Xy2aNsLSPrirUBVohq9WKp4e4zesDO8AaLAhbEdWlLuppM7GsS1wWo4viZV21 BvtA== X-Gm-Message-State: AIVw11014PmTQoeSbVQdp6ErK++y2N/14mU+Cvc4C8HuN3Rvb2aeGss1 UkdnWdRf/4aBKLNGsPfpBA== X-Received: by 10.28.191.134 with SMTP id o6mr1071101wmi.11.1499935320694; Thu, 13 Jul 2017 01:42:00 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id n205sm3435855wmf.21.2017.07.13.01.41.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 01:41:59 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [10/77] Make assemble_real take a scalar_float_mode References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 09:41:58 +0100 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <87y3rslodl.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 As per subject. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * 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. Index: gcc/output.h =================================================================== --- gcc/output.h 2017-02-23 19:54:20.000000000 +0000 +++ gcc/output.h 2017-07-13 09:18:25.330032056 +0100 @@ -281,7 +281,7 @@ #define assemble_aligned_integer(SIZE, V /* 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. */ Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c 2017-07-13 09:18:19.034703736 +0100 +++ gcc/config/arm/arm.c 2017-07-13 09:18:25.327032350 +0100 @@ -22664,8 +22664,9 @@ arm_assemble_integer (rtx x, unsigned in 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); } Index: gcc/config/arm/arm.md =================================================================== --- gcc/config/arm/arm.md 2017-06-16 10:02:37.333681715 +0100 +++ gcc/config/arm/arm.md 2017-07-13 09:18:25.328032252 +0100 @@ -11232,13 +11232,11 @@ (define_insn "consttable_4" { 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 @@ -11248,7 +11246,6 @@ (define_insn "consttable_4" x = XEXP (x, 0); assemble_integer (x, 4, BITS_PER_WORD, 1); mark_symbol_refs_as_used (x); - break; } return \"\"; }" @@ -11262,16 +11259,12 @@ (define_insn "consttable_8" "* { 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") @@ -11284,16 +11277,12 @@ (define_insn "consttable_16" "* { 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") Index: gcc/config/mips/mips.md =================================================================== --- gcc/config/mips/mips.md 2017-07-13 09:18:19.078698858 +0100 +++ gcc/config/mips/mips.md 2017-07-13 09:18:25.329032154 +0100 @@ -7358,7 +7358,7 @@ (define_insn "consttable_float" { 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 ""; } Index: gcc/config/s390/s390.c =================================================================== --- gcc/config/s390/s390.c 2017-07-13 09:18:19.123693869 +0100 +++ gcc/config/s390/s390.c 2017-07-13 09:18:25.330032056 +0100 @@ -9494,7 +9494,8 @@ s390_output_pool_entry (rtx exp, machine 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: Index: gcc/varasm.c =================================================================== --- gcc/varasm.c 2017-06-12 17:05:23.276759414 +0100 +++ gcc/varasm.c 2017-07-13 09:18:25.331031958 +0100 @@ -2759,7 +2759,7 @@ assemble_integer (rtx x, unsigned int si 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}; @@ -3829,7 +3829,8 @@ output_constant_pool_2 (machine_mode mod 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; } @@ -4811,7 +4812,8 @@ output_constant (tree exp, unsigned HOST 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;