From patchwork Fri Sep 15 08:59:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 140261 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp902439vqi; Fri, 15 Sep 2023 01:59:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwJbB27bhFdNHK0jq1jAgji5ZuueLTs3tWV2y1t2xAkxI+ocxQIDqNcmmMQh2AIRag7S5j X-Received: by 2002:a17:906:73cb:b0:9a5:9038:b1e7 with SMTP id n11-20020a17090673cb00b009a59038b1e7mr870338ejl.36.1694768377119; Fri, 15 Sep 2023 01:59:37 -0700 (PDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id uz27-20020a170907119b00b009922cdfaf62si2891894ejb.42.2023.09.15.01.59.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 01:59:37 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=abdtF5CT; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84DDE3857726 for ; Fri, 15 Sep 2023 08:59:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84DDE3857726 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694768370; bh=mXDNbtIiIzUXa8Jg07xZ5S6BzYvlqco9KFBQ0+g5nNQ=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=abdtF5CTW70Qmdok1TdkOuwSqfa5S06F80cfFvH1zdZXgA33eJcj3zWhfAXVJCmId LB/MHoiZHIeVBOBXgTRySc6hebT+rGYqeD5EA5e8Qvju68ANe7G48UIRIffilngn4Q nS/hWhhEAY63l8allvO8RRl456cjxERuuD0hocXA= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2058.outbound.protection.outlook.com [40.107.105.58]) by sourceware.org (Postfix) with ESMTPS id 410D83858419 for ; Fri, 15 Sep 2023 08:59:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 410D83858419 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DeqypHnuZl7ZktAPdngbZ+WB6Rmxz1q7MQjCZibdgoOnb8IQm5rY3dh8VqBV8b7crQTmtZmdO1S9Wp45lpulm9o9Mf+AnbjNenDIJGot/YlG2aJH50Cs9kmTVKJvNFAk5V+DvmPCqaL0zMpGyIxrUQcMtiRE17BA/QT65IXOx7Tw+0QzdCqK49XG0Q989cNOiOeNdVuB8Sfw4bj4isxuEW5CyS0JGl4MBVu+5WTdloVMMza6fr/H836/QbgpfBrJiqR7cqL0GnlOVyZQqmwoKqj8jN5f5EHaiQ76o3ivEd8gjw2n+/KTqGEsbMhxNrjuvCGoGzrH9V2L0JU5heiKsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mXDNbtIiIzUXa8Jg07xZ5S6BzYvlqco9KFBQ0+g5nNQ=; b=CJXZ3sonRJifNHvghI/NDx5s4QLL9I7zsumuWjqY8GROEl+sK0KAII0mzxMMDsEq0N4t4g1EnJkmVEV7tL8iZtcEHcwooYmnC8p+3/xV0G3Nwd01lmNPE1xa4nwwHXf8Q926++4w1qgj2zwj9yZuXa4l83sCFNFmU4VzBSNMW0feVJkGVIyn7GwdTN/zGl40a4QTBCEi/XZ1jd/il5YMI0X0Z7iTnUma+lLtlWeAsTBkLMx/C/mUai5jc0GekSFdRNVJ8TeBDbtr9Ilu2TLLJcTXWfFvOpHgxSaeezsskoyH14aEJzVLg+v+xHAPWharMJue0HGBsjhRsHyg/0+eGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by PA4PR04MB7886.eurprd04.prod.outlook.com (2603:10a6:102:c1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Fri, 15 Sep 2023 08:59:17 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654%6]) with mapi id 15.20.6792.020; Fri, 15 Sep 2023 08:59:17 +0000 Message-ID: Date: Fri, 15 Sep 2023 10:59:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: [PATCH 1/3] x86: correct cpu_arch_isa_flags maintenance Content-Language: en-US To: Binutils Cc: "H.J. Lu" References: <8d21b532-7a4a-da25-3e95-d1aea76f75a3@suse.com> In-Reply-To: <8d21b532-7a4a-da25-3e95-d1aea76f75a3@suse.com> X-ClientProxiedBy: FR3P281CA0086.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::13) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7886:EE_ X-MS-Office365-Filtering-Correlation-Id: 45e73b0f-a007-4121-9c2b-08dbb5ca0aae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fpn5v4ReutIjNOd2nTMw8s1/RP+sGtAUHUVhqJd4HWe9BJUpc5HqTsTLp5CQcalsgKBFEiXkT8Ox9NZOnu+qE4E+oz9tCgWmzEH46S8Dziop+k6ERjqaQTuBFug7fwcrVoPB81d2ZgbV29Wgopi2t7qOBG765h0P1KUIxLc+yFllWpDYLyprIPC6wbx7BkgQshOATH4/N0Kn1MgmnxW4Hr0zuwg4QRITYm+sr2iPY76BRKbEeKLz91jpRDVk2C5kLSX2ahJAeqm8Ng5hxS24iyyKzgeWfpuXUL6Whq3H6A315CQwnXY6kJAis3PkZLY+rbvO0M3eph1XUKjJmjkBTABNCEiJ0o+c6PLMn9HkprSGdtGJIl+iqL5oMtSsa+8YoByP5ZR1NMmWhjkhsZVW5chS58ntWNk0O4v/o2e6YmQuWer1FTn68E1vmaQQznmih4bJaZ10RqYh2ifjM5J7zk9Zs21XFLnTTZNL2SiVfJwQq+7RRryLy8RFHYHje3hI2wxeS0aOBErzRXTQCtLwJsHIDJVvkuj2cjFHrTkWiGHOwaVxd0PczWNpXhAgq0MnE47AiYt8U48y/ui8OrNfmPRkZL17LqrklzBz99R+LbmAz53XtMKmd7Wtn/qco6J81isluluwvfWVazaYqMdfDw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8790.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(396003)(376002)(366004)(39860400002)(186009)(1800799009)(451199024)(5660300002)(26005)(8936002)(4326008)(8676002)(2616005)(2906002)(86362001)(31696002)(38100700002)(83380400001)(36756003)(6486002)(6506007)(66946007)(66476007)(66556008)(478600001)(31686004)(41300700001)(316002)(6916009)(6512007)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?a83EVS/G4SK0Bl+cya+mo8JBij2W?= =?utf-8?q?Jf+Gd6N7iWO4R5Eb9x67w0WkK0w/c0A4JENmv4sXnpQ02+3VNyl//evQEDv9WPC22?= =?utf-8?q?3xZjDnrz3HypwCNOQWpz0BUKvCkMpcNvtUyOJ57vXjaTawCF55/UxojwcuOp+OjqT?= =?utf-8?q?/4E/Tx1Ba2wuopaY5BoD/quz4fI3lb+dhwX0rwUW+9lbpDkWDZvIv+8dl9CuiHwVQ?= =?utf-8?q?oTcg5k17Q6OZt5Rad4cBFrPNKP69uM+7pl17+bASPtPDs8/Gz7/PPX3birfZpep/L?= =?utf-8?q?sX0BxhbUsXKirbtu8Vbi+n1pI7ShuupkoWfqyPdczCZQveu+eDbpDJHX6PMBo9NUS?= =?utf-8?q?FvYU0eGG6UBfZahOawfjB3IZno49XdF7uiOlZcPHgl89pi0Up/ggRkiGicf9v4w52?= =?utf-8?q?xNAJSgfImnPwTTdcGNwLykUE3bZzB8TCtHZbX730aY1ol2mnGp/lXRVbfh0hxsJAa?= =?utf-8?q?EVo0QY8B6B2PvwjOsmfieo7cz82zy8kJU7acmV8CCpAOANd2RnGzWsR229aXnM81b?= =?utf-8?q?85bD2KCzE62CUhWnUg/N5YzDP6Had3s8SHIa3XtLriN+K7yRvMA4c9jNhMVWyvzln?= =?utf-8?q?NJentO/FIABH9ouJXa0QBVpW8l1RFALUc8kAoDtLg7qJQbKORJpFOCRRKkcH2LeMQ?= =?utf-8?q?Y4m8S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f-8?q?KLDTA4R4RSzs?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45e73b0f-a007-4121-9c2b-08dbb5ca0aae X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 08:59:17.1681 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rJpWisdcVMqyRM+tP/WN0BEPDTHbtmsq7YMjgxdsQP96K4K2OKQ1NDUMEmt/VURdsIBRoWvHGrrS27Ei3YMcpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7886 X-Spam-Status: No, score=-3026.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777093445528458323 X-GMAIL-MSGID: 1777093445528458323 These may not be set from a value derived from cpu_arch_flags: That starts with (almost) all functionality enabled, while cpu_arch_isa_flags is supposed to track features that were explicitly enabled (and perhaps later disabled) by the user. To avoid needing to do any such adjustment in two places (each), introduce helper functions used by both command line handling and directive processing. --- While setting of vector_size could be moved into isa_disable() (further reducing code duplication), the same isn't true for isa_enable(). Because of the asymmetry I didn't do so. Thoughts / opinions? --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2804,13 +2804,41 @@ check_cpu_arch_compatible (const char *n } static void -extend_cpu_sub_arch_name (const char *name) +extend_cpu_sub_arch_name (const char *pfx, const char *name) { if (cpu_sub_arch_name) cpu_sub_arch_name = reconcat (cpu_sub_arch_name, cpu_sub_arch_name, - ".", name, (const char *) NULL); + pfx, name, (const char *) NULL); else - cpu_sub_arch_name = concat (".", name, (const char *) NULL); + cpu_sub_arch_name = concat (pfx, name, (const char *) NULL); +} + +static void isa_enable (unsigned int idx) +{ + i386_cpu_flags flags = cpu_flags_or (cpu_arch_flags, cpu_arch[idx].enable); + + if (!cpu_flags_equal (&flags, &cpu_arch_flags)) + { + extend_cpu_sub_arch_name (".", cpu_arch[idx].name); + cpu_arch_flags = flags; + } + + cpu_arch_isa_flags = cpu_flags_or (cpu_arch_isa_flags, cpu_arch[idx].enable); +} + +static void isa_disable (unsigned int idx) +{ + i386_cpu_flags flags + = cpu_flags_and_not (cpu_arch_flags, cpu_arch[idx].disable); + + if (!cpu_flags_equal (&flags, &cpu_arch_flags)) + { + extend_cpu_sub_arch_name (".no", cpu_arch[idx].name); + cpu_arch_flags = flags; + } + + cpu_arch_isa_flags + = cpu_flags_and_not (cpu_arch_isa_flags, cpu_arch[idx].disable); } static void @@ -2834,7 +2862,6 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED int e; const char *string; unsigned int j = 0; - i386_cpu_flags flags; SKIP_WHITESPACE (); @@ -2987,17 +3014,7 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED if (cpu_flags_all_zero (&cpu_arch[j].enable)) continue; - flags = cpu_flags_or (cpu_arch_flags, cpu_arch[j].enable); - - if (!cpu_flags_equal (&flags, &cpu_arch_flags)) - { - extend_cpu_sub_arch_name (string + 1); - cpu_arch_flags = flags; - cpu_arch_isa_flags = flags; - } - else - cpu_arch_isa_flags - = cpu_flags_or (cpu_arch_isa_flags, cpu_arch[j].enable); + isa_enable (j); (void) restore_line_pointer (e); @@ -3044,13 +3061,7 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED if (cpu_arch[j].type == PROCESSOR_NONE && strcmp (string + 3, cpu_arch[j].name) == 0) { - flags = cpu_flags_and_not (cpu_arch_flags, cpu_arch[j].disable); - if (!cpu_flags_equal (&flags, &cpu_arch_flags)) - { - extend_cpu_sub_arch_name (string + 1); - cpu_arch_flags = flags; - cpu_arch_isa_flags = flags; - } + isa_disable (j); if (cpu_arch[j].vsz == vsz_set) vector_size = VSZ_DEFAULT; @@ -14598,21 +14609,7 @@ md_parse_option (int c, const char *arg) && !cpu_flags_all_zero (&cpu_arch[j].enable)) { /* ISA extension. */ - i386_cpu_flags flags; - - flags = cpu_flags_or (cpu_arch_flags, - cpu_arch[j].enable); - - if (!cpu_flags_equal (&flags, &cpu_arch_flags)) - { - extend_cpu_sub_arch_name (arch); - cpu_arch_flags = flags; - cpu_arch_isa_flags = flags; - } - else - cpu_arch_isa_flags - = cpu_flags_or (cpu_arch_isa_flags, - cpu_arch[j].enable); + isa_enable (j); switch (cpu_arch[j].vsz) { @@ -14655,16 +14652,7 @@ md_parse_option (int c, const char *arg) if (cpu_arch[j].type == PROCESSOR_NONE && strcmp (arch + 2, cpu_arch[j].name) == 0) { - i386_cpu_flags flags; - - flags = cpu_flags_and_not (cpu_arch_flags, - cpu_arch[j].disable); - if (!cpu_flags_equal (&flags, &cpu_arch_flags)) - { - extend_cpu_sub_arch_name (arch); - cpu_arch_flags = flags; - cpu_arch_isa_flags = flags; - } + isa_disable (j); if (cpu_arch[j].vsz == vsz_set) vector_size = VSZ_DEFAULT; break; --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -147,6 +147,7 @@ if [gas_32_check] then { run_dump_test "nops-6" run_dump_test "nops-7" run_dump_test "nops-8" + run_dump_test "nops-9" run_dump_test "noreg16" run_list_test "noreg16" run_dump_test "noreg16-data32" --- /dev/null +++ b/gas/testsuite/gas/i386/nops-9.d @@ -0,0 +1,28 @@ +#objdump: -drw +#name: i386 nops 9 + +.*: +file format .* + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: 0f be f0 movsbl %al,%esi +[ ]*[a-f0-9]+: 8d b4 26 00 00 00 00 lea 0x0\(%esi,%eiz,1\),%esi +[ ]*[a-f0-9]+: 8d b6 00 00 00 00 lea 0x0\(%esi\),%esi + +0+10 : +[ ]*[a-f0-9]+: 0f be f0 movsbl %al,%esi +[ ]*[a-f0-9]+: 8d b4 26 00 00 00 00 lea 0x0\(%esi,%eiz,1\),%esi +[ ]*[a-f0-9]+: 8d b6 00 00 00 00 lea 0x0\(%esi\),%esi + +0+20 : +[ ]*[a-f0-9]+: f3 0f b8 f0 popcnt %eax,%esi +[ ]*[a-f0-9]+: 8d b4 26 00 00 00 00 lea 0x0\(%esi,%eiz,1\),%esi +[ ]*[a-f0-9]+: 8d 74 26 00 lea 0x0\(%esi,%eiz,1\),%esi +[ ]*[a-f0-9]+: 90 nop + +0+30 : +[ ]*[a-f0-9]+: 0f be f0 movsbl %al,%esi +[ ]*[a-f0-9]+: 66 66 2e 0f 1f 84 00 00 00 00 00 data16 nopw %cs:0x0\(%eax,%eax,1\) +[ ]*[a-f0-9]+: 66 90 xchg %ax,%ax +#pass --- /dev/null +++ b/gas/testsuite/gas/i386/nops-9.s @@ -0,0 +1,19 @@ + .text +default: + movsbl %al,%esi + .p2align 4 + + .arch .nopopcnt +nopopcnt: + movsbl %al,%esi + .p2align 4 + + .arch .popcnt +popcnt: + popcnt %eax,%esi + .p2align 4 + + .arch .nop +nop: + movsbl %al,%esi + .p2align 4 From patchwork Fri Sep 15 08:59:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 140262 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp902550vqi; Fri, 15 Sep 2023 01:59:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYkY2DubneCmAwnSNK31gvSzVv4PTDNxFW3Baef8DiHpicDyoU7h/D4bnXbk/k73Q76HbJ X-Received: by 2002:a17:907:7847:b0:9a9:f136:3aa4 with SMTP id lb7-20020a170907784700b009a9f1363aa4mr821539ejc.38.1694768397108; Fri, 15 Sep 2023 01:59:57 -0700 (PDT) Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a6-20020a1709065f8600b0098e48ad11e8si2624055eju.902.2023.09.15.01.59.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 01:59:57 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Gdz3n8Ug; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DFAD43858288 for ; Fri, 15 Sep 2023 08:59:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFAD43858288 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694768392; bh=6ysXwf95WRIwbjwRfsA9PxhzMqlzOcD0slkZ9BPkcVc=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Gdz3n8UglCt0FFMoF8Jpz94SXLGQKfyT/hDAogmYd+latGCMXCLmVBkIHO5T54ybh 9yCcUWsWJRkelGPr3Ob0LaFMifxzPMrgLjMDrdQAkBqq9hIiZmW+ICkoweIDB5aBbV ksYaHzFPd1v4BrwUS7zTRQlorfwMQ2+JKijh1k/s= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2056.outbound.protection.outlook.com [40.107.22.56]) by sourceware.org (Postfix) with ESMTPS id 3EEE238582BC for ; Fri, 15 Sep 2023 08:59:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3EEE238582BC ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJWcPnIMCcEpt+9Iw7cK5gX+t+9VdviGPv9A2huj737s7nCQOZvz94ERCYDbNjy7oOjcptOJSxiNpD+nfeh/X4ico+pF49hQ+8cbuUJOpOKUDWFRbbs1+8yvlAdzBTFpN916Gv2v3Ey3o/bV83WaGiy8ra1sKBK8bJNAnf7EJtPtRZzT9jEIa+jbdHxC+e9Sfz7k6u3LhGM8WPpHyPy/A6DIbpfKiKxM6fWgrI6lT5axuioayRredmayT0RECfghW/jni6pGnEhtKNZBQ3Z6vhEOzg8zID4tkTUfbYkSoI4p87/8D6mVCKHUaq1DzhUd52IZ52ahKL/jkndpW3pAbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6ysXwf95WRIwbjwRfsA9PxhzMqlzOcD0slkZ9BPkcVc=; b=ePcfdn4i/o6FmWGh2JGT0cA9EY9E5xYhjF35hnNBPpmmV63aY/hnqa47FWsGNs22z/uSsdA5XjriHHxgvQ6THdwa0PsXmQB+wu7dzmGgoEpKxgCwghosqS99TcSU3u+hQp/qNaMbQKwa00aBSH/O6ZFzWXzwqQeePMeyaiFmqNi5dDGr05b8YXfEw5N0fMfSWRIOv7VpOuIQ/jPhQJwwv2RO+1IcFaciokfLOmgdNN7/TFec9mxbuY6Khajvm1Bgo/bfXju+2WTkxdZnDmo1duiKzZWVgdU4sgAyYm3okneyPIKklHnwYR5sDGcfnJZErqDLcqgb8rA10+yNx4qU7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by AS8PR04MB8530.eurprd04.prod.outlook.com (2603:10a6:20b:421::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Fri, 15 Sep 2023 08:59:41 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654%6]) with mapi id 15.20.6792.020; Fri, 15 Sep 2023 08:59:40 +0000 Message-ID: <635f1462-9704-efca-c034-f4bc39e706f2@suse.com> Date: Fri, 15 Sep 2023 10:59:39 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: [PATCH 2/3] x86: drop cpu_arch_tune_flags Content-Language: en-US To: Binutils Cc: "H.J. Lu" References: <8d21b532-7a4a-da25-3e95-d1aea76f75a3@suse.com> In-Reply-To: <8d21b532-7a4a-da25-3e95-d1aea76f75a3@suse.com> X-ClientProxiedBy: FR0P281CA0173.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b4::20) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8530:EE_ X-MS-Office365-Filtering-Correlation-Id: 10814b3f-a0ec-4c9f-2433-08dbb5ca18d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kzhHERjCGY0/pTTNp3yKjVf0E4wqC+RcYgh5+P3tq4GW7VWembjDJN5mrHmolJ76+DC14XdYmNbKIskStAI2gf/VDYYX6gLxRsBHS3oe9G5lLVAzObDvLa124/O1+D1fy+qZL/8RPGhq3e+HRmsTYFNtnQ9sj+zcYClIGF0aCnSLsS+sEToGZAKqbB6zNqBjoM7P6Na1C0yycoe8OQvCXybkvqk/hGa8Pu0ShLb/djxh2guqgUGDJJUyA072mgwh+vKaJ6p+xKrlqsrhf1qA+ZwYU849oMdC7i3QrYyvgbm7/X0w+xb0v/EdCCU+cXzurp5JzL0hh/1zn01GawI1fQP/SSVwVc8Rznpk0Nj4o10ZJfcZI0GX+3yNcrqZhNMNCsc4qc2BYNELDs58GhLcUfeEFkGbMToyQ99MqllttjdsHXWTW3GJfMoAIJJoQtVUioANlhLMLHku8KWda7H7Hyg9mUjLqy8+EcQheA0fqcnUxaKMF5SD/FIahf4AgK4zS10pify5KRLRCq2CwfxCOk68eEKsDMS95Eb/pM+a7O9oQXtsZ8NPRBUO3YDVSj1gX6HvGEIZN6aIxlrdobVKBKbYCmjKPs2at9b4NnRyV/xphxLKIAUoCwUiF9FWLbCTGiR5Ykp8jK+4V9FB9nSLGA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8790.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(136003)(376002)(366004)(346002)(39860400002)(451199024)(1800799009)(186009)(6506007)(6486002)(6512007)(2906002)(26005)(66556008)(5660300002)(38100700002)(36756003)(66476007)(66946007)(4326008)(6916009)(316002)(41300700001)(8936002)(8676002)(2616005)(478600001)(31686004)(86362001)(31696002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?3frbr+5+zCA8uHaeOEs2pcItEue/?= =?utf-8?q?l1VLIbeuQjUEiNbE5aIr7bZ6vY+IjP+f1iPLCQkZFl5X3OWoqoY214fb973wfNMyP?= =?utf-8?q?VjV6xVx//iyUqO6WnmEjXGcL7kIKk/igI4T86RANXCDy/Dq0Hf3DoqTx4YO7hSTHw?= =?utf-8?q?gbH5ov6js3cO7slwM1KA5lmFQ1FDrlE0NuK4aQ23WbMQ0u3hCKuB48lx/pGk19wsZ?= =?utf-8?q?3yrqgedWRUxXKBt7jNjQlAWbt43UGFwQLuTFy9eogIOcLq3Vsl9bYbCHMXx+cdRcy?= =?utf-8?q?SZox4srdY9tUTWThnUIWiv8vnks+T+r5HPxGlN7h9vKOxUOE51Pjnks2YMsiyqNmt?= =?utf-8?q?w1i5Vx+IJyJsVuvAJB+qPIuVtoNJOX0PEMmx9WPEtYmsfVmVTcrPUbmTXm7NWFqhl?= =?utf-8?q?goso/iL53/0ED6/m+zZzwCwmEHsR+HJEAIQkhufJimNMxZyIQo2RIH635UlfAF/VE?= =?utf-8?q?EW/o8xTKfEZomihFJ0AX4BSCH4MXEktlsklNLEG91QFFC7sQbKv+0vFgVCNL9fAk1?= =?utf-8?q?Ib8Pg3I+13p3KycL/kOq5LA8gIHjHLcs+kn6h6Q62J+nxlETodGWLqtr8+n56Cu3l?= =?utf-8?q?R0esf6c//4EHpTn+QP01OqkNEHFa0P6V2AMjQesW98EDRAhSgX+pUL7mN4hU3dHLw?= =?utf-8?q?p31CAryAP60K4wvvxNacD/AVNy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Tenant-Network-Message-Id: 10814b3f-a0ec-4c9f-2433-08dbb5ca18d1 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 08:59:40.8235 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tLeGQS+iyla38rgdWStBsVaFLbzvy5ZTM9JFQ+B6dPJEI+9Nckyks3XSsp4bKIw6mXN8TZRWaIm2RKIe+QTV0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8530 X-Spam-Status: No, score=-3026.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777093466686111393 X-GMAIL-MSGID: 1777093466686111393 Apparently from its introduction the variable was only ever written (the only read is merely to determine whether to write it with another value). (Since, due to the need to re-indent, the adjacent lines setting cpu_arch_tune need touching anyway, switch to using PREOCESSOR_* constants where applicable, to make more obvious what the resulting state is going to be.) --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -816,9 +816,6 @@ static int cpu_arch_tune_set = 0; /* Cpu we are generating instructions for. */ enum processor_type cpu_arch_tune = PROCESSOR_UNKNOWN; -/* CPU feature flags of cpu we are generating instructions for. */ -static i386_cpu_flags cpu_arch_tune_flags; - /* CPU instruction set architecture used. */ enum processor_type cpu_arch_isa = PROCESSOR_UNKNOWN; @@ -2955,10 +2952,7 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED cpu_arch_isa = PROCESSOR_UNKNOWN; cpu_arch_isa_flags = cpu_arch[flag_code == CODE_64BIT].enable; if (!cpu_arch_tune_set) - { - cpu_arch_tune = cpu_arch_isa; - cpu_arch_tune_flags = cpu_arch_isa_flags; - } + cpu_arch_tune = PROCESSOR_UNKNOWN; vector_size = VSZ_DEFAULT; @@ -3000,10 +2994,7 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED cpu_arch_isa = cpu_arch[j].type; cpu_arch_isa_flags = cpu_arch[j].enable; if (!cpu_arch_tune_set) - { - cpu_arch_tune = cpu_arch_isa; - cpu_arch_tune_flags = cpu_arch_isa_flags; - } + cpu_arch_tune = cpu_arch_isa; vector_size = VSZ_DEFAULT; @@ -14597,10 +14588,7 @@ md_parse_option (int c, const char *arg) cpu_arch_isa = cpu_arch[j].type; cpu_arch_isa_flags = cpu_arch[j].enable; if (!cpu_arch_tune_set) - { - cpu_arch_tune = cpu_arch_isa; - cpu_arch_tune_flags = cpu_arch_isa_flags; - } + cpu_arch_tune = cpu_arch_isa; vector_size = VSZ_DEFAULT; break; } @@ -14678,7 +14666,6 @@ md_parse_option (int c, const char *arg) { cpu_arch_tune_set = 1; cpu_arch_tune = cpu_arch [j].type; - cpu_arch_tune_flags = cpu_arch[j].enable; break; } } @@ -15284,10 +15271,7 @@ i386_target_format (void) cpu_arch_isa = PROCESSOR_IAMCU; cpu_arch_isa_flags = iamcu_flags; if (!cpu_arch_tune_set) - { - cpu_arch_tune = cpu_arch_isa; - cpu_arch_tune_flags = cpu_arch_isa_flags; - } + cpu_arch_tune = PROCESSOR_IAMCU; } else if (cpu_arch_isa != PROCESSOR_IAMCU) as_fatal (_("Intel MCU doesn't support `%s' architecture"), @@ -15298,8 +15282,6 @@ i386_target_format (void) if (cpu_flags_all_zero (&cpu_arch_isa_flags)) cpu_arch_isa_flags = cpu_arch[flag_code == CODE_64BIT].enable; - if (cpu_flags_all_zero (&cpu_arch_tune_flags)) - cpu_arch_tune_flags = cpu_arch[flag_code == CODE_64BIT].enable; switch (OUTPUT_FLAVOR) { From patchwork Fri Sep 15 09:00:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 140264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp902974vqi; Fri, 15 Sep 2023 02:00:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8g5cCAiF5p6lj3C3GT6ksoWA3+g8bJT8gN/ArOsYX4a22nhm2PacSYxY/L7nqjwdKHyex X-Received: by 2002:a50:ff15:0:b0:522:1d1d:1de8 with SMTP id a21-20020a50ff15000000b005221d1d1de8mr810886edu.2.1694768433858; Fri, 15 Sep 2023 02:00:33 -0700 (PDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dy19-20020a05640231f300b0052a0955f7c6si2981463edb.235.2023.09.15.02.00.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 02:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Bo5NbESk; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16BBC385773F for ; Fri, 15 Sep 2023 09:00:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16BBC385773F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694768418; bh=mpKuKmAEiKkf+X4OSsWLJ74vVi8rPOEd305uxBpBSz0=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Bo5NbESkvpJHY+3S9wLd2QoBHJQyKBOQ8QZoTtf6Ol66DqiV3XNYJl76hBuubOrCR TEvFubsX5qmKa3aZV1vb0j5bxaX1Jv6zn/pYIr4qXuNVR6EWQQ6pTfyVIhGQuozO3z uV7l5LbE+7MTyc3d73QWLSkNWM7btgC40f/W/DKg= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2043.outbound.protection.outlook.com [40.107.22.43]) by sourceware.org (Postfix) with ESMTPS id C467B385770B for ; Fri, 15 Sep 2023 09:00:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C467B385770B ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S9Jm8O0MEqAvrYOunKAY5g7H0juylga9qr21vA2mGiPpwhQ7iyZvak/Cmv3CsCyjOcBDXAo7LsKaE21BuqJg7TnXTm487ciwN/xKGzLfjxr1bZX+DXktc2OClNmz2oSzAYowE8saeFP8Z+Ijd8yFjwzWf1nplxaTlf8DFA1LQAI5pACgvHvhQZCpkyXSlgoRgKXp9EpaglIeReIvJRTM9bdowU0oHr4N9JFTuOzo4d6xGDqw5KmxT3nqsvrLDbkKFvfAlxU8WDBdkbRV4CqERcq+VYnGBE8bxG0Jaxl52/dXoFr9Rep0Ssd6zcyprYXYpjVifaj38m0kYm973U7zsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mpKuKmAEiKkf+X4OSsWLJ74vVi8rPOEd305uxBpBSz0=; b=mgrMLsrlzyfTEsOYLPsoxqJVEmJLk07LNup/HgtUu4PpbseHp5a6BSIU9eOiMUu4RqVk0Ndeam3S+AVH6+m/lTVs5Kyx74Ooj5A/UBSSEwiTK6MM+XWCVbOr4cykWouwbRJgQVsbGQRcvpaOlCc7UY+ut1cX5B2yjbaYP3tq5Oc+sRNjfdQsEwYBJcZFYc1DLnAqsnqpyu/n41uoqZYYflcT6wg9eIe6VHfLe+mrUo+MKbKOSGhKG+BXVz9UJnYNXE6txpG25S9+xtXHjJneXVoBb7am0nf8xScgOUrzygaFY4vCVODv8Gim4NcWudyylIjE8Xf3qJPFlwIOH98UuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by AS8PR04MB8530.eurprd04.prod.outlook.com (2603:10a6:20b:421::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Fri, 15 Sep 2023 09:00:04 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654%6]) with mapi id 15.20.6792.020; Fri, 15 Sep 2023 09:00:03 +0000 Message-ID: <578aa052-2850-1eaf-1b43-6464ee8e766a@suse.com> Date: Fri, 15 Sep 2023 11:00:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: [PATCH 3/3] x86: prefer VEX encodings over EVEX ones when possible Content-Language: en-US To: Binutils Cc: "H.J. Lu" References: <8d21b532-7a4a-da25-3e95-d1aea76f75a3@suse.com> In-Reply-To: <8d21b532-7a4a-da25-3e95-d1aea76f75a3@suse.com> X-ClientProxiedBy: FR0P281CA0153.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b3::12) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8530:EE_ X-MS-Office365-Filtering-Correlation-Id: 87dc5ad1-b2a7-45c9-f1f1-08dbb5ca2691 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ip9JzrnXoIx3jhdBM1+JFpiZV8/xBPf/hShvo9qlx8OwxDKOlqn0+qzo/py6TLtgJbuRbMr7irTqsvIo3AKfOL2JtNMPZcmhKMaWor4rFlt/gM/+tcmu5ES6gKM4zcL41UMk9hh1H4dRSElOnEN9nKeJjMOoQ+09z0ztDzSkkJEgYmr9yJzAso6CtTD0kStiXYLe0SunJmj8CVofCuM/7Yvt02y1RY01cEMkwxStXh1HotIqKa29TcJv9+zXXr/rd8fWczvHgHuMpjCJKlCEwtq+iCfqwyYmITLnqIuYH2YJehGdYVXdxAp5ZzUWyTQjWarJ4QuNyQYEzwXoTQBjiy0YcLnNBXOrsSTdbTTm0CGx0lMS4qppsX10NfeQ+S5MgoPhFcweFm3CjEKOIdsCjtRcGAMYm2MipJVhcYHvU+d+tt4lhCNEEhVcDr2Bks4sFfzEtlhx3KRkka/lG90nNLfXLk8v6R5uTcG+koZt/gct3PiVeajS6mMjXLejBK2zBg/KUUYoigEXSWM41/Jaf0xWGtT9THAM7wi4JDf15s5dQShXPnyPpLnY0VBqbcidCoYAvJbzLt3UK35K4YcTtuTuoRoJtT6NcfVekMMYkO1/wXjTgXLRt6kPFwGHMu354Q3sc3vbvX/9M+yytE9S6A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8790.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(136003)(376002)(366004)(346002)(39860400002)(451199024)(1800799009)(186009)(6506007)(6486002)(6512007)(2906002)(26005)(30864003)(66556008)(5660300002)(38100700002)(36756003)(66476007)(66946007)(4326008)(6916009)(316002)(41300700001)(8936002)(8676002)(2616005)(478600001)(31686004)(86362001)(31696002)(83380400001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6NB+1Ytw5grDHbT2xzFbphkFT+OR?= =?utf-8?q?Wx7H3UmcexqeGEo1JMt4fpnfo0lMZ7S1rVO5PsdTdSm1YXEP1DYh5Sg7wQbF1bsl+?= =?utf-8?q?NuI+MJy61FXd4OdBcmuNkkeeysm/4wVpr2YCGMJ6PFNywykqTdrAyR9+IAL9AfI/6?= =?utf-8?q?sfaF2p6VQDnQWK7Dg6SKhlMkAKTpEuc+E4Fs9ul+FnE/BW3zbPcVsJo+/rj0YuPDd?= =?utf-8?q?+ROlg5JMZf+PlGlMeIXKfh1oy5vFsVWRx4YWfP3u2K3Bqs/oV0kGLyD4l0d/K60tX?= =?utf-8?q?pyBWxj7Q0PFUQHOA7fBn+VSsrMnUwEHUb879HvSj7AC3Fsg0v7zlOP79iZcdTzn1z?= =?utf-8?q?lkRQFLYdwCrec1vgG5lZ09KAgXJERVrbuSnG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6rruRXwK/O3y3BCLj6CKhs?= =?utf-8?q?x9ZmAFimARZzCsF575pxLxMARp0FDqFby9rZoV1GB5pbfIZowhK9mtRBsxQBIzUYp?= =?utf-8?q?QiBGS7drZDC31eyI0//+4EzO1k2yk+D/bOgSB6AXYdyY2fAZVbPuF41Q2e5dl96no?= =?utf-8?q?j7pCfxrMRJv1ixLyUAhY/zvAKFMKF/cZpRCsRaNn8FBpW0KAbBepflvHiNgFw5z3S?= =?utf-8?q?j9aijsPtmX6gCDXX6qhK/gwSai7qfYe30zgCOImZv+r8CwOyvLrJchAn8RW3k+fUf?= =?utf-8?q?TCzdSUqqgz+n?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87dc5ad1-b2a7-45c9-f1f1-08dbb5ca2691 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 09:00:03.9388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AClgcEsWWPLs67v4qqqHAADG/yGTYRPdATTxYc6xQsavZHgqads7RH188A+3Uufs7kC1wcJMShP7lUwaV/x0lA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8530 X-Spam-Status: No, score=-3026.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777093505248701291 X-GMAIL-MSGID: 1777093505248701291 AVX-* features / insns paralleling earlier introduced AVX512* ones can be encoded more compactly when the respective feature was explicitly enabled by the user. --- TBD: The non-xy forms of vcvtneps2bf16 don't fit the pattern, for having several more variants. --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -255,6 +255,7 @@ enum i386_error no_default_mask, unsupported_rc_sae, invalid_register_operand, + internal_error, }; struct _i386_insn @@ -5359,6 +5360,9 @@ md_assemble (char *line) case invalid_register_operand: err_msg = _("invalid register operand"); break; + case internal_error: + err_msg = _("internal error"); + break; } as_bad (_("%s for `%s'"), err_msg, pass1_mnem ? pass1_mnem : insn_name (current_templates->start)); @@ -7447,6 +7451,33 @@ match_template (char mnem_suffix) continue; } + /* Check whether to use the shorter VEX encoding for certain insns where + the EVEX enconding comes first in the table. This requires the respective + AVX-* feature to be explicitly enabled. */ + if (t == current_templates->start + && t->opcode_modifier.disp8memshift + && !t->opcode_modifier.vex + && !need_evex_encoding () + && t + 1 < current_templates->end + && t[1].opcode_modifier.vex) + { + i386_cpu_flags cpu; + unsigned int memshift = i.memshift; + + i.memshift = 0; + cpu = cpu_flags_and (cpu_flags_from_attr (t[1].cpu), cpu_arch_isa_flags); + if (!cpu_flags_all_zero (&cpu) + && (!i.types[0].bitfield.disp8 + || !operand_type_check (i.types[0], disp) + || i.op[0].disps->X_op != O_constant + || fits_in_disp8 (i.op[0].disps->X_add_number))) + { + specific_error = progress (internal_error); + continue; + } + i.memshift = memshift; + } + /* We've found a match; break out of loop. */ break; } --- a/gas/testsuite/gas/i386/avx-ifma-intel.d +++ b/gas/testsuite/gas/i386/avx-ifma-intel.d @@ -32,6 +32,6 @@ Disassembly of section .text: [ ]*[a-f0-9]+:[ ]*c4 e2 f9 b5 c0[ ]*\{vex\} vpmadd52huq xmm0,xmm0,xmm0 [ ]*[a-f0-9]+:[ ]*c4 e2 fd b5 c0[ ]*\{vex\} vpmadd52huq ymm0,ymm0,ymm0 [ ]*[a-f0-9]+:[ ]*c4 e2 f9 b5 c0[ ]*\{vex\} vpmadd52huq xmm0,xmm0,xmm0 -[ ]*[a-f0-9]+:[ ]*62 f2 dd 08 b5 d2[ ]*vpmadd52huq xmm2,xmm4,xmm2 -[ ]*[a-f0-9]+:[ ]*62 f2 dd 28 b5 d2[ ]*vpmadd52huq ymm2,ymm4,ymm2 +[ ]*[a-f0-9]+:[ ]*c4 e2 d9 b5 d2[ ]*\{vex\} vpmadd52huq xmm2,xmm4,xmm2 +[ ]*[a-f0-9]+:[ ]*c4 e2 dd b5 d2[ ]*\{vex\} vpmadd52huq ymm2,ymm4,ymm2 #pass --- a/gas/testsuite/gas/i386/avx-ifma.d +++ b/gas/testsuite/gas/i386/avx-ifma.d @@ -32,6 +32,6 @@ Disassembly of section .text: [ ]*[a-f0-9]+:[ ]*c4 e2 f9 b5 c0[ ]*\{vex\} vpmadd52huq %xmm0,%xmm0,%xmm0 [ ]*[a-f0-9]+:[ ]*c4 e2 fd b5 c0[ ]*\{vex\} vpmadd52huq %ymm0,%ymm0,%ymm0 [ ]*[a-f0-9]+:[ ]*c4 e2 f9 b5 c0[ ]*\{vex\} vpmadd52huq %xmm0,%xmm0,%xmm0 -[ ]*[a-f0-9]+:[ ]*62 f2 dd 08 b5 d2[ ]*vpmadd52huq %xmm2,%xmm4,%xmm2 -[ ]*[a-f0-9]+:[ ]*62 f2 dd 28 b5 d2[ ]*vpmadd52huq %ymm2,%ymm4,%ymm2 +[ ]*[a-f0-9]+:[ ]*c4 e2 d9 b5 d2[ ]*\{vex\} vpmadd52huq %xmm2,%xmm4,%xmm2 +[ ]*[a-f0-9]+:[ ]*c4 e2 dd b5 d2[ ]*\{vex\} vpmadd52huq %ymm2,%ymm4,%ymm2 #pass --- /dev/null +++ b/gas/testsuite/gas/i386/avx-vex.l @@ -0,0 +1,181 @@ +.*: Assembler messages: +.*:15: Error: .* `vpmadd52luq' +.*:21: Error: .* `vcvtneps2bf16y' +.*:15: Error: .* `vpmadd52luq' +.*:21: Error: .* `vcvtneps2bf16y' +#... +[ ]*[0-9]+[ ]+\.irp isa, default, .* +#... +[ ]*[0-9]+[ ]+\.endr +#... +[ ]*[0-9]+[ ]+> \.arch default +[ ]*[0-9]+[ ]+> \.arch default +[ ]*[0-9]+[ ]+> * +[ ]*[0-9]+[ ]+\?\?\?\? 62F27528 > vpdpbusd %ymm0,%ymm1,%ymm2 +[ ]*[0-9]+[ ]+50D0 +[ ]*[0-9]+[ ]+\?\?\?\? 62F27528 > vpdpbusd 0x20\(%eax\),%ymm1,%ymm2 +[ ]*[0-9]+[ ]+505001 +[ ]*[0-9]+[ ]+\?\?\?\? 62F27528 > vpdpbusd 0x100\(%eax\),%ymm1,%ymm2 +[ ]*[0-9]+[ ]+505008 +[ ]*[0-9]+[ ]+> * +[ ]*[0-9]+[ ]+\?\?\?\? 62F2F528 > vpmadd52luq %ymm0,%ymm1,%ymm2 +[ ]*[0-9]+[ ]+B4D0 +[ ]*[0-9]+[ ]+\?\?\?\? 62F2F528 > vpmadd52luq 0x20\(%eax\),%ymm1,%ymm2 +[ ]*[0-9]+[ ]+B45001 +[ ]*[0-9]+[ ]+\?\?\?\? 62F2F528 > vpmadd52luq 0x100\(%eax\),%ymm1,%ymm2 +[ ]*[0-9]+[ ]+B45008 +[ ]*[0-9]+[ ]+\?\?\?\? 62F2F538 > vpmadd52luq \(%eax\)\{1to4\},%ymm1,%ymm2 +[ ]*[0-9]+[ ]+B410 +[ ]*[0-9]+[ ]+> * +[ ]*[0-9]+[ ]+>.* +[ ]*[0-9]+[ ]+\?\?\?\? 62F27E28 > vcvtneps2bf16y %ymm0,%xmm1 +[ ]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\),%xmm1 +[ ]*[0-9]+[ ]+4820 +[ ]*[0-9]+[ ]+\?\?\?\? 62F27E28 > vcvtneps2bf16y 0x100\(%eax\),%xmm1 +[ ]*[0-9]+[ ]+724808 +[ ]*[0-9]+[ ]+\?\?\?\? 62F27E38 > vcvtneps2bf16y \(%eax\)\{1to8\},%xmm1 +[ ]*[0-9]+[ ]+7208 +#pass --- /dev/null +++ b/gas/testsuite/gas/i386/avx-vex.s @@ -0,0 +1,23 @@ + .text + + .irp isa, default, .noavx512vl, .noavx512f, .avx_vnni, .avx_ifma, .avx_ne_convert + + .arch default + .arch \isa + + vpdpbusd %ymm0, %ymm1, %ymm2 + vpdpbusd 0x20(%eax), %ymm1, %ymm2 + vpdpbusd 0x100(%eax), %ymm1, %ymm2 + + vpmadd52luq %ymm0, %ymm1, %ymm2 + vpmadd52luq 0x20(%eax), %ymm1, %ymm2 + vpmadd52luq 0x100(%eax), %ymm1, %ymm2 + vpmadd52luq (%eax){1to4}, %ymm1, %ymm2 + +# vcvtneps2bf16 %ymm0, %xmm1 + vcvtneps2bf16y %ymm0, %xmm1 + vcvtneps2bf16y 0x20(%eax), %xmm1 + vcvtneps2bf16y 0x100(%eax), %xmm1 + vcvtneps2bf16y (%eax){1to8}, %xmm1 + + .endr --- a/gas/testsuite/gas/i386/avx-vnni.d +++ b/gas/testsuite/gas/i386/avx-vnni.d @@ -38,6 +38,6 @@ Disassembly of section .text: +[a-f0-9]+: c4 e2 79 50 c0 \{vex\} vpdpbusd %xmm0,%xmm0,%xmm0 +[a-f0-9]+: c4 e2 7d 50 c0 \{vex\} vpdpbusd %ymm0,%ymm0,%ymm0 +[a-f0-9]+: c4 e2 79 50 c0 \{vex\} vpdpbusd %xmm0,%xmm0,%xmm0 - +[a-f0-9]+: 62 f2 5d 08 50 d2 vpdpbusd %xmm2,%xmm4,%xmm2 + +[a-f0-9]+: c4 e2 59 50 d2 \{vex\} vpdpbusd %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 50 91 f0 07 00 00 \{vex\} vpdpbusd 0x7f0\(%ecx\),%xmm4,%xmm2 #pass --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -495,6 +495,7 @@ if [gas_32_check] then { run_list_test "msrlist-inval" run_dump_test "avx-ne-convert" run_dump_test "avx-ne-convert-intel" + run_list_test "avx-vex" "-almn" run_dump_test "raoint" run_dump_test "raoint-intel" run_list_test "amx-complex-inval" --- a/gas/testsuite/gas/i386/x86-64-avx-ifma-intel.d +++ b/gas/testsuite/gas/i386/x86-64-avx-ifma-intel.d @@ -29,6 +29,6 @@ Disassembly of section .text: [ ]*[a-f0-9]+:[ ]*c4 c2 dd b4 d4[ ]*\{vex\} vpmadd52luq ymm2,ymm4,ymm12 [ ]*[a-f0-9]+:[ ]*c4 e2 dd b4 11[ ]*\{vex\} vpmadd52luq ymm2,ymm4,YMMWORD PTR \[rcx\] [ ]*[a-f0-9]+:[ ]*62 b2 dd 28 b4 d6[ ]*vpmadd52luq ymm2,ymm4,ymm22 -[ ]*[a-f0-9]+:[ ]*62 d2 dd 08 b5 d4[ ]*vpmadd52huq xmm2,xmm4,xmm12 -[ ]*[a-f0-9]+:[ ]*62 d2 dd 28 b5 d4[ ]*vpmadd52huq ymm2,ymm4,ymm12 +[ ]*[a-f0-9]+:[ ]*c4 c2 d9 b5 d4[ ]*\{vex\} vpmadd52huq xmm2,xmm4,xmm12 +[ ]*[a-f0-9]+:[ ]*c4 c2 dd b5 d4[ ]*\{vex\} vpmadd52huq ymm2,ymm4,ymm12 #pass --- a/gas/testsuite/gas/i386/x86-64-avx-ifma.d +++ b/gas/testsuite/gas/i386/x86-64-avx-ifma.d @@ -29,6 +29,6 @@ Disassembly of section .text: [ ]*[a-f0-9]+:[ ]*c4 c2 dd b4 d4[ ]*\{vex\} vpmadd52luq %ymm12,%ymm4,%ymm2 [ ]*[a-f0-9]+:[ ]*c4 e2 dd b4 11[ ]*\{vex\} vpmadd52luq \(%rcx\),%ymm4,%ymm2 [ ]*[a-f0-9]+:[ ]*62 b2 dd 28 b4 d6[ ]*vpmadd52luq %ymm22,%ymm4,%ymm2 -[ ]*[a-f0-9]+:[ ]*62 d2 dd 08 b5 d4[ ]*vpmadd52huq %xmm12,%xmm4,%xmm2 -[ ]*[a-f0-9]+:[ ]*62 d2 dd 28 b5 d4[ ]*vpmadd52huq %ymm12,%ymm4,%ymm2 +[ ]*[a-f0-9]+:[ ]*c4 c2 d9 b5 d4[ ]*\{vex\} vpmadd52huq %xmm12,%xmm4,%xmm2 +[ ]*[a-f0-9]+:[ ]*c4 c2 dd b5 d4[ ]*\{vex\} vpmadd52huq %ymm12,%ymm4,%ymm2 #pass --- a/gas/testsuite/gas/i386/x86-64-avx-vnni.d +++ b/gas/testsuite/gas/i386/x86-64-avx-vnni.d @@ -35,6 +35,6 @@ Disassembly of section .text: +[a-f0-9]+: c4 e2 59 53 11 \{vex\} vpdpwssds \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 53 11 \{vex\} vpdpwssds \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: 62 b2 5d 08 53 d6 vpdpwssds %xmm22,%xmm4,%xmm2 - +[a-f0-9]+: 62 d2 5d 08 50 d4 vpdpbusd %xmm12,%xmm4,%xmm2 + +[a-f0-9]+: c4 c2 59 50 d4 \{vex\} vpdpbusd %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 50 91 f0 07 00 00 \{vex\} vpdpbusd 0x7f0\(%rcx\),%xmm4,%xmm2 #pass