From patchwork Mon Mar 25 10:08:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 87618 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 478F13858434 for ; Mon, 25 Mar 2024 10:08:47 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 183DA3858410 for ; Mon, 25 Mar 2024 10:08:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 183DA3858410 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 183DA3858410 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::532 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711361293; cv=none; b=hjeJwEK/nWwnNhMXUqyPMmnjPL521poN3h1PxMUlB5agcThwxNuzCJnfiqN+FrYk8zjIkbU3r9gsuYywwTbK7a16j325bwXGMc0JMY2mtTpmUqj/gFAW8LCNOQAB85VfLHgYKFVeztmW4dIXeoeBqEBDEriItp+tYzFvhs0kY9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711361293; c=relaxed/simple; bh=a8OEU1DBcKwr+5GGA7HlesXiSqrZ9kzDs/FepLZ23iw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=fgt3aNiIE2nQtdQCPwPRTymnlgpeYFWzKgb0aGLSLpgEF7gCGrNIA16PTN2L1m3INepSCDXhzP5ChDcZp4GPBI01tlpcjhr+ZK7K7wvB50vbd3DSmaT9MFaSEraHAAg7mm9W5qzL3EY8tcE72uPryk7VbnMsZnyDLBm1BYdTpOk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-56c0bd07e7bso836331a12.1 for ; Mon, 25 Mar 2024 03:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1711361288; x=1711966088; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=lNmCbNd6hXjoCfVodDB8ACCNUqh/GZgKrD/KdT/hU/Q=; b=M6hMBh5R9pni9zDwbL87PqlJmeM+NLmXoonp0XFCUPKgH4BN1PxQS5x5qrIJj3jjts +Kn28yJkwsfyJyRL+Zdv9Ku0Et4xdwFH9Kzry5AcUOJ2qxnpFD7hl7dzh4i5lKiQerVR GZZE5GiGhBFTEcfwwrsHZnYof/UU+kfWfwAhAvmoycVgBdFz/EnGr3cmx7hZNxQFJtef MPBMAwgSUYFb7H/1P552iLjigiOghZqgkG+COnu2eZ0aDrXhBZMd1wU8Sj3rWlHOgQYw pIhPGUEHCe9B+bvRThc64nOLN6bO7CWQW6dDp5njaGYXg3e5lUMp3MALx2bYL+pLUzB8 2YNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711361288; x=1711966088; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lNmCbNd6hXjoCfVodDB8ACCNUqh/GZgKrD/KdT/hU/Q=; b=VaQWe1V3DQOXQ9miBYBOi3eDyWDYWCLpJ7G7x0UtkHrRIQqE6Tyu5c0VRdnYXT3yu2 MyvLTirQh9bEppyxcRa9yisvi7DH05rGevppD9pw+CIXQwk/hOrdoNzjGTx26W9YUeBy Vt0FJe4OdZt5REWVtNy5RL1JeWrSgmv9UDqgyWWLgpOiHeK6Aj99JWzNFFn/60g7xYlh 2qV0hxVi2rc4UQAYXfDbNd7EwRAYnpxVCMIj2Cj/Tawj1jeu51nzfiLvkSixlIhRbzDE O+wPFtqHwXeyTKnd9dyBzicBIgOAdLldE4b80B2TPb25UTlO0CbLmL7MevV0BTf0jI8Z KVxA== X-Gm-Message-State: AOJu0YwAwpZHLnyNfpwdjijCfgdrpMk0zHw+hHcEB0FEM7WKwMwEcGRC Bp+Tl0MBmFKCuSIFCq3t5jQycGEV6oQ6IeQIrP2uDGHzgRHnwV//jm4rL2zGqjW31UtSwbEolcw = X-Google-Smtp-Source: AGHT+IGn43uXpa92FC+3lQ2PeU6k3Hac7oTlbiu0y+TT0gJC9JeURqi8JrghyONd/k7iEvkDBFTtLw== X-Received: by 2002:a17:906:f1ca:b0:a4d:8f17:44db with SMTP id gx10-20020a170906f1ca00b00a4d8f1744dbmr121769ejb.31.1711361287889; Mon, 25 Mar 2024 03:08:07 -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 bh9-20020a170906a0c900b00a461b1e814asm2873248ejb.130.2024.03.25.03.08.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Mar 2024 03:08:07 -0700 (PDT) Message-ID: Date: Mon, 25 Mar 2024 11:08:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 2/7] x86: templatize unary ALU insns Content-Language: en-US From: Jan Beulich To: Binutils Cc: "H.J. Lu" , Lili Cui References: <3c3a57fd-9493-4405-97b9-2b306fdcd7d1@suse.com> Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR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ujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <3c3a57fd-9493-4405-97b9-2b306fdcd7d1@suse.com> X-Spam-Status: No, score=-3025.2 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: 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: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org With the multitude of new APX templates, it finally becomes desirable to further remove redundancy by also templatizing basic arithmetic insns. Continue with a few simple unary (single source) cases. --- a/opcodes/i386-opc.tbl +++ b/opcodes/i386-opc.tbl @@ -385,11 +385,12 @@ adc, 0x80/2, 0, W|Modrm|No_sSuf|HLEPrefi -neg, 0xf6/3, APX_F, W|Modrm|CheckOperandSize|No_sSuf|DstVVVV|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } -neg, 0xf6/3, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + -not, 0xf6/2, APX_F, W|Modrm|CheckOperandSize|No_sSuf|DstVVVV|EVexMap4, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } -not, 0xf6/2, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } +, 0xf6/, APX_F, W|Modrm|CheckOperandSize|No_sSuf|DstVVVV|EVexMap4|, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } +, 0xf6/, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + + aaa, 0x37, No64, NoSuf, {} aas, 0x3f, No64, NoSuf, {} @@ -420,8 +421,9 @@ cqto, 0x99, x64, Size64|NoSuf, {} // expanding 64-bit multiplies, and *cannot* be selected to accomplish // 'imul %ebx, %eax' (opcode 0x0faf must be used in this case) // These multiplies can only be selected with single operand forms. -mul, 0xf6/4, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -imul, 0xf6/5, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + + +, 0xf6/, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } imul, 0xaf, APX_F, C|Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } imul, 0xfaf, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } imul, 0x6b, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } @@ -432,10 +434,14 @@ imul, 0x69, i186, Modrm|CheckOperandSize imul, 0x6b, i186, Modrm|No_bSuf|No_sSuf|RegKludge, { Imm8S, Reg16|Reg32|Reg64 } imul, 0x69, i186, Modrm|No_bSuf|No_sSuf|RegKludge, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64 } -div, 0xf6/6, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -div, 0xf6/6, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } -idiv, 0xf6/7, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -idiv, 0xf6/7, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } + + + + +
, 0xf6/, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } +
, 0xf6/, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } + +
rol, 0xd0/0, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|NF, { Imm1, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } rol, 0xd0/0, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex }