From patchwork Mon Oct 23 09:36:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116654 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp2653031edm; Mon, 23 Oct 2017 02:36:42 -0700 (PDT) X-Received: by 10.84.242.12 with SMTP id ba12mr9677163plb.69.1508751402811; Mon, 23 Oct 2017 02:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508751402; cv=none; d=google.com; s=arc-20160816; b=TzXHiTCFtshzLDMrDvYyW+x1sYWOa5uh9TFQA8QJp0bRnD0rv5R/Z+CIb3HdCP36ZZ 8x6t4pUMfmfJCTlHgvHN8FI6YhaJXdZPCN15VSGtGEMoxwp2wFKskyJd4WFGLdQPAkwC cykU4pPE1cpu2tTZZXCZd1IS1mMXfiCR74dzCa2Ik9+rlh27bUGMGsRoGHFrMoed4e7l hGlS/M+S2WZlIZXgPt5By76IIEZAlMbwVgbEAMK37B1B4P89L9rlKG678Duwaa/Idp7z +4ZGGuP2uRYm/SoCOPy0Nyns7R+hKcciD/N8/giBGYspIfBcRaCOOIsxnNuT6raHYTmp KMRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date: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=Fl2XbLIXii45Y+QjkpE+ru9oEQXyVtCBLOlfxxFVYMw=; b=qYBv0BGNRORD5bE0OUSdWsfSbipMtqzBGx9+01ZEFh2AmHkVRAKoK/ZsrisbUDqNn7 dXUe4Znb+asKWCe/sPIBeIO99UhlanXsgZF6W096fO0BkffRFbcjjvqhPlvPSandU95W zuHdKqphfeBKrMrxxm7Ye2OfHxAYR4MjwGwvQY8xY2EpxrOzj5rv6HmQmgRKyXFsuoZK DxZTlZJeIjEwQr00Wc0JJe+qSZBAj1oYxCRScKFpbxGQtb9jiGCIEplyiEKAOw0pZpab yszzjUZ6h5qZE4Ebt0Dzfx2j4MlE+LlRqGpBe/S4IVs0SRcPv6Iu4ukwXOfQIeC8eDuq 1KZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mVCUxexC; spf=pass (google.com: domain of gcc-patches-return-464702-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464702-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 d1si3846664pln.570.2017.10.23.02.36.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 02:36:42 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464702-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.s=default header.b=mVCUxexC; spf=pass (google.com: domain of gcc-patches-return-464702-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464702-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:date:message-id:mime-version:content-type; q=dns; s= default; b=cWV+IENvjikCtAlSXH6cWu5LMCHYYCTCpd7Xe9JooUmra4tJbZAq2 0A9Xjn1y1gRgXTqsKk7aDo9eAZGad4zssSmvFCuCnMllC5duvtGkjFFLhfJYVLmr Oq/GmaAWi0BJUnoGj3YomdCGmYly0pDqdREdaESWdORqoAtTi4HuDQ= 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:date:message-id:mime-version:content-type; s= default; bh=Crmve4nnCmwVqivffSL3BuWryes=; b=mVCUxexCswDTPs8TNh2B nlJfDk0oIb4UyyOXdFf0Zz0AbJ+AC1OPdephQUJnQgVqsHjXz5RkjeybZhJydZQh F5L9LTYRUQ/ACQ+cozASsyOWyVDw+LIt7Na8JfFwQCHItttnSLZaiHwFXhqB8AYj xjsrS8KzZKBTHPr2ewYEpf0= Received: (qmail 89563 invoked by alias); 23 Oct 2017 09:36:27 -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 89549 invoked by uid 89); 23 Oct 2017 09:36:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=asks, brig, Hx-languages-length:1585 X-HELO: mail-wm0-f47.google.com Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 09:36:25 +0000 Received: by mail-wm0-f47.google.com with SMTP id r68so8548889wmr.3 for ; Mon, 23 Oct 2017 02:36:24 -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:date:message-id :user-agent:mime-version; bh=Fl2XbLIXii45Y+QjkpE+ru9oEQXyVtCBLOlfxxFVYMw=; b=nP0FAvHT3XnKuiK1e61F2upj4ir+aDGqUkCDmnSAXPV0Qh4vbZ5bB3FG8evN/2zIPe GUo11HgPXw60Zr7ZActJjmP70KHjg8msDL8RazwpnYFkdrKuWd99Zw2KGr75haSHKPao MCEoB3VaoiO7FTKlDGIJ3i7buXqY+5pTlMx80XWzG2NKcOv46SsBOitp1Z3gFcqBYikJ 7bl2R/Oy2bOyxDTHUc4tImMOMU4t+DqjwoEMT4SfficbYM9oXpucG+xIKLpAPfxs2Hgz JGxs4VzTcAhWkxxe2S+NdQhQUXo5z5QYab0NmiW3sH05yK2ClSiZgl5QSB0OzNZ+D6bZ AalA== X-Gm-Message-State: AMCzsaVlPJ/aOqwu06qu7qwkmD+SJPd1Y30rHYwXOkaLIixQRcvWq9XD g8HllL7V+Pr9gulrVYI2kkAoCl4o0ww= X-Google-Smtp-Source: ABhQp+RMcJGpmB9pO1YG5ZvmdGp4VnG/L9avpnvDSFWI+evPbVAt3PL8K5oNX1/18OS8jxBUgHB9XA== X-Received: by 10.28.20.80 with SMTP id 77mr4492391wmu.154.1508751383029; Mon, 23 Oct 2017 02:36:23 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id n14sm8695665wrg.38.2017.10.23.02.36.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 02:36:22 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [committed] Use scalar_int/float_mode in brig_langhook_type_for_mode Date: Mon, 23 Oct 2017 10:36:21 +0100 Message-ID: <87k1zmyzmy.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This follows on from similar changes a couple of months ago and is needed when general modes have variable size. Tested on x86_64-linux-gnu and applied as obvious. Richard 2017-10-23 Richard Sandiford gcc/brig/ * brig-lang.c (brig_langhook_type_for_mode): Use scalar_int_mode and scalar_float_mode. Index: gcc/brig/brig-lang.c =================================================================== --- gcc/brig/brig-lang.c 2017-10-02 09:10:56.960755788 +0100 +++ gcc/brig/brig-lang.c 2017-10-23 10:33:45.740101313 +0100 @@ -278,10 +278,11 @@ brig_langhook_type_for_mode (machine_mod return NULL_TREE; } - enum mode_class mc = GET_MODE_CLASS (mode); - if (mc == MODE_FLOAT) + scalar_int_mode imode; + scalar_float_mode fmode; + if (is_int_mode (mode, &imode)) { - switch (GET_MODE_BITSIZE (mode)) + switch (GET_MODE_BITSIZE (imode)) { case 32: return float_type_node; @@ -290,15 +291,15 @@ brig_langhook_type_for_mode (machine_mod default: /* We have to check for long double in order to support i386 excess precision. */ - if (mode == TYPE_MODE (long_double_type_node)) + if (imode == TYPE_MODE (long_double_type_node)) return long_double_type_node; gcc_unreachable (); return NULL_TREE; } } - else if (mc == MODE_INT) - return brig_langhook_type_for_size(GET_MODE_BITSIZE(mode), unsignedp); + else if (is_float_mode (mode, &fmode)) + return brig_langhook_type_for_size (GET_MODE_BITSIZE (fmode), unsignedp); else { /* E.g., build_common_builtin_nodes () asks for modes/builtins