From patchwork Mon Sep 30 07:32:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 98145 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E8DBD385F028 for ; Mon, 30 Sep 2024 07:33:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 6331B3858C41 for ; Mon, 30 Sep 2024 07:32:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6331B3858C41 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6331B3858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727681570; cv=none; b=aC1cRNkFVyZOF3WCPZvT1gbwFRQtC3cnH7hsuFj+wTuppm0dIH2GEwM9QkrJ/NM9yo25Aym5O4ZwiHlhOV53Sugn1QX4uJjWSrPNKceu9hzrmcyAWMYjkrCP/pzhyFJJjBfELYq/jEqJ5QMhbIlcf4I8vDSBmy2DvtBgVjmL0wM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727681570; c=relaxed/simple; bh=B1EHdm7Yosvs+bSQgeopsEltpGKghwXVZd1ruwfJ3QU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=ZvfEHKNgRY5YoUNIePTVP44IgR+M6uvNnylbG1UbPFZa8aPdacUu/lCtHDQODkImETHh0n6hTOs1GpKHwF7FH9LvgkDbpDe3iTfWbCe0sZhTM5o2ZR9M57Cyp+6/2Wh3g5u2AFIuMu8hBZuPS0Nl/333ckB4iFkRk9HQcMF4SdQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a8d6d0fe021so709341166b.1 for ; Mon, 30 Sep 2024 00:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1727681567; x=1728286367; darn=gcc.gnu.org; h=content-transfer-encoding:autocrypt:content-language:cc:to:subject :from:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=J6hg1KzjIkRKxzOpcau2fCA3MNPFVMzSvsLKgrfmeRg=; b=OzNWtI6F3UxEFWZS+B/49/7HKbGps9Rr5nZIl7YpI8KjmdG/qby79NQg6u1mw3+toN NmAmR46lz0OYjxw4lMfrlCeoqGys2pgjApdQ5vY54kgX6QUpKRo5jUmaJiJBdDGrRS8l qO8lthxtqPgXeM+Kqn4mbQlHPLb+Jv3I6l1fF5+4ZYgo7KIUN3eOh0veLQLcPc1bzKLV bRuPG8Kx0bWcxFfVvrsDGZPbttaHL+mYFrh0z5hTHHhbnIk7rcJdEOzkSIY+Gg1bg/Xs WdbvxM3t5JVeFb8B5v3Wr2sflKPJzY3oJM7+w4PRiSlZ01drbQ38ujSmwbGTloMd9bO7 GYKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727681567; x=1728286367; h=content-transfer-encoding:autocrypt:content-language:cc:to:subject :from:user-agent:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=J6hg1KzjIkRKxzOpcau2fCA3MNPFVMzSvsLKgrfmeRg=; b=CvRLbSS7I50J0daDIWRnDVv5mx97UhcS5yUXxB5+ohTfxwgUrxbEHjyaaCL8MmD2Ow D3tFfXmTuI4h0+hfoYWTYnVXpLuN1C5J9YG73fUyQ0aCJWE5TpRJypK4YamSNLAXck9n 0Sx4+FmK+29u0sBRnxoIqG9lFiydyOMnDmrPY9H8wMr252bROHMmv3EXeAT+mjuCKjyR vGnEXo4aLFsZRaj4xDvRTvnv3hpwlbYeWgrewjt4Fip8z/71Sj03kerHhFjXURs7zw24 D5b3AHZ48WrGjT5ubU8l5KWkCSgVewV446gnC3ZOjVXOoyJ4bxJCIBk6pVwfdmYOh7wt imyg== X-Gm-Message-State: AOJu0YzIt+QI75Ba9tHOD0yfRTrG1q0QmglmMuQxea/ecbax72zNSGNq 1xN+pfhsXhZ2OCqPFwRSzj0Yo845Z/srDq35J6S0yZnxBz09AjCMy1NG0N7TJALBiO8JO++MqZ8 = X-Google-Smtp-Source: AGHT+IHtVuUzmFNeyjau4MvRC99poCdT9p05uXdQBRvTOOWIuUPnBKhhvNDMYwqTi96CI95uSBFt4w== X-Received: by 2002:a17:906:4fcb:b0:a8d:5d28:8e0d with SMTP id a640c23a62f3a-a93c4a84fe1mr1168535566b.45.1727681566918; Mon, 30 Sep 2024 00:32:46 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2776de0sm488779466b.2.2024.09.30.00.32.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Sep 2024 00:32:46 -0700 (PDT) Message-ID: Date: Mon, 30 Sep 2024 09:32:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jan Beulich Subject: [PATCH v2] x86/{,V}AES: adjust when to force EVEX encoding To: "gcc-patches@gcc.gnu.org" Cc: Hongtao Liu , Kirill Yukhin , Jakub Jelinek Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Y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A5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL X-Spam-Status: No, score=-3023.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Commit a79d13a01f8c ("i386: Fix aes/vaes patterns [PR114576]") correctly said "..., but we need to emit {evex} prefix in the assembly if AES ISA is not enabled". Yet it did so only for the TARGET_AES insns. Going from the alternative chosen in the TARGET_VAES insns isn't quite right: If AES is (also) enabled, EVEX encoding would needlessly be forced. gcc/ * config/i386/sse.md (vaesdec_, vaesdeclast_, vaesenc_, vaesenclast_): Replace which_alternative check by TARGET_AES one. --- As an aside - {evex} (and other) pseudo-prefixes would better be avoided anyway whenever possible, as those are getting in the way of code putting in place macro overrides for certain insns: gas 2.43 rejects such bogus placement of pseudo-prefixes. Is it, btw, correct that none of these insns have a "prefix" attribute? --- v2: Adjust (shrink) description. --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -30802,7 +30802,7 @@ UNSPEC_VAESDEC))] "TARGET_VAES" { - if (which_alternative == 0 && mode == V16QImode) + if (!TARGET_AES && mode == V16QImode) return "%{evex%} vaesdec\t{%2, %1, %0|%0, %1, %2}"; else return "vaesdec\t{%2, %1, %0|%0, %1, %2}"; @@ -30816,7 +30816,7 @@ UNSPEC_VAESDECLAST))] "TARGET_VAES" { - if (which_alternative == 0 && mode == V16QImode) + if (!TARGET_AES && mode == V16QImode) return "%{evex%} vaesdeclast\t{%2, %1, %0|%0, %1, %2}"; else return "vaesdeclast\t{%2, %1, %0|%0, %1, %2}"; @@ -30830,7 +30830,7 @@ UNSPEC_VAESENC))] "TARGET_VAES" { - if (which_alternative == 0 && mode == V16QImode) + if (!TARGET_AES && mode == V16QImode) return "%{evex%} vaesenc\t{%2, %1, %0|%0, %1, %2}"; else return "vaesenc\t{%2, %1, %0|%0, %1, %2}"; @@ -30844,7 +30844,7 @@ UNSPEC_VAESENCLAST))] "TARGET_VAES" { - if (which_alternative == 0 && mode == V16QImode) + if (!TARGET_AES && mode == V16QImode) return "%{evex%} vaesenclast\t{%2, %1, %0|%0, %1, %2}"; else return "vaesenclast\t{%2, %1, %0|%0, %1, %2}";