Message ID | 20241220041104.53105-10-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851743wrq; Thu, 19 Dec 2024 20:12:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWw2IkHu59BaHMbemjZ55SeMgS3d2dc8Oe8Isp3/nbR5UMz1VKyRbMvK0aVbeHU+ZJ+YKcZNA==@linaro.org X-Google-Smtp-Source: AGHT+IEiqcTTo53DAzEzuNze+o55IuMHe9MjpGXIchE9cvw6uvm6keI072Fcf1pDqVRWUUuTlBOd X-Received: by 2002:a05:620a:4413:b0:7b6:d754:207f with SMTP id af79cd13be357-7b9ba804ac9mr188638485a.50.1734667945337; Thu, 19 Dec 2024 20:12:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667945; cv=none; d=google.com; s=arc-20240605; b=SmHdtFEjDFKnfPN9S5gH2aPTiutuVEiF8IpojWbW8qwyXm/dewAOn9PAEzpdUCqEmW c9I7M6c9HjCneOmPUuenOsHwKEpwySZHCQ7fP++vrVzWn5rEmvFpk9pqYJLf2ENT/PZR j62FdvjGWVDaYvQ9M+9RuXIgb4whxcV6rCTN5q/l7A0OOMykcrwyhoHu7CaFx3MCbM1Q XRKtPQxfD6u2nWFU1bzVbmYCxXnsbFiL7ejjj+cj8JCnRXsOXqjtYiDk6ipQl0Ap1UXu 5gHgS8iWt2t3vCQmS5wj1HwRLoM+rA54iuSZD6bcmroiEmcWCx/pFeouMSnqG5tP8jjp cUSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pTlIt3yFdh4Ary2wfKIiByPP+3BeXY1y055wil8BQG4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=N9PXbFW6HBgEOAzsXncWjFU6PKDBzCAOpukKCXGHsBwvNZXvIeJ8xw+sy5yN/uI8NY y5wSVlLBIlzp1FWebnkuJxfJ1+8SPmB5NMQ6y+aj6o08x6O5fPhuhTvLJHSv3bqfeFoy c5BbOOJQSYb5GVmVyjxsUDmAwWbCHBtyq0WRqV8DL3J6/pE4RO1uzEgO3UDW0+KppUlJ VpkqoKe5FBz/yIIigKrOsVIOV0EDRTr2SumEa0WE7ZZYPDlz3VzB3P0WdORYR0VcE3u3 WG+krO1rPBIlOO7eRggiU9XUynM0zmf6BcjYka5mpwT15jOxcBz78llrXpx9NLuTf1Tl sYAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KIhTgOVK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ad91asi357415885a.39.2024.12.19.20.12.25 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:12:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KIhTgOVK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1tOUMC-0008Oi-JZ; Thu, 19 Dec 2024 23:11: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 <richard.henderson@linaro.org>) id 1tOUM6-0008Li-ES for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:14 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1tOUM4-0006Hs-QH for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:14 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-218c8aca5f1so16998485ad.0 for <qemu-devel@nongnu.org>; Thu, 19 Dec 2024 20:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667871; x=1735272671; 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=pTlIt3yFdh4Ary2wfKIiByPP+3BeXY1y055wil8BQG4=; b=KIhTgOVKsSd22foZ9vs/aHRxaxE48BQcZ0Vt+bs5mvbrsu2UD0MoQfA7Ytqizkg7nc XAJWUPR4KokSXNlfvWpPl53xWjyA9gJ2yhixGFwjSHcbHTEI89tY9VmUXEUnmDJ865FM fgaWYDks5kmkWNk34dUjPOBRcDv9nivrF+oHWNsYt+WYdF0uMpdxCn2xdY3z2PsYySTc NxY6hwc+nwWjIVEY0w3asPx0QGb/G3iFQ8KMEexOTPMU8otSmq+k5QPHui4iCeHtlthe cwRl8n3pr0zaYST2CJohTse/TEsWS6UrY3F1HTGULs0Xu+Y1uJVhkU/Yz3KZ4Zl+qWDo WetQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667871; x=1735272671; 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=pTlIt3yFdh4Ary2wfKIiByPP+3BeXY1y055wil8BQG4=; b=qdstZ0LvFZRxY4uMTKbxENqVVhwTlk1ufZTAPQO6FHxEAkRoG+xbSzOkn7qHS58Ld+ VUagd7HEEEnGSX5+m81jF4WHx8oVYQabl/53kT7PDiu9o/7GZHo3vuVngs422UliEeHx V/bCS40ueaEwxVRutIF7zto1iLjWkiD9x/3G0b1z0X7OccjQb0cFaaH/H5T9+J/e4LQx LyWsLeuhuZrX47s2jB+FVutnmxR/flrNmyyBHvc6yi1dyE2elfTwJz6gTuWdSKdoMq63 /C3CzpbSpd62JyMprEUa0C4WFVcwRG5V9XTEd76hLgO01++1+XOgoai04oUbZ1KatX1i DqPA== X-Gm-Message-State: AOJu0Yw5FGmxH/D3sf8meP3yFlJbeOK1X5Pf3Xf9Oha+le/KgBtGe+zn wH/Z4JVIOa8sJfGqTRVjua7M7ZrIvQ5qyMAhrMXda7WnAg5unr9jPsRK+3i9sXpW1zbOlBVtfUk 6 X-Gm-Gg: ASbGncv06wc+ct/w5qOxpSJHpJ/7oY/3Kism5AqbWqNWKfNNJoFDiItmUeRUJpBUwbH f5V+1KTrNNQ0ofTjUvXKAaAQlE5pcJEFMvxiEOQojyydzofo+vMJoOQZWUEO+BSgHOcOETUGsEX CuLB7sg6YhZZm/pIj98Co1Li7R2OnaiVVhz5bxT4F9cYYg+W0f2wKedYhOGk0Qi04fqZfVoD7Xr gv/7v10NvpwgbqCmB5GXejS3yBa4BcS7si3r96jsdfmfYpUWbCeVrvncjvtN2c= X-Received: by 2002:a17:90b:2543:b0:2f4:432d:250d with SMTP id 98e67ed59e1d1-2f452e372edmr2051809a91.21.1734667871434; Thu, 19 Dec 2024 20:11:11 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:11 -0800 (PST) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org> Subject: [PATCH v2 09/51] tcg/optimize: Use fold_masks_zs in fold_bswap Date: Thu, 19 Dec 2024 20:10:21 -0800 Message-ID: <20241220041104.53105-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
tcg: Remove in-flight mask data from OptContext
|
expand
|
diff --git a/tcg/optimize.c b/tcg/optimize.c index c73410232b..b8e9ded821 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1495,16 +1495,15 @@ static bool fold_brcond2(OptContext *ctx, TCGOp *op) static bool fold_bswap(OptContext *ctx, TCGOp *op) { uint64_t z_mask, s_mask, sign; + TempOptInfo *t1 = arg_info(op->args[1]); - if (arg_is_const(op->args[1])) { - uint64_t t = arg_info(op->args[1])->val; - - t = do_constant_folding(op->opc, ctx->type, t, op->args[2]); - return tcg_opt_gen_movi(ctx, op, op->args[0], t); + if (t1->is_const) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + do_constant_folding(op->opc, ctx->type, + t1->val, op->args[2])); } - z_mask = arg_info(op->args[1])->z_mask; - + z_mask = t1->z_mask; switch (op->opc) { case INDEX_op_bswap16_i32: case INDEX_op_bswap16_i64: @@ -1532,18 +1531,17 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) /* If the sign bit may be 1, force all the bits above to 1. */ if (z_mask & sign) { z_mask |= sign; - s_mask = sign << 1; } + /* The value and therefore s_mask is explicitly sign-extended. */ + s_mask = sign << 1; break; default: /* The high bits are undefined: force all bits above the sign to 1. */ z_mask |= sign << 1; break; } - ctx->z_mask = z_mask; - ctx->s_mask = s_mask; - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_call(OptContext *ctx, TCGOp *op)