From patchwork Fri Nov 17 21:48:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 119227 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1041594qgn; Fri, 17 Nov 2017 13:52:40 -0800 (PST) X-Google-Smtp-Source: AGs4zMbl1zg4sR2dLCY0XXYOWIHC4eBRqbQXRkb9bzDacRNuzUE3t7ErjnFv3m3cTWvqN8/U3/Rl X-Received: by 10.99.115.79 with SMTP id d15mr6529134pgn.340.1510955560268; Fri, 17 Nov 2017 13:52:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510955560; cv=none; d=google.com; s=arc-20160816; b=fxWzyvqdwyon136uZfYhzkBqJJCUaehrWwmrj0QmNmuWt1zIgtmtcp8AfTUCkryp3y sT6wPa8egZ/G4yhcVpArLZmI7zc/hsA7plhVD1i9YbL8l0gbIVzOJWifHRji3BGfZ0eG jmjgNn7MteGGJISFf5Xbmi/XVPiz8OzzSrgoHWPOprmfwIs6xUWwVRhLiYnHGxPJ36De cX3EUqQ6rI/twiCvdEhLX2n3JJEQ0QGboPN8+pSxyRThw7QTvleLzH1etoZAnjogN3Fp RAyu7AFDzZ6qORBZT9Evqeaw45tde6OmtafVt/J5qj0FBhTiKypBdgDRq5b6MHqSILTJ JUgA== 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=PcRXltBTcEGOzFNEcxklE/9yaSKpOVDqGfVTtVlBXKQ=; b=or9Uriwxa0poaI60AuiAsHNf1/LogEccO1HlyoIA8hXW9NaSRyV0+HqJvvd+C8ExZn Y9cZ477SuYLYjHd39rOSVQguSBBEWXaUYxRprIIooKJd+ZKoUa+1hkebng3O03UUAZV6 A/FhIKG1SBfSef0APYTeOVc7x9iOf16bfWjZRHa/idAAFiqPiFAvI+EqkAuDpoKDItS6 6J6Czt+/V78S9FmKO72EbyplVQMV48KitFp556AEGW2JAsoAfDv/d3k7roxFLvSvq5hm fsjBg5aKtue1oeDUNkorhRUSlDDl6cIq6TNPyDFgKrKteWf9Vp2jbmAE6OYIDr35y0if +aQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bTcz/n+2; spf=pass (google.com: domain of gcc-patches-return-467228-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-467228-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 126si3740907pfe.326.2017.11.17.13.52.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 13:52:40 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-467228-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=bTcz/n+2; spf=pass (google.com: domain of gcc-patches-return-467228-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-467228-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=uyYhn3NFtKMo3epFVgZPalVgqRNnLkXdSRpkuwsL1mknnO6TExp8x CIlILqasJvLdQa4zb0o6SikpvZHb51EorI4pQ9kwA1ZV9Z/zAnlHOxZ6lkTqrLUv whwMypa1T0hAZyv1inNPjzX0QQmrpnuiKZlbeRzoBjT1WiGRvG9JOE= 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=CO7lHnmSOk+GUYYSEFNl63+7m5s=; b=bTcz/n+2O1LlDhYjRb/K dm8/SQ9yt0MSiCo/H9+CIfdU8Cn8uw4lf+eQkO6Lmxu/8ZsYIuq07upTPnJ3fTd0 cN9tW8SL+j75NU1IDaRTQgWipq53WLuZh442T28eNwOaw6b3tiqxMIqhmttmMzTi zhZdUtDlt823st+PpFrMkmo= Received: (qmail 121249 invoked by alias); 17 Nov 2017 21:48:32 -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 120080 invoked by uid 89); 17 Nov 2017 21:48:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=WIDTH, 5168, *prefix, CLASS X-HELO: mail-wr0-f176.google.com Received: from mail-wr0-f176.google.com (HELO mail-wr0-f176.google.com) (209.85.128.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Nov 2017 21:48:17 +0000 Received: by mail-wr0-f176.google.com with SMTP id 4so3258047wrt.0 for ; Fri, 17 Nov 2017 13:48:13 -0800 (PST) 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=PcRXltBTcEGOzFNEcxklE/9yaSKpOVDqGfVTtVlBXKQ=; b=H5dZOUAwkJovdemudqB1M2+px3KIH+MAWfOFfnluKaUpJvAPQ7Z+RPjVm6oSGwNxEE q98IbsR+UqVj117B9O3z90V3jgqysbuFNT9B4q+E4YhRSTWt65HOzlI8KKee4qJqhn4Z P7KdeqkRS1Ck/ZPhPfNrbv+VoBM80F1qX+YljFHpFVAQvXTlbBIhDVJ/TXVV0QGi2g4s RjkLCs35pSYa2YvzdiiniLUqy87vbxz+mGosigbOIBiqBXNSFyzQ3Ns92nW//p8zMq4y 58x71rRyAdlLt8C/VCt+pdbPFJubjMDXYJwBNVgSIy4FI4vSYlLJJUb+ryviURDsjdca E2Dw== X-Gm-Message-State: AJaThX78FhQAMGOElOcxxDin+GbGIZ52ju0959fT+8MRHqNaJbMp/ztv 2avPtAjsGRzR8LsJAKrZ3Zr/wJI8mF4= X-Received: by 10.223.171.85 with SMTP id r21mr5211024wrc.182.1510955291217; Fri, 17 Nov 2017 13:48:11 -0800 (PST) Received: from localhost ([2.25.234.120]) by smtp.gmail.com with ESMTPSA id 143sm9645195wmj.35.2017.11.17.13.48.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Nov 2017 13:48:10 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: Allow targets to pick a vector prefix other than "V" Date: Fri, 17 Nov 2017 21:48:09 +0000 Message-ID: <87mv3kwp9i.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Originally the SVE port used the names for 256-bit vectors, as the next available increment after Advanced SIMD. However, that was always a bit of a hack and is bound to confuse people new to the code. Nothing actually requires vector modes to have names of the form V, and after talking it over with the AArch64 maintainers, we agreed to switch to things like: VNx16QI instead. This patch lets targets pick this kind of prefix. Tested on aarch64-linux-gnu (with and without SVE), x86_64-linux-gnu an powerpc64le-linux-gnu. I'll apply this under the gen* maintainership when the SVE port itself has been approved. Thanks, Richard 2017-11-17 Richard Sandiford gcc/ * machmode.def (VECTOR_MODES_WITH_PREFIX): Document. * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro. (VECTOR_MODES): Use it. (make_vector_modes): Take the prefix as an argument. Index: gcc/machmode.def =================================================================== --- gcc/machmode.def 2017-11-17 21:46:15.177979825 +0000 +++ gcc/machmode.def 2017-11-17 21:46:25.555622937 +0000 @@ -142,6 +142,10 @@ along with GCC; see the file COPYING3. than two bytes (if CLASS is FLOAT). CLASS must be INT or FLOAT. The names follow the same rule as VECTOR_MODE uses. + VECTOR_MODES_WITH_PREFIX (PREFIX, CLASS, WIDTH); + Like VECTOR_MODES, but start the mode names with PREFIX instead + of the usual "V". + VECTOR_BOOL_MODE (NAME, COUNT, BYTESIZE) Create a vector mode called NAME that contains COUNT boolean elements and occupies BYTESIZE bytes in total. Each boolean Index: gcc/genmodes.c =================================================================== --- gcc/genmodes.c 2017-11-17 21:46:15.177050178 +0000 +++ gcc/genmodes.c 2017-11-17 21:46:25.554693290 +0000 @@ -483,9 +483,11 @@ make_complex_modes (enum mode_class cl, /* For all modes in class CL, construct vector modes of width WIDTH, having as many components as necessary. */ -#define VECTOR_MODES(C, W) make_vector_modes (MODE_##C, W, __FILE__, __LINE__) +#define VECTOR_MODES_WITH_PREFIX(PREFIX, C, W) \ + make_vector_modes (MODE_##C, #PREFIX, W, __FILE__, __LINE__) +#define VECTOR_MODES(C, W) VECTOR_MODES_WITH_PREFIX (V, C, W) static void ATTRIBUTE_UNUSED -make_vector_modes (enum mode_class cl, unsigned int width, +make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width, const char *file, unsigned int line) { struct mode_data *m; @@ -516,8 +518,8 @@ make_vector_modes (enum mode_class cl, u if (cl == MODE_INT && m->precision == 1) continue; - if ((size_t)snprintf (buf, sizeof buf, "V%u%s", ncomponents, m->name) - >= sizeof buf) + if ((size_t) snprintf (buf, sizeof buf, "%s%u%s", prefix, + ncomponents, m->name) >= sizeof buf) { error ("%s:%d: mode name \"%s\" is too long", m->file, m->line, m->name);