From patchwork Fri Mar 29 22:31:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 784096 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp3429107wrt; Fri, 29 Mar 2024 15:32:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXo6QHfUTUDiI6jbwgS5cc8awdKeASc/hOh7OOT56Eg/k6SeC0pZKuXADcgyTtu347lStbn/7PJ+zLm1S+TVYYw X-Google-Smtp-Source: AGHT+IFmYNfny3Svl9mNQizGitzoVmtBau9Lk8XrSf+hoL25szy0tA7zppls4omNJUpuYROxzxac X-Received: by 2002:a05:620a:57ca:b0:788:7213:6b93 with SMTP id wl10-20020a05620a57ca00b0078872136b93mr3561372qkn.75.1711751571207; Fri, 29 Mar 2024 15:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711751571; cv=none; d=google.com; s=arc-20160816; b=VXnMpBvHn6mllZSKih92Of5d3nsuBC6E5eQaoumElCbA1fj2xiqBLZ6ciWP35in4bo V42A1oYGnJw8GuqSYCUA/BN4YcHtWccsn+duUCcefg1jjO2GYi/tY3OT0BzYEMknAHoa 9+6YTuOS8kjE3iBC8I5rQcYWBx3DnlSV0cW+PDbkw4Ry4Swp21YEa8j711fWfAcJMpYC CY1/0SD9CoYXvwvjF4tcQF38dSwty4RMt1zvDoTM72vQv9V7o/5WYzgudx5BjOlglzqO 6xymQnYzJR6NcdL5JVxXaSNjK3S+/CILotpf/K6hAOvQESIjFgOQNUYs+D7dZyrdnq31 SVeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=dPcM7F+bIMm+kpOtGS43p2VNPDZH3BZ56mw6e1fyEkk=; fh=wDljmxUHXfz9MGj2//jPHYRc53BMWF157v8rVKELrf4=; b=RLUIKs7/muPga8MpfHrogx+zrMZ/e8lVY/h/W6lrDjpPt1QpaEkMQrEprHRYW0FpOV gYqcwFSgqZNK1CmOXUbDwWeulUW4sKVg80kPEcuDoligPGxeQ7voU/B7Kj2b34b+KKjb JNbiMRM6bH+rFS5jLsgMy4CgDnsBOGFeMKZlesf5JG2xPn0qyKIVplIRkPnAUPUABK2T yCNmXVfj3pRcxPgPSsjMKiVpkdJh4/3JZNQbCGk3L1ypMpU/mem8IpqFENHtF3TOh2fo dQHbcQkKN6iDYvUq6Ga4oe4bHl0gU2JEnFT5UiBq5qAbxWNLOoX2z6+XtUzoGCJW1Fsh 2cFQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=txzeo8Il; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id wj24-20020a05620a575800b0078a3a113293si4645344qkn.98.2024.03.29.15.32.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2024 15:32:51 -0700 (PDT) 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=txzeo8Il; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqKlK-0002c0-KX; Fri, 29 Mar 2024 18:31:50 -0400 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 1rqKkz-0002Xl-RP for qemu-devel@nongnu.org; Fri, 29 Mar 2024 18:31:34 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqKky-0003WW-BL for qemu-devel@nongnu.org; Fri, 29 Mar 2024 18:31:29 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1e243ccbffbso283835ad.3 for ; Fri, 29 Mar 2024 15:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711751487; x=1712356287; 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=dPcM7F+bIMm+kpOtGS43p2VNPDZH3BZ56mw6e1fyEkk=; b=txzeo8Il11JmWps6LjORNB7JrGAPN8jnYbCWQ4yx46bh8g+j2PrZs3B07MPs6U5ak9 ASpbWKcmMa/9PDP1PbskxLrPLyKQzLJ7WpzAwfE9fojcpbD8fKkLyO83alpy0EPOELgP F6xEL2Kh1+5sN+OrbHsW/dAhFK6aSyPW07v18FC6yDPMpps+Hps72va0KiRb+E5MtgwO Y2pSDdH1c1fZe3MfnRbUbznI6lxQcO9nH3qGwVf4lODZV+6iItTFM92Zo5RyB35zSzlb 3IG+mEUCJ8+IDJ8OqUDHZwJTb8v9LCAWz+dPFhWWkEU9F8XpLAlVlaOp7xzONAPL2MAx oFpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711751487; x=1712356287; 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=dPcM7F+bIMm+kpOtGS43p2VNPDZH3BZ56mw6e1fyEkk=; b=X6ef3rG855Z4Znbx1Sio1F2V8PcSrqaxwEGCkJGmslbAIChRiJzramfWilYqinpqjg LbKNFeuIvxC0Ja2APcz/AxiA9AgAjQCN63fk2T720xNdMEO4CpzAkNcCmJetKwQ8VBit xgMwyYKQV8TcKvmu1PNttIuyTlnO0rFKhNP59zNQeliIAW6SDmLhqhTThf8gRuZ0Ks9h ERJry/vTBj/Qm8X+7mKEmrPxJIRq1wasTI+ZgLoXK8zTZYw07DWBLdATGUibwO9qX8Lo /EbVnxCm1ph+vt+96E36IBSmjqtsZdEO17g4kqE+YAsDuZKCY5ywdDGxU7t+cjqUN0wL 5vZw== X-Gm-Message-State: AOJu0YyFFPdk1oNWt83F0vR1Hj77F+j8ytsPmW7OkNAX6IGt0J6XDBND 68x7OFr7/OedUxbb33zX6zKeocALPHXSbI+8VtCtRbzfO7/MMurjyhnXdUNbSapeM6x4u4Koaa3 d X-Received: by 2002:a17:902:e495:b0:1e0:afa0:d515 with SMTP id i21-20020a170902e49500b001e0afa0d515mr2767567ple.29.1711751487100; Fri, 29 Mar 2024 15:31:27 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id f8-20020a170902684800b001e09b636cafsm4000955pln.287.2024.03.29.15.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 15:31:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller Subject: [PULL 09/18] target/hppa: Fix DCOR reconstruction of carry bits Date: Fri, 29 Mar 2024 12:31:02 -1000 Message-Id: <20240329223111.1735826-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240329223111.1735826-1-richard.henderson@linaro.org> References: <20240329223111.1735826-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The carry bits for each nibble N are located in bit (N+1)*4, so the shift by 3 was off by one. Furthermore, the carry bit for the most significant carry bit is indeed located in bit 64, which is located in a different storage word. Use a double-word shift-right to reassemble into a single word and place them all at bit 0 of their respective nibbles. Tested-by: Helge Deller Reviewed-by: Helge Deller Fixes: b2167459ae4 ("target-hppa: Implement basic arithmetic") Signed-off-by: Richard Henderson --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index e041310207..a3f425d861 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2791,7 +2791,7 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) nullify_over(ctx); tmp = tcg_temp_new_i64(); - tcg_gen_shri_i64(tmp, cpu_psw_cb, 3); + tcg_gen_extract2_i64(tmp, cpu_psw_cb, cpu_psw_cb_msb, 4); if (!is_i) { tcg_gen_not_i64(tmp, tmp); }