From nobody Tue Nov 26 22:20:05 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1703166266; cv=none; d=zohomail.com; s=zohoarc; b=JMHTU3tT+x09rftsuTxT3bWcktIqnxm3GW0KsCGBHhCPbaAB+0YBQAhzDRFcSRvt4sSmyUOGWcCHXGyADKE8VvU3Dr10shFXuygdfFPVJtXBMavX5yY/tRguEfd7uNcdRdIVbB6HsMeVEt4zQvt12bMT5+5u2Ffsz2s13+bMv9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703166266; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JpkyJJq7oTwrPtWtR69ASiNFzLqvTbP7ciMS6rApFwA=; b=QjMzbQ5lHP+tv0RxMmQE5MUUh2gIWkGyUFTAahlMLO303+fvehtgaSK2ChJY+9pCx101hj73Hwh0Bu6t+7bFj0ZoOIWQHnyf9mkXmvGjyvNxU2c7FApELW90xJ8GJu18THPskdQLhUV+EjwAwXL2+1C18UbiOQXSv2jYOO3GYQ8= 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 1703166266401754.5112616247378; Thu, 21 Dec 2023 05:44:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGJLI-0005pT-Bu; Thu, 21 Dec 2023 08:44:04 -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 1rGJLH-0005pK-DK for qemu-devel@nongnu.org; Thu, 21 Dec 2023 08:44:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGJLF-0007Ch-Vg for qemu-devel@nongnu.org; Thu, 21 Dec 2023 08:44:03 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-269-gnTNQN66MeC0BrnRTjUp2A-1; Thu, 21 Dec 2023 08:43:59 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3368698f0caso503942f8f.1 for ; Thu, 21 Dec 2023 05:43:59 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id t18-20020a5d49d2000000b00336751cd4ebsm2070022wrs.72.2023.12.21.05.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 05:43:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703166240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JpkyJJq7oTwrPtWtR69ASiNFzLqvTbP7ciMS6rApFwA=; b=Rp/yg4p4YokQ9NnoMBSUvfodLyRxBuZgaPn/hgUZSuN2T5lqTPDaDkf0ZTh8GWayuLYiW3 AU6eSFcd0kaooMKQn4a5UQITG1hD3tmhjlBoUvZyUCdG684TLQCS3HUXIedo9/j5qhLBCU 7+t6Rj8MWfDI1ZG6WXySaeIQcV+Z7N4= X-MC-Unique: gnTNQN66MeC0BrnRTjUp2A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703166237; x=1703771037; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JpkyJJq7oTwrPtWtR69ASiNFzLqvTbP7ciMS6rApFwA=; b=EcV2shujGsyIv2ET1VCUYiZ3IJdWYV1SXL97C9+gGA+TXdKmvciwoLKYhlMwfnb2i4 lvgdgdyAA/LJJQTMQ4GIsROCXbtP18ffCNiRqnf11KEjP0cW9+49o68B+68SBMD593WW Ffiek413aLD7p9oN/YJp4fw9cCYmGGraoSpaY07I91Ny8U1y03Lq4Akj7LQ2uRZRYw5p dv57TvC/JYgZeqTYEx8ZyT0u6B8FzhWZr02bKfGpOmX+kS4cQvjJBSVQtkV4jsnKP/G0 4xfs1+iAkgKENIvPl62jClVOFwBMIxwclHyrX98r/vfdpkiEWjKsQvdHLE3wCSQZl0vm cADA== X-Gm-Message-State: AOJu0Yw0z3zt6nukOz42UKzm+SSm+ok1Lm0TU8bzWGc5Gso+ODDtTMpx SJNVk0JV//qAlm9Nuut0qHOBFLbrl6bMet1Og/j3gPI6/0l+sVSJCV8I7xHP9rp5rRJj3IH7mmC H5VtGceq2b5NQ6yURYljCX9g0b/04fjemLKdHzPig8QUaqvzD+V2NFnvKTVjLtY7pyyyCA8SnwJ M= X-Received: by 2002:a5d:4989:0:b0:336:4e1d:bff1 with SMTP id r9-20020a5d4989000000b003364e1dbff1mr383708wrq.180.1703166237634; Thu, 21 Dec 2023 05:43:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgMNm6sJUY18qTEwhXnEtDB7+1BzB6/bm82ybrRV/eMREqYhTshg35a3S4qfyVF1u2EHz0NA== X-Received: by 2002:a5d:4989:0:b0:336:4e1d:bff1 with SMTP id r9-20020a5d4989000000b003364e1dbff1mr383703wrq.180.1703166237228; Thu, 21 Dec 2023 05:43:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org Subject: [PATCH] tcg/i386: convert add/sub of 128 to sub/add of -128 Date: Thu, 21 Dec 2023 14:43:55 +0100 Message-ID: <20231221134355.35304-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.061, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1703166267540100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- tcg/i386/tcg-target.c.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index a83f8aab304..4e9f372d4fd 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1332,7 +1332,11 @@ static void tgen_arithi(TCGContext *s, int c, int r0, return; } =20 - if (c =3D=3D ARITH_AND) { + if ((c =3D=3D ARITH_ADD || c =3D=3D ARITH_SUB) && val =3D=3D 128) { + /* Facilitate using an 8-bit immediate. */ + c ^=3D ARITH_ADD ^ ARITH_SUB; + val =3D -128; + } else if (c =3D=3D ARITH_AND) { if (TCG_TARGET_REG_BITS =3D=3D 64) { if (val =3D=3D 0xffffffffu) { tcg_out_ext32u(s, r0, r0); --=20 2.43.0