From patchwork Mon Oct 12 10:17:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1380797 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=h/8MRsa2; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C8vkY04hdz9sT6 for ; Mon, 12 Oct 2020 21:17:39 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDCAE3870906; Mon, 12 Oct 2020 10:17:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDCAE3870906 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1602497855; bh=e7hL8YltquNd/n0b73bUz8sSQ1OoQw53zvQGONmQ9gE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=h/8MRsa2n5obiinx6eUsENiNM69I4g+z3x47fIcjALFOtP6hTa+e93uUu3odCT9PH 7h+GGADjmHc6+SZjBUDUFMS9frreF3qq4pmWcwvweF6Ubob27nb4VhmChnhF09FKxO /3ukw9EKNqbKKb892gTpREBhRQSQRKQj2F/VUNfI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by sourceware.org (Postfix) with ESMTPS id 18977386F000 for ; Mon, 12 Oct 2020 10:17:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 18977386F000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4C8vkM0rSkzQkjV; Mon, 12 Oct 2020 12:17:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id ypY5Y5O10L31; Mon, 12 Oct 2020 12:17:27 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Merge upstream dmd 3a9790525 Date: Mon, 12 Oct 2020 12:17:22 +0200 Message-Id: <20201012101722.3306413-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-MBO-SPAM-Probability: ** X-Rspamd-Score: 1.60 / 15.00 / 15.00 X-Rspamd-Queue-Id: F3C51108B X-Rspamd-UID: 389d01 X-Spam-Status: No, score=-15.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch merges the D front-end implementation with upstream dmd 3a9790525. Fixes the return codes to match the documentation of Target::isVectorTypeSupported. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 3a9790525 * d-target.cc (Target::isVectorTypeSupported): Adjust return codes for invalid size and invalid base type. --- gcc/d/d-target.cc | 6 +++--- gcc/d/dmd/MERGE | 2 +- gcc/d/dmd/mtype.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/d/d-target.cc b/gcc/d/d-target.cc index 4a38cca56b4..78f14203b5c 100644 --- a/gcc/d/d-target.cc +++ b/gcc/d/d-target.cc @@ -241,7 +241,7 @@ Target::isVectorTypeSupported (int sz, Type *type) { /* Size must be greater than zero, and a power of two. */ if (sz <= 0 || sz & (sz - 1)) - return 2; + return 3; /* __vector(void[]) is treated same as __vector(ubyte[]) */ if (type == Type::tvoid) @@ -249,7 +249,7 @@ Target::isVectorTypeSupported (int sz, Type *type) /* No support for non-trivial types, complex types, or booleans. */ if (!type->isTypeBasic () || type->iscomplex () || type->ty == Tbool) - return 3; + return 2; /* In [simd/vector extensions], which vector types are supported depends on the target. The implementation is expected to only support the vector @@ -258,7 +258,7 @@ Target::isVectorTypeSupported (int sz, Type *type) tree ctype = build_vector_type (build_ctype (type), nunits); if (!targetm.vector_mode_supported_p (TYPE_MODE (ctype))) - return 3; + return 2; return 0; } diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index 4676645f971..8a59cbde78e 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -1,4 +1,4 @@ -e49192807967c6f11252683a731c5a0159ef36da +3a979052509fff8170ba80e48817377a60e78eb3 The first line of this file holds the git revision number of the last merge done from the dlang/dmd repository. diff --git a/gcc/d/dmd/mtype.c b/gcc/d/dmd/mtype.c index 36471557dfc..bc66be028c1 100644 --- a/gcc/d/dmd/mtype.c +++ b/gcc/d/dmd/mtype.c @@ -3824,12 +3824,12 @@ Type *TypeVector::semantic(Loc loc, Scope *sc) case 1: // no support at all error(loc, "SIMD vector types not supported on this platform"); return terror; - case 2: // invalid size - error(loc, "%d byte vector type %s is not supported on this platform", sz, toChars()); - return terror; - case 3: // invalid base type + case 2: // invalid base type error(loc, "vector type %s is not supported on this platform", toChars()); return terror; + case 3: // invalid size + error(loc, "%d byte vector type %s is not supported on this platform", sz, toChars()); + return terror; default: assert(0); }