From nobody Sat Sep 21 04:38:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704923570; cv=none; d=zohomail.com; s=zohoarc; b=C6GFY2Ey8EXqC7f+OF8T93Ym6wv8GMj1NQhcXBRhAztzwRndmS4JyYfPLmrbmaofb3vc8/TJeazJjEy/5lSi2FJhXXs3uauPYtmFH5bKDeL7/Jzr0KFzr7aJEbNfCgvS5zZ3I2voPR1gDhKHq/zxHUQ3ErlIlv00dCKZX6VFbXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704923570; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cc2RPo52FmEiV7m0RK0jR9X26iVBZu5+1nh1fPIm+Uk=; b=DUoK5cFesbQ9Xe+j1TGng65EmX2xkPkQveBacNBi2MpirctlgaaXgMMBXQf52nOZ3/i01bu9qYuXXx7uAmYsq+Y14EgTz04mLcemfSGbEOMiIJb1rd2aE1Piv04Km8pDnz//VtL1ZJTdqvw822reKhwfcomd7VKmXVSkwbStrW0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704923570037111.3394493963616; Wed, 10 Jan 2024 13:52:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNgUm-0003Zs-SZ; Wed, 10 Jan 2024 16:52:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNgUk-0003Z8-U7 for qemu-devel@nongnu.org; Wed, 10 Jan 2024 16:52:18 -0500 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNgUj-0005do-3E for qemu-devel@nongnu.org; Wed, 10 Jan 2024 16:52:18 -0500 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7831ed13d39so347692385a.0 for ; Wed, 10 Jan 2024 13:52:16 -0800 (PST) Received: from stoup.. ([172.58.27.160]) by smtp.gmail.com with ESMTPSA id z8-20020ae9c108000000b0078313c87609sm1888387qki.100.2024.01.10.13.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 13:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704923536; x=1705528336; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cc2RPo52FmEiV7m0RK0jR9X26iVBZu5+1nh1fPIm+Uk=; b=fokUvWvk2xld39RpsmFlisSwNN4F+LmUGPj2vhC/+WlJD6PVOXuC7vfrZT7oX0MoE8 xiDrLN8BzDUNYAGRDuewB2R3r4vDVquJyHlIGpoQNF+yhN6UpDo5QoLfRXt6zgBdpJLj E/mHloBvePojQeEIMs3M5NYaasObM75c/CQ7tZDZSnqqEX0vd+UcuocmuOH8bHZiFo7s ESPfDVQIwP1XLVUKzhdfilaLbAHLbtm8zTUT2YTbTwyqqhPIpaeOkmN1LNKWHc+KzV5L P97iByWa5SqWlQC/H3Sp2JVt8qC0GNeZck1C5nDIdqKQf1UL8xDxCx4pgRyd/jpB8mVl 2q3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704923536; x=1705528336; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cc2RPo52FmEiV7m0RK0jR9X26iVBZu5+1nh1fPIm+Uk=; b=BTe5iS2TWsRUIs2t5i53xC5z3fWhkRErLMd6kcvVl5Su2et1CS+yaFhmp7Yha/l2Q9 pBaTcM8G55L3UtLb42zllqDkVmxg0kC4HCvy0aZi1kEgboNLaeBf0ejA/5X3eX+xSZQg CYIDRo4kaos3jIDFKaBjdDZSP9VTcVLZmP6mDjXaqSTNe0dQNIXwUjewCzKj45uvpR95 84SBTUIKvNUXqifvvNioR4fJ20skWLGB0XEs86TOX/9h+6oGQi9IBJYx/YtVXj52fHmb sy2Xg+fTMlzYbIgP+8Nmx5aCGz+X3ff+B+uLgcZozWVhvnE/pK5LEbdV8NnKTZB1KJ3A oOQA== X-Gm-Message-State: AOJu0YyefAj9ZqeVZ/qNypVZAzMcOmrJvescEWoHeoQmr7xowp9VwuM5 7InOC9MuodfOVxL8B/mY0MaEmUVWgkd/z1g4frjiDCYBUOE0zhd1 X-Google-Smtp-Source: AGHT+IFQuy3k+nEPduIywR1jiEuPyjLb5l1EmGhVebDDyee5uI5h0kGBdl9HybmPOnY3mjiiC9Dwyw== X-Received: by 2002:a05:620a:288d:b0:781:5e3a:a85f with SMTP id j13-20020a05620a288d00b007815e3aa85fmr374385qkp.17.1704923535987; Wed, 10 Jan 2024 13:52:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Paolo Bonzini Subject: [PULL 1/4] tcg/i386: convert add/sub of 128 to sub/add of -128 Date: Thu, 11 Jan 2024 08:52:01 +1100 Message-Id: <20240110215204.9353-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240110215204.9353-1-richard.henderson@linaro.org> References: <20240110215204.9353-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x733.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704923570926100003 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Extend the existing conditional that generates INC/DEC, to also swap an ADD for a SUB and vice versa when the immediate is 128. This facilitates using OPC_ARITH_EvIb instead of OPC_ARITH_EvIz. Signed-off-by: Paolo Bonzini Message-Id: <20231228120514.70205-1-pbonzini@redhat.com> [rth: Use a switch on C] Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 49 +++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index a83f8aab30..29e80af78b 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1316,23 +1316,41 @@ static void tgen_arithi(TCGContext *s, int c, int r= 0, c &=3D 7; } =20 - /* ??? While INC is 2 bytes shorter than ADDL $1, they also induce - partial flags update stalls on Pentium4 and are not recommended - by current Intel optimization manuals. */ - if (!cf && (c =3D=3D ARITH_ADD || c =3D=3D ARITH_SUB) && (val =3D=3D 1= || val =3D=3D -1)) { - int is_inc =3D (c =3D=3D ARITH_ADD) ^ (val < 0); - if (TCG_TARGET_REG_BITS =3D=3D 64) { - /* The single-byte increment encodings are re-tasked as the - REX prefixes. Use the MODRM encoding. */ - tcg_out_modrm(s, OPC_GRP5 + rexw, - (is_inc ? EXT5_INC_Ev : EXT5_DEC_Ev), r0); - } else { - tcg_out8(s, (is_inc ? OPC_INC_r32 : OPC_DEC_r32) + r0); + switch (c) { + case ARITH_ADD: + case ARITH_SUB: + if (!cf) { + /* + * ??? While INC is 2 bytes shorter than ADDL $1, they also in= duce + * partial flags update stalls on Pentium4 and are not recomme= nded + * by current Intel optimization manuals. + */ + if (val =3D=3D 1 || val =3D=3D -1) { + int is_inc =3D (c =3D=3D ARITH_ADD) ^ (val < 0); + if (TCG_TARGET_REG_BITS =3D=3D 64) { + /* + * The single-byte increment encodings are re-tasked + * as the REX prefixes. Use the MODRM encoding. + */ + tcg_out_modrm(s, OPC_GRP5 + rexw, + (is_inc ? EXT5_INC_Ev : EXT5_DEC_Ev), r0= ); + } else { + tcg_out8(s, (is_inc ? OPC_INC_r32 : OPC_DEC_r32) + r0); + } + return; + } + if (val =3D=3D 128) { + /* + * Facilitate using an 8-bit immediate. Carry is inverted + * by this transformation, so do it only if cf =3D=3D 0. + */ + c ^=3D ARITH_ADD ^ ARITH_SUB; + val =3D -128; + } } - return; - } + break; =20 - if (c =3D=3D ARITH_AND) { + case ARITH_AND: if (TCG_TARGET_REG_BITS =3D=3D 64) { if (val =3D=3D 0xffffffffu) { tcg_out_ext32u(s, r0, r0); @@ -1351,6 +1369,7 @@ static void tgen_arithi(TCGContext *s, int c, int r0, tcg_out_ext16u(s, r0, r0); return; } + break; } =20 if (val =3D=3D (int8_t)val) { --=20 2.34.1 From nobody Sat Sep 21 04:38:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704923570; cv=none; d=zohomail.com; s=zohoarc; b=oIq9VEeTV++vziC+gZ09ifiKPuegMglcpQWsR17S3cc6zvkQo35UBSA9zy1WyDneMm2Pk7s5agMxdONeygH/qCR3QBzVeYCRUQU2LacZKN48eadDKABh3CZBwfhOe0kbAtLvSccFWVRjSm2dL8t0oUuhpAfOtDbLjyKwghvSlyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704923570; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OBBeoirsyv5/OFQlIRCs3B1+YR9/kciezwI6H7ohodM=; b=nB9RoKymIfVCLZbL55N/zBiJNwDIBZXqDnrcV8X+i8egrEOiJxj1SB0rNMPsgnP44PIZquLFEOc6hTE6ogMVHR19CwAeQ333o0JyfmaUP0RREHYIREcm5oXAB3chT+I7N3ZrNz4S2sDAZmKS0teVANMmZ1cgHOPEaGxeJQ125nE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704923570078801.9654196115557; Wed, 10 Jan 2024 13:52:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNgUp-0003ab-Dd; Wed, 10 Jan 2024 16:52:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNgUn-0003aA-Mk for qemu-devel@nongnu.org; Wed, 10 Jan 2024 16:52:21 -0500 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNgUm-0005fn-3f for qemu-devel@nongnu.org; Wed, 10 Jan 2024 16:52:21 -0500 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-783182d4a09so482344485a.2 for ; Wed, 10 Jan 2024 13:52:19 -0800 (PST) Received: from stoup.. ([172.58.27.160]) by smtp.gmail.com with ESMTPSA id z8-20020ae9c108000000b0078313c87609sm1888387qki.100.2024.01.10.13.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 13:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704923539; x=1705528339; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OBBeoirsyv5/OFQlIRCs3B1+YR9/kciezwI6H7ohodM=; b=jcBFQ2hwa1ZICpmBR0Ac7N8axgc1pbmlbmzb1xdlzIyw4wc2rYQRc2NbREnNJBTeBC Rr/rypm4r+qTwC56tF24s60nhNRXQNWqHrbz4CL56g69MQk21ECfMz8mYIhw6mW2M2qe PrhC4iBgLrcrcPLszVKRVvFT1dBx+Q/kMHfvuEuWnuAXAD3CY4cG625/Y4eawlVBXgPb 77aaurMpKIVZAVaot44BvyZHvaoFY3/S4+P9T2TITghjX2q7PlQNnQ9rduDguZWwsDZt +O9DW0Aw8HDIPVcOHS2X5xs+cQjhNJukmETKYUlKEnQNzTyG3eBJeIuDlgRXXGPTWsL2 xYEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704923539; x=1705528339; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OBBeoirsyv5/OFQlIRCs3B1+YR9/kciezwI6H7ohodM=; b=NLwgo4ulKgjbQFmzSzVlPUZ9PFt2ONlDpj+gzQ55aS1yRwsjl9BkU0WalUXD2KVa3f cxY5NA86/ALUJN9x11Z6IcPgI8k6BSb5biQXQMqXbidxnG4JqwRmTS7kJ2/oIuOucMfW wKVFdSuEnriPiHTqGSfblPU51EY1gw7wjLikpwZU71KXaq01U4MhJPOt0TyznvB6x7na C5WC3VEEDtsTugvLRU664OwwcnZPxs8Wql+pvrq51VtSNAYPAAtRZLrRfO6fG2oh4jVz 5MrUylnHOngUeebH8ClSuhsH1E7lTcJZLh3qRL/FMGDaIMorsyoNxNUldl7TATJAyVgg HnuQ== X-Gm-Message-State: AOJu0YyL3pm0fQ89jn+5hibQLEk6jZXL079uEmDQ5oM6SfjB8wZ7+Ua0 exc58IkKMyWkzT2JQvKkYJrlpJz+jAhMWM/ZyDSvWXLeuP/S8BFS X-Google-Smtp-Source: AGHT+IHFPkixC0BUvPVzLcX2wSjTI9QqI2JpICkO2B1iBDwJISqo3pNd+LXcL42yLKyLYH+qPpo3bQ== X-Received: by 2002:a05:620a:13ed:b0:783:23a1:8b45 with SMTP id h13-20020a05620a13ed00b0078323a18b45mr328613qkl.108.1704923539157; Wed, 10 Jan 2024 13:52:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Paolo Bonzini Subject: [PULL 2/4] tcg/i386: use 8-bit OR or XOR for unsigned 8-bit immediates Date: Thu, 11 Jan 2024 08:52:02 +1100 Message-Id: <20240110215204.9353-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240110215204.9353-1-richard.henderson@linaro.org> References: <20240110215204.9353-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704923570878100001 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini In the case where OR or XOR has an 8-bit immediate between 128 and 255, we can operate on a low-byte register and shorten the output by two or three bytes (two if a prefix byte is needed for REX.B). Signed-off-by: Paolo Bonzini Message-Id: <20231228120524.70239-1-pbonzini@redhat.com> [rth: Incorporate into switch.] Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 29e80af78b..d268199fc1 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -244,6 +244,7 @@ static bool tcg_target_const_match(int64_t val, TCGType= type, int ct, int vece) #define P_VEXL 0x80000 /* Set VEX.L =3D 1 */ #define P_EVEX 0x100000 /* Requires EVEX encoding */ =20 +#define OPC_ARITH_EbIb (0x80) #define OPC_ARITH_EvIz (0x81) #define OPC_ARITH_EvIb (0x83) #define OPC_ARITH_GvEv (0x03) /* ... plus (ARITH_FOO << 3) */ @@ -1370,6 +1371,16 @@ static void tgen_arithi(TCGContext *s, int c, int r0, return; } break; + + case ARITH_OR: + case ARITH_XOR: + if (val >=3D 0x80 && val <=3D 0xff + && (r0 < 4 || TCG_TARGET_REG_BITS =3D=3D 64)) { + tcg_out_modrm(s, OPC_ARITH_EbIb + P_REXB_RM, c, r0); + tcg_out8(s, val); + return; + } + break; } =20 if (val =3D=3D (int8_t)val) { --=20 2.34.1 From nobody Sat Sep 21 04:38:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704923613; cv=none; d=zohomail.com; s=zohoarc; b=kILbalSLz8AIhe2OWb74kVCODfSFC3TkzIDPvT+IvE9/yTfy1PMgfhRUasclYbsUoCs/8Z8sdBzLJCL+bJGrkdCJVJ2Vs3zxjFYP0iUrVAS/hgryEUOT6V7hBWdOy1dPC2CuzAoU0pDUW6obVhaI+1dOsGBnJ8hZm684r9SblUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704923613; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HwFKj5Pn5DjJGhI9eC5OFFV9tA3PvMraO52aS5I9wUY=; b=D151ZP8WXWj4CrkoG2X4XP+YMIPgIuuTEBk3iHBhJY8Uc8/kkEM4Duwxt6yQrUaGNVVeiCS0MGkwbQiYrZlt82EqMZsT4T1Ov1KNT392Zd1tbTt60zKQw5rOo8todnmtChadUUX4U7ZMB/vGIX2VlWs8F0Pj3eve19gFwcKw3KI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17049236138396.016270910532285; Wed, 10 Jan 2024 13:53:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNgV5-0003fV-N5; Wed, 10 Jan 2024 16:52:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNgUt-0003bA-Jd for qemu-devel@nongnu.org; Wed, 10 Jan 2024 16:52:27 -0500 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNgUp-0005iT-KH for qemu-devel@nongnu.org; Wed, 10 Jan 2024 16:52:25 -0500 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7833c5d5c77so28888785a.3 for ; Wed, 10 Jan 2024 13:52:23 -0800 (PST) Received: from stoup.. ([172.58.27.160]) by smtp.gmail.com with ESMTPSA id z8-20020ae9c108000000b0078313c87609sm1888387qki.100.2024.01.10.13.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 13:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704923543; x=1705528343; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HwFKj5Pn5DjJGhI9eC5OFFV9tA3PvMraO52aS5I9wUY=; b=rridXl3+jdqbF7VGMLtTvQ0Yonrw6h4zHrKsfStlGzXFX6sEwUTCAfQgE9tzC1L3zR O6KqHRBVmJhBUJu8Stu5ijr+ZNz8iX3+SpnCFWq4Wa4eeY+SD0GAPIuqsGQMda0ZtoSA HzJGmi65fSLsid8JG60XuFZlBBug4qrGjXkicsWcEbTlxVY9W7rfkjzD6uzHaibOVBUe Iat3Cv/G+Ns1dP997/ieLu8h11puMVU0qrFLT0QJd9cVbUg1rUWxyKlcSjnIHQoZE3cg mgGYlhWqsxhIh37L+vJDq6e5UikkHrWvP8rgCFfjstDTuKuC77FhiSRCRonHmW8VMi40 HxUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704923543; x=1705528343; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HwFKj5Pn5DjJGhI9eC5OFFV9tA3PvMraO52aS5I9wUY=; b=RgFo+qekcviHHeyhGD0GHO0e6rmxC5I+SJHzSqybKbH7Z2EhGzZuAP835lZdCoSRkY ultOkPQJO0qlmWLZ81HtgZf1Y0DTwvI2SSnUo1QsCsz6Zj0mD+K3ImJ0ExPSlpVn0pBR mA6VPBqBWyzbeWvR0p8BPRGzBRSxAGCUi2IHiPVN82E79wfp5lDwcOGz7J2UpXMFUCV8 Yu/Dei+zx4YoJjZbIFsvbdSgq38dn6s406A2fL8oH8h3qc/P4nutNmMWlJ8c3B2fLVWI WcaIjbp6wC7MUpRKxIliXk/v97mQ4nsmTTcNRt1ghKGy2UR/dyZmMsqplHf3PkQWICSn pk1A== X-Gm-Message-State: AOJu0YwPFDksURV+Oxiqm3IlYZ90wxM1CeCPyRPiXpJ0XE3aIfauf+aZ 33+05fVPv2lQfPg108ZcFWgbqEKFiZzxPHi2K03VDY9DrW5RhPYJ X-Google-Smtp-Source: AGHT+IEb9FewlU6zcIzwO9ISoe8I6qtl57Oil2dp63eCvwjrzbtHHrlPxqzDEVyCc16TzBh0lYgeEg== X-Received: by 2002:a05:620a:3914:b0:783:2a6a:7b82 with SMTP id qr20-20020a05620a391400b007832a6a7b82mr388836qkn.98.1704923542755; Wed, 10 Jan 2024 13:52:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 3/4] tcg/ppc: Use new registers for LQ destination Date: Thu, 11 Jan 2024 08:52:03 +1100 Message-Id: <20240110215204.9353-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240110215204.9353-1-richard.henderson@linaro.org> References: <20240110215204.9353-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x734.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704923615063100003 LQ has a constraint that RTp !=3D RA, else SIGILL. Therefore, force the destination of INDEX_op_qemu_*_ld128 to be a new register pair, so that it cannot overlap the input address. This requires new support in process_op_defs and tcg_reg_alloc_op. Cc: qemu-stable@nongnu.org Fixes: 526cd4ec01f ("tcg/ppc: Support 128-bit load/store") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240102013456.131846-1-richard.henderson@linaro.org> Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target-con-set.h | 2 +- tcg/tcg.c | 21 ++++++++++++++++----- tcg/ppc/tcg-target.c.inc | 3 ++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/tcg/ppc/tcg-target-con-set.h b/tcg/ppc/tcg-target-con-set.h index bbd7b21247..cb47b29452 100644 --- a/tcg/ppc/tcg-target-con-set.h +++ b/tcg/ppc/tcg-target-con-set.h @@ -35,7 +35,7 @@ C_O1_I3(v, v, v, v) C_O1_I4(r, r, ri, rZ, rZ) C_O1_I4(r, r, r, ri, ri) C_O2_I1(r, r, r) -C_O2_I1(o, m, r) +C_N1O1_I1(o, m, r) C_O2_I2(r, r, r, r) C_O2_I4(r, r, rI, rZM, r, r) C_O2_I4(r, r, r, r, rI, rZM) diff --git a/tcg/tcg.c b/tcg/tcg.c index 896a36caeb..e2c38f6d11 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -653,6 +653,7 @@ static void tcg_out_movext3(TCGContext *s, const TCGMov= Extend *i1, #define C_O1_I4(O1, I1, I2, I3, I4) C_PFX5(c_o1_i4_, O1, I1, I2, I3, I= 4), =20 #define C_N1_I2(O1, I1, I2) C_PFX3(c_n1_i2_, O1, I1, I2), +#define C_N1O1_I1(O1, O2, I1) C_PFX3(c_n1o1_i1_, O1, O2, I1), #define C_N2_I1(O1, O2, I1) C_PFX3(c_n2_i1_, O1, O2, I1), =20 #define C_O2_I1(O1, O2, I1) C_PFX3(c_o2_i1_, O1, O2, I1), @@ -676,6 +677,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcod= e); #undef C_O1_I3 #undef C_O1_I4 #undef C_N1_I2 +#undef C_N1O1_I1 #undef C_N2_I1 #undef C_O2_I1 #undef C_O2_I2 @@ -696,6 +698,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcod= e); #define C_O1_I4(O1, I1, I2, I3, I4) { .args_ct_str =3D { #O1, #I1, #I2= , #I3, #I4 } }, =20 #define C_N1_I2(O1, I1, I2) { .args_ct_str =3D { "&" #O1, #I1,= #I2 } }, +#define C_N1O1_I1(O1, O2, I1) { .args_ct_str =3D { "&" #O1, #O2,= #I1 } }, #define C_N2_I1(O1, O2, I1) { .args_ct_str =3D { "&" #O1, "&" = #O2, #I1 } }, =20 #define C_O2_I1(O1, O2, I1) { .args_ct_str =3D { #O1, #O2, #I1= } }, @@ -718,6 +721,7 @@ static const TCGTargetOpDef constraint_sets[] =3D { #undef C_O1_I3 #undef C_O1_I4 #undef C_N1_I2 +#undef C_N1O1_I1 #undef C_N2_I1 #undef C_O2_I1 #undef C_O2_I2 @@ -738,6 +742,7 @@ static const TCGTargetOpDef constraint_sets[] =3D { #define C_O1_I4(O1, I1, I2, I3, I4) C_PFX5(c_o1_i4_, O1, I1, I2, I3, I= 4) =20 #define C_N1_I2(O1, I1, I2) C_PFX3(c_n1_i2_, O1, I1, I2) +#define C_N1O1_I1(O1, O2, I1) C_PFX3(c_n1o1_i1_, O1, O2, I1) #define C_N2_I1(O1, O2, I1) C_PFX3(c_n2_i1_, O1, O2, I1) =20 #define C_O2_I1(O1, O2, I1) C_PFX3(c_o2_i1_, O1, O2, I1) @@ -2988,6 +2993,7 @@ static void process_op_defs(TCGContext *s) .pair =3D 2, .pair_index =3D o, .regs =3D def->args_ct[o].regs << 1, + .newreg =3D def->args_ct[o].newreg, }; def->args_ct[o].pair =3D 1; def->args_ct[o].pair_index =3D i; @@ -3004,6 +3010,7 @@ static void process_op_defs(TCGContext *s) .pair =3D 1, .pair_index =3D o, .regs =3D def->args_ct[o].regs >> 1, + .newreg =3D def->args_ct[o].newreg, }; def->args_ct[o].pair =3D 2; def->args_ct[o].pair_index =3D i; @@ -5036,17 +5043,21 @@ static void tcg_reg_alloc_op(TCGContext *s, const T= CGOp *op) break; =20 case 1: /* first of pair */ - tcg_debug_assert(!arg_ct->newreg); if (arg_ct->oalias) { reg =3D new_args[arg_ct->alias_index]; - break; + } else if (arg_ct->newreg) { + reg =3D tcg_reg_alloc_pair(s, arg_ct->regs, + i_allocated_regs | o_allocate= d_regs, + output_pref(op, k), + ts->indirect_base); + } else { + reg =3D tcg_reg_alloc_pair(s, arg_ct->regs, o_allocate= d_regs, + output_pref(op, k), + ts->indirect_base); } - reg =3D tcg_reg_alloc_pair(s, arg_ct->regs, o_allocated_re= gs, - output_pref(op, k), ts->indirect_= base); break; =20 case 2: /* second of pair */ - tcg_debug_assert(!arg_ct->newreg); if (arg_ct->oalias) { reg =3D new_args[arg_ct->alias_index]; } else { diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 856c3b18f5..54816967bc 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2595,6 +2595,7 @@ static void tcg_out_qemu_ldst_i128(TCGContext *s, TCG= Reg datalo, TCGReg datahi, tcg_debug_assert(!need_bswap); tcg_debug_assert(datalo & 1); tcg_debug_assert(datahi =3D=3D datalo - 1); + tcg_debug_assert(!is_ld || datahi !=3D index); insn =3D is_ld ? LQ : STQ; tcg_out32(s, insn | TAI(datahi, index, 0)); } else { @@ -4071,7 +4072,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) =20 case INDEX_op_qemu_ld_a32_i128: case INDEX_op_qemu_ld_a64_i128: - return C_O2_I1(o, m, r); + return C_N1O1_I1(o, m, r); case INDEX_op_qemu_st_a32_i128: case INDEX_op_qemu_st_a64_i128: return C_O0_I3(o, m, r); --=20 2.34.1 From nobody Sat Sep 21 04:38:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704923606; cv=none; d=zohomail.com; s=zohoarc; b=Ihf1ZqE39sVNVuUNm1KFfKSWIZXQk+3BYOAIBM3NuYGkiveQFHsbTu4xmP7MbjLYAYeTbnuBJA7QZSn+9C9nYRMiSeGJW7+X8lgIDtVsOqdEEHP0srH54LUf98ZoQwYqDOPxPgIMxdLQe9/X9m7rwTD72mtyw5HEjO5jwJRFMxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704923606; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VNe84Wm/eO/XQH/99RqV1VT7/D2nQwtaPsBh5uvsHFY=; b=QiUPsL+c95NtYOcJXomUpMMPWc4Zs0d+1zStdXnNgkRmzY5ELR9DEiQNx0+L2uCRYCn0MNaZFQM7Pk4GNpE5hr6O6VGx5EhOZxY6aLyNHceHG1KixzZI2Zi/KnSRx+03jwQKdBMCuk2CAbZoAP9XwFtoPZppxhakdr1moZ/YuMQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704923606017663.0312201409126; Wed, 10 Jan 2024 13:53:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNgV9-0003iF-3u; Wed, 10 Jan 2024 16:52:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNgUx-0003fO-Cw for qemu-devel@nongnu.org; Wed, 10 Jan 2024 16:52:31 -0500 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNgUt-0005k7-C1 for qemu-devel@nongnu.org; Wed, 10 Jan 2024 16:52:28 -0500 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-7831362c9bcso356011985a.1 for ; Wed, 10 Jan 2024 13:52:26 -0800 (PST) Received: from stoup.. ([172.58.27.160]) by smtp.gmail.com with ESMTPSA id z8-20020ae9c108000000b0078313c87609sm1888387qki.100.2024.01.10.13.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 13:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704923546; x=1705528346; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VNe84Wm/eO/XQH/99RqV1VT7/D2nQwtaPsBh5uvsHFY=; b=S4YJkeK12jwLuaSCbYc56I/O5CQa+IiWGgvr3WCpBP1ctclCWCykRYTbWxGwyop81d Hgbo1XecebJ83kSPkKiWyfFMgFMp0PjdB3XIMa6bz+geml7PFEbqpIIf0wQEjbw0ovQG TZugNPSo9F1q7symZnEJUs94Uo0/iU5sJ/ZCpxylUG8nixOp7ucPcUTHQ2ac1YhIyHc+ vLZ2hHpYBIUNynMdy42wZcHNdF86bx6tChTfCg1VJSSQN3vNAVvGwYToHMHbQBX7l2Y/ oZxqqIa127mHFVBMsgmQHASDfbb1Lfc19GicpMcrWSh2q45HhX2abB/eF5cv3khEb0lu JeXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704923546; x=1705528346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VNe84Wm/eO/XQH/99RqV1VT7/D2nQwtaPsBh5uvsHFY=; b=a891wmEh0fDjUyBmME4J+xoQwKNFiy9v9Y6/mc0LtZhcMvsOXil70lCCGedapYpERr mehvFQvezxRSf+mlPCcsxEM5j+zLt3WyGtME0UJTf6C1X3p+9ojBrEdFP/IxqZQiBkdZ ORJ+ulC05GrCUNv5jP+uoyuaKLlQb6PlCD1mZwPnTtBLDZdkeQPZmFmzLl5atmNkd+bX XbWgcCY9eIrTXdnvOGOQwWdbV+vk3/ux6IHCp20tUobwZLP7L65O0BkiFlwzPdo2md/9 MxSey4kRt7vTKaHv0m4iKsBNyOK+dXDeflOwnBhfonIp5S7viAakjDutrxRlslpXyiCt iRJw== X-Gm-Message-State: AOJu0YxgT9DknlDt/+A928LYwje4XQX6ZyKQYbGtMgBL6NCB+vONIPGB b8dAE4RdRE0mgrBAoqbnUgtU3Kcr54XJN/On/fpxIf+xxa3CwpAU X-Google-Smtp-Source: AGHT+IHlFlSVkXj492KWbLsE53t7YF//BaKYu7KfEx78xkqXNl0ddhI/4jKMFBzbRJQn1kS6GUTUZA== X-Received: by 2002:a05:620a:2589:b0:783:1a6e:99bd with SMTP id x9-20020a05620a258900b007831a6e99bdmr256898qko.53.1704923546267; Wed, 10 Jan 2024 13:52:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Natanael Copa , qemu-stable@nongnu.org Subject: [PULL 4/4] util: fix build with musl libc on ppc64le Date: Thu, 11 Jan 2024 08:52:04 +1100 Message-Id: <20240110215204.9353-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240110215204.9353-1-richard.henderson@linaro.org> References: <20240110215204.9353-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704923607060100001 Content-Type: text/plain; charset="utf-8" From: Natanael Copa Use PPC_FEATURE2_ISEL and PPC_FEATURE2_VEC_CRYPTO from linux headers instead of the GNU specific PPC_FEATURE2_HAS_ISEL and PPC_FEATURE2_HAS_VEC_CRYPTO. This fixes build with musl libc. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1861 Signed-off-by: Natanael Copa Fixes: 63922f467a ("tcg/ppc: Replace HAVE_ISEL macro with a variable") Fixes: 68f340d4cd ("tcg/ppc: Enable Altivec detection") Message-Id: <20231219105236.7059-1-ncopa@alpinelinux.org> Signed-off-by: Richard Henderson --- util/cpuinfo-ppc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/cpuinfo-ppc.c b/util/cpuinfo-ppc.c index 1ea3db0ac8..b2d8893a06 100644 --- a/util/cpuinfo-ppc.c +++ b/util/cpuinfo-ppc.c @@ -6,10 +6,10 @@ #include "qemu/osdep.h" #include "host/cpuinfo.h" =20 +#include #ifdef CONFIG_GETAUXVAL # include #else -# include # include "elf.h" #endif =20 @@ -40,7 +40,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) info |=3D CPUINFO_V2_06; } =20 - if (hwcap2 & PPC_FEATURE2_HAS_ISEL) { + if (hwcap2 & PPC_FEATURE2_ISEL) { info |=3D CPUINFO_ISEL; } if (hwcap & PPC_FEATURE_HAS_ALTIVEC) { @@ -53,7 +53,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) * always have both anyway, since VSX came with Power7 * and crypto came with Power8. */ - if (hwcap2 & PPC_FEATURE2_HAS_VEC_CRYPTO) { + if (hwcap2 & PPC_FEATURE2_VEC_CRYPTO) { info |=3D CPUINFO_CRYPTO; } } --=20 2.34.1