Message ID | 20230919152527.497773-1-lili.cui@intel.com |
---|---|
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3472722vqi; Tue, 19 Sep 2023 08:25:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxj34BiK5OPaYTVukEpqqs2c7CVnLvdl9GNQMMeGuhFdff/4lqIfi9qateHtKGJ8RyZTkD X-Received: by 2002:a17:907:7842:b0:9ad:a59f:331a with SMTP id lb2-20020a170907784200b009ada59f331amr11147339ejc.57.1695137148999; Tue, 19 Sep 2023 08:25:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695137148; cv=none; d=google.com; s=arc-20160816; b=E/K7DAAnf+Om5lOq9pI0N0LXnzuEp0XFjZ5MwlvlWAOG+62tlOBdMyA10s5eZC7JCS 5CZif5tZNOuSbGT1C5M3Olb9rPpOXKt5CZGvQn7Ul/l91xBMJYJrhu5gXTRBbTXBRRFY lCPoMRuyG+yGUyh1N+MMNtY/sNTzr/wr8g8xNPatVRTMCA/k2lI0dmrxM8e+rszYZWdC hQMwNfKSTKuJFX8WTiuj8ndX19UhlKwOZXco9mnP2AmoEhIkwsG2slEA0i0GahPTcR5q 41Kc802+G9Vnp6fen52cjSUbQLi62DlynEDasBw8YUbZnc6OWvaXgSP+R9oPk0LC2AIf l32g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=W67GsPaoPOS8croxoCypntbOWZsU0EUx8sq3oU0IeXw=; fh=ohjlW8amWAkl3RFBwC5ojAZtif/RVDQZdYLiyUWJyq8=; b=Fej8bIoDM/J6YlxO4ThFVqVAnWbbU1pJ724tF1S4k2xVAbQ2eCroz0t+AMsYa+peeE sMXxSereXcuPePgiH6Idl0iAx9978YebMPHFH1K3qLZvnC91xcsIw+3JkXYzHa7ukRIp MPVvUX+vuJsNc5aJYVALseL6q0TI7NHxSXg3tcHc/1TXxk0aQzvg0cKRBjIlm4fm1NRM JNupmeyDiweP9PZ7KLFFSvMZBNERYPl3NHYGRXtDE3tCRcBFMYBA+N4bzKcSo8+h3HtD SRJLe776tEb5xQkXeIn1axw7Pz8B0u2eSvgzlj/bICznwiRmZtpZkx8PtHO5e3pDkdy1 3qbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=W8lTURXf; 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e7-20020a1709067e0700b00993181656b0si606427ejr.475.2023.09.19.08.25.48 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 08:25:48 -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=W8lTURXf; 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 37DC83856DDA for <ouuuleilei@gmail.com>; Tue, 19 Sep 2023 15:25:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37DC83856DDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1695137146; bh=W67GsPaoPOS8croxoCypntbOWZsU0EUx8sq3oU0IeXw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=W8lTURXfDqHtJcio5Yp9vbzuMv4X/JubTB7b8PJYZGfmjapo1uXi08hRNFtCMGrlm 4XXEfpJobYX1sNGk55DG5J/Gy4bMwsI8as6VeYw1Igw61wACNBprF/jwtYoUoVXXJC oAdVkm2bK0ixmUQ5WEbLCh1ygEDNn2fdoau/nLqQ= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by sourceware.org (Postfix) with ESMTPS id D905B3858C2B for <binutils@sourceware.org>; Tue, 19 Sep 2023 15:25:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D905B3858C2B X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="370285635" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="370285635" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 08:25:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="739758902" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="739758902" Received: from scymds03.sc.intel.com ([10.148.94.166]) by orsmga007.jf.intel.com with ESMTP; 19 Sep 2023 08:25:29 -0700 Received: from shgcc101.sh.intel.com (shgcc101.sh.intel.com [10.239.85.97]) by scymds03.sc.intel.com (Postfix) with ESMTP id 7D3666A; Tue, 19 Sep 2023 08:25:28 -0700 (PDT) To: binutils@sourceware.org Cc: jbeulich@suse.com, hongjiu.lu@intel.com Subject: [PATCH 0/8] [RFC] Support Intel APX EGPR Date: Tue, 19 Sep 2023 15:25:19 +0000 Message-Id: <20230919152527.497773-1-lili.cui@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: "Cui, Lili via Binutils" <binutils@sourceware.org> Reply-To: "Cui, Lili" <lili.cui@intel.com> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777470765121737059 X-GMAIL-MSGID: 1777480131382892396 |
Series |
Support Intel APX EGPR
|
|
Message
Frager, Neal via Binutils
Sept. 19, 2023, 3:25 p.m. UTC
Resent for some patches larger than the threshold cannot be sent. Intel Advanced performance extension (APX) has been released in https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html. It contains several extensions such as 1. Support APX GPR32 with rex2 prefix (For MAP0 an MAP1 legacy instructions). 2. Support APX GPR32 with extend evex prefix(legacy, VEX and EVEX extend to EVEX prefix to support GPR32). 3. Support APX NDD (non-destructive destination) and it's optimized encoding. 4. Support APX Push2/Pop2 5. Support APX NF 6. Support APX JMPABS 7. Linker support for APX encoded instructions. 8. Support APX ZU 9. Support APX CCMP and CTEST Here is an introduction to the implementation of the first two patches in Binutils 1. APX uses the REX2 prefix to support EGPR for map0 and map1 of legacy instructions. Only adding the No_egpr flag to the instructions (legacy map0/map1) don't support EGPR (unsupported instructions are less). For map2/map3(legacy), VEX and EVEX, we use gi386-gen.c to add No_egpr. 2. we created new entries in i386-opc.tbl for instructions promoted from the legacy space and VEX. The extended EVEX prefix is based on the current 4-byte EVEX prefix with the semantics of several payload bits re-defined. EVEX extension of legacy instructions: All promoted legacy instructions are placed in EVEX map 4, which is currently reserved. EVEX extension of EVEX instructions: All existing EVEX instructions are extended by APX using the extended EVEX prefix, so that they can access all 32 GPRs. EVEX extension of VEX instructions: Promoting a VEX instruction into the EVEX space does not change the map id, the opcode, or the operand encoding of the VEX instruction. To do list: 1. For REX2, All opcodes listed map0 0x4*/0x7*/0xa* and map0 0x3*/0x8* are reserved under REX2 and triggers #UD when prefixed with REX2. It should be belong to first rex2 patch, I will creat another patch to add it. 2. Support APX ZU -- In progress 3. Support APX CCMP and CTEST -- In progress 4. We haven’t disabled EGPR for 3DNOW instructions. We can disable them if AMD guys requires. This RFC focused on EGPR implementation in binutils. It may still have potential issues or bugs and requires futher optimization. Any comments are very appreciated. Cui, Lili (3): Support APX GPR32 with extend evex prefix Add tests for APX GPR32 with extend evex prefix Support APX NF Hu, Lin1 (2): Support APX NDD optimized encoding. Support APX JMPABS Mo, Zewei (1): Support APX Push2/Pop2 konglin1 (2): Support APX GPR32 with rex2 prefix Support APX NDD gas/NEWS | 3 + gas/config/tc-i386.c | 455 ++++- gas/doc/c-i386.texi | 3 +- gas/testsuite/gas/i386/apx-jmpabs-inval.l | 3 + gas/testsuite/gas/i386/apx-jmpabs-inval.s | 6 + gas/testsuite/gas/i386/apx-mov-inval.l | 2 + gas/testsuite/gas/i386/apx-push2pop2-inval.l | 5 + gas/testsuite/gas/i386/apx-push2pop2-inval.s | 9 + gas/testsuite/gas/i386/i386.exp | 2 + .../i386/ilp32/x86-64-opcode-inval-intel.d | 4 +- .../gas/i386/ilp32/x86-64-opcode-inval.d | 4 +- .../gas/i386/x86-64-apx-egpr-inval.l | 212 +++ .../gas/i386/x86-64-apx-egpr-inval.s | 210 +++ .../gas/i386/x86-64-apx-egpr-promote-inval.l | 17 + .../gas/i386/x86-64-apx-egpr-promote-inval.s | 18 + gas/testsuite/gas/i386/x86-64-apx-evex-egpr.d | 22 + gas/testsuite/gas/i386/x86-64-apx-evex-egpr.s | 25 + .../gas/i386/x86-64-apx-evex-promoted-intel.d | 740 +++++++++ .../gas/i386/x86-64-apx-evex-promoted.d | 740 +++++++++ .../gas/i386/x86-64-apx-evex-promoted.s | 1464 +++++++++++++++++ .../gas/i386/x86-64-apx-jmpabs-intel.d | 14 + .../gas/i386/x86-64-apx-jmpabs-inval.d | 55 + .../gas/i386/x86-64-apx-jmpabs-inval.s | 18 + gas/testsuite/gas/i386/x86-64-apx-jmpabs.d | 14 + gas/testsuite/gas/i386/x86-64-apx-jmpabs.s | 10 + gas/testsuite/gas/i386/x86-64-apx-mov-inval.l | 2 + gas/testsuite/gas/i386/x86-64-apx-mov-inval.s | 5 + .../gas/i386/x86-64-apx-ndd-optimize.d | 120 ++ .../gas/i386/x86-64-apx-ndd-optimize.s | 115 ++ gas/testsuite/gas/i386/x86-64-apx-ndd.d | 165 ++ gas/testsuite/gas/i386/x86-64-apx-ndd.s | 156 ++ gas/testsuite/gas/i386/x86-64-apx-nf-intel.d | 633 +++++++ gas/testsuite/gas/i386/x86-64-apx-nf.d | 633 +++++++ gas/testsuite/gas/i386/x86-64-apx-nf.s | 1256 ++++++++++++++ .../i386/x86-64-apx-push2pop2-decode-inval.d | 29 + .../i386/x86-64-apx-push2pop2-decode-inval.s | 19 + .../gas/i386/x86-64-apx-push2pop2-intel.d | 42 + .../gas/i386/x86-64-apx-push2pop2-inval.l | 9 + .../gas/i386/x86-64-apx-push2pop2-inval.s | 13 + gas/testsuite/gas/i386/x86-64-apx-push2pop2.d | 42 + gas/testsuite/gas/i386/x86-64-apx-push2pop2.s | 39 + .../gas/i386/x86-64-apx-rex2-inval.d | 29 + .../gas/i386/x86-64-apx-rex2-inval.s | 25 + gas/testsuite/gas/i386/x86-64-apx-rex2.d | 148 ++ gas/testsuite/gas/i386/x86-64-apx-rex2.s | 175 ++ gas/testsuite/gas/i386/x86-64-evex.d | 2 +- gas/testsuite/gas/i386/x86-64-inval-movbe.l | 31 +- gas/testsuite/gas/i386/x86-64-inval-movbe.s | 1 + gas/testsuite/gas/i386/x86-64-inval-pseudo.l | 12 + gas/testsuite/gas/i386/x86-64-inval-pseudo.s | 8 + .../gas/i386/x86-64-opcode-inval-intel.d | 4 +- gas/testsuite/gas/i386/x86-64-opcode-inval.d | 4 +- gas/testsuite/gas/i386/x86-64-pseudos.d | 62 + gas/testsuite/gas/i386/x86-64-pseudos.s | 64 + gas/testsuite/gas/i386/x86-64.exp | 19 + include/opcode/i386.h | 2 + opcodes/i386-dis-evex-len.h | 20 + opcodes/i386-dis-evex-mod.h | 60 + opcodes/i386-dis-evex-prefix.h | 91 + opcodes/i386-dis-evex-reg.h | 155 ++ opcodes/i386-dis-evex-w.h | 10 + opcodes/i386-dis-evex-x86.h | 150 ++ opcodes/i386-dis-evex.h | 638 ++++++- opcodes/i386-dis.c | 437 ++++- opcodes/i386-gen.c | 14 + opcodes/i386-opc.h | 26 +- opcodes/i386-opc.tbl | 271 ++- opcodes/i386-reg.tbl | 64 + 68 files changed, 9692 insertions(+), 163 deletions(-) create mode 100644 gas/testsuite/gas/i386/apx-jmpabs-inval.l create mode 100644 gas/testsuite/gas/i386/apx-jmpabs-inval.s create mode 100644 gas/testsuite/gas/i386/apx-mov-inval.l create mode 100644 gas/testsuite/gas/i386/apx-push2pop2-inval.l create mode 100644 gas/testsuite/gas/i386/apx-push2pop2-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-egpr-inval.l create mode 100644 gas/testsuite/gas/i386/x86-64-apx-egpr-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l create mode 100644 gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-evex-egpr.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-evex-egpr.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-jmpabs-intel.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-jmpabs-inval.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-jmpabs-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-jmpabs.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-jmpabs.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-mov-inval.l create mode 100644 gas/testsuite/gas/i386/x86-64-apx-mov-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-ndd-optimize.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-ndd-optimize.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-ndd.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-ndd.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-nf-intel.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-nf.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-nf.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-push2pop2-decode-inval.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-push2pop2-decode-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-push2pop2-intel.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-push2pop2-inval.l create mode 100644 gas/testsuite/gas/i386/x86-64-apx-push2pop2-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-push2pop2.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-push2pop2.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-rex2-inval.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-rex2-inval.s create mode 100644 gas/testsuite/gas/i386/x86-64-apx-rex2.d create mode 100644 gas/testsuite/gas/i386/x86-64-apx-rex2.s create mode 100644 opcodes/i386-dis-evex-x86.h