From patchwork Fri Oct 20 20:42:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736289 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp500857wrl; Fri, 20 Oct 2023 13:44:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEj7tN1jsgzya8sGTHFDaUB3peF+66AljfFFQzuA+n9cwynNHPJjyiVSaLkcsyO3UZq1Gd0 X-Received: by 2002:a05:620a:c44:b0:778:8f26:6846 with SMTP id u4-20020a05620a0c4400b007788f266846mr8616326qki.37.1697834666804; Fri, 20 Oct 2023 13:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834666; cv=none; d=google.com; s=arc-20160816; b=wsAZ9qO/FvtJhC/dY74ArVvNzFFrTQVBCpzo/PC/sdqHM7SGdaX5YCMdP1wm489xpo Ze+ixyUSGXlkZqs871tpjY4mK3DPnLtmVo7Rd5S7hektgrstJ/xSGrLf1qWElDOjIIAm 2uGolGAtOlMGOrzK1+JV1GsfLWYWrk6qcbb27I9wYtByBCsOopFP9EwnG0EIhE/EwpO4 iG7Y8w7B1OMuF3Qgjuz8ZQoPwyqV4Uc68sbEUoHtC465a9XQ6pFebOJNgilXJkKalOOX uFN1AIM9lUYTltlD+4y1JMvfLyReLW50fD63oV0ACDNw4CL8QeML0jUxG5Xh7v35+Skp +01w== 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=J3OQEiXHHMGRWFPueeKCKBwMI85PiFBLtHqDQ0TceE8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=UGvpHsUNi2oRnpLcU3WXfdiGWvdO+MZn8uOxvYwBkTtX4j2Scur4V+tqtNQ3XXBKu5 BjEIYyX/OGPBYGcQjebhHY7Ndc/7wYjzMC/GiFtHejLoRlZMoLzrWP8wvAUYaAp+LSYo ITKI8OaPj1sTK4xo53tFJW5HAh95u2rpS5nzVi88GdaYXBnymxxuK5kpaj6ux/ooKTy2 aob73fF6EDNAD792scZxepdVmAYy1BD6Fa3TV0ZUNqYcaHVq9om7tflTPnf80wJwfizn IR6gjLVUISjccsw2NjHspbhl70rbOqzXMPx4Fz1/OGvVkbrvSaNyPbct6zlWpt+AZdN7 mR+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="j/h+rT+K"; 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 cx25-20020a05620a51d900b007683ee37758si1773162qkb.86.2023.10.20.13.44.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:44:26 -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="j/h+rT+K"; 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 1qtwLL-0007fT-NV; Fri, 20 Oct 2023 16:43:39 -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 1qtwLJ-0007ef-Jq for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:37 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLH-000884-QV for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:37 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso996491b3a.1 for ; Fri, 20 Oct 2023 13:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834614; x=1698439414; 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=J3OQEiXHHMGRWFPueeKCKBwMI85PiFBLtHqDQ0TceE8=; b=j/h+rT+K17RJJ0J0tLcUmY3pXxuv+YNNE3tT8J7p2pes6ltTCKR5gDq7lEjTZ71XEG 1s3vr3w/KsPYPe71YwocADV0P1SmfqG2YebS+zoTg7I9mOxaFXP8PNmoY5Ul+mIhdb0T SaeiN/nz+Gseb8nk0/7qcKFixwX25zN0oPKbdnz90bRkvwkYkP+gmUhx4tmOcsXmqBxa ugQsxgtU1AUgvXGdFY5sSKMaog20eTGTP4AEm4vb82RbjVUiUecJ/ulBCC4qt8kfKhLF p5/AEOSXHL8efxodvy4qgnKSeeAVEk3zF6Gsm+YzlfSV4I+CG8Cg8P3KaNGtRXmu9n7J Sf+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834614; x=1698439414; 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=J3OQEiXHHMGRWFPueeKCKBwMI85PiFBLtHqDQ0TceE8=; b=HdJLOqvwAzs/VDm0rLUfURDGXrIDRStHTA9pKoM7D/z/anGYiWZV7s3pUHCU8/O61p MvTEjeR93ptZ6FQhz8pYNA2zjo+0gNGOcQ2NzPWuBRuIgsrGG19Rlqbcko/5QbwSmQF0 /o5Cx+wdG8fPta+6SXMx4DtmPCQIGroMXpjY4XIvS/Xa+o6a5g/sKEjObN0QHZCBODV1 NiCYimPIznSt9mUEBaZzbUDl0JqGr0ZkEJYHL6S1sskkvCIdQKixwPbKQ2wBqX7TecAE MVDkzxtpUa+r43Xj8uh/n3pRuDgEd6+K5BVR5WXQu++Z7nkbr00xx8NKD3P7AFzFjABt sfTw== X-Gm-Message-State: AOJu0YyxlpV+sjGLdu4KNW2q54to1Q2+U1S+SW8UXt8HtC5agbI4Jw+/ RQKlZG7u8R38kaYG7GliYfUjuKsDFpjSJ0AhJMY= X-Received: by 2002:a05:6a00:1c8c:b0:68f:cdb8:ae33 with SMTP id y12-20020a056a001c8c00b0068fcdb8ae33mr8909450pfw.10.1697834614185; Fri, 20 Oct 2023 13:43:34 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 01/65] tcg: Improve expansion of deposit of constant Date: Fri, 20 Oct 2023 13:42:27 -0700 Message-Id: <20231020204331.139847-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 extract2 expansion is too difficult for the optimizer to simplify. If we have an immediate input, use and+or instead, skipping the and if the field becomes all 1's. Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 393dbcd01c..2ef4b866e2 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -602,6 +602,7 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, { uint32_t mask; TCGv_i32 t1; + TCGTemp *ts; tcg_debug_assert(ofs < 32); tcg_debug_assert(len > 0); @@ -617,6 +618,19 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, return; } + /* Deposit of a constant into a value. */ + ts = tcgv_i32_temp(arg2); + if (ts->kind == TEMP_CONST) { + uint32_t mask0 = deposit32(-1, ofs, len, 0); + uint32_t maski = deposit32(0, ofs, len, ts->val); + + if (mask0 != ~maski) { + tcg_gen_andi_i32(ret, arg1, mask0); + } + tcg_gen_ori_i32(ret, ret, maski); + return; + } + t1 = tcg_temp_ebb_new_i32(); if (TCG_TARGET_HAS_extract2_i32) { @@ -2217,6 +2231,7 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, { uint64_t mask; TCGv_i64 t1; + TCGTemp *ts; tcg_debug_assert(ofs < 64); tcg_debug_assert(len > 0); @@ -2232,6 +2247,19 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, return; } + /* Deposit of a constant into a value. */ + ts = tcgv_i64_temp(arg2); + if (ts->kind == TEMP_CONST) { + uint64_t mask0 = deposit64(-1, ofs, len, 0); + uint64_t maski = deposit64(0, ofs, len, ts->val); + + if (mask0 != ~maski) { + tcg_gen_andi_i64(ret, arg1, mask0); + } + tcg_gen_ori_i64(ret, ret, maski); + return; + } + if (TCG_TARGET_REG_BITS == 32) { if (ofs >= 32) { tcg_gen_deposit_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1), From patchwork Fri Oct 20 20:42:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736290 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp500858wrl; Fri, 20 Oct 2023 13:44:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVqJySNebFkMfwYwSuylZXiI3HEk27woKRR2u/Pxm+V9XtEssuDJ7stbY6ddIUGt8jEMfO X-Received: by 2002:a05:620a:29c7:b0:775:ced2:3c7 with SMTP id s7-20020a05620a29c700b00775ced203c7mr3633870qkp.26.1697834666852; Fri, 20 Oct 2023 13:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834666; cv=none; d=google.com; s=arc-20160816; b=JDTJiNfA9oMlsEYDPWyc9NHMmcVLCONoO89JHob0Qt8vaLNvBE2IE3jyBfdL6Zd6DP uKif7a2/txswFtX81cXpWtqvd1wzxKXXZd5vm/Vt7ymDo35JZBDRL3A48zjZ/vRRynVN QhdTa7Yk4hxfkFd0CueKoV4KzS/RsFVcx2RzYA933CG5KPXPNKyBnKJzPCsT6YQUF7Hi Pbe5Bk1B+oAS5FQl/C5OFvsQ28DgIcZaqMaEECY7t27efOThI/WYeivu1ik3BBMcwJ7y wknNlwS1VJyy6AE5S0yQ95FcWDetr6P9AuH0MQSn4VLLANMtcj0Qsl44sjvcFo/9vqx6 D+wg== 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=2zsMSRhlbZwVzQVen6DKnQDDskBCrZAwA6YeAeDVn/c=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=NJczlMP7/8pqPBnUmJnb3ve/Dg3HsMOk0jbXCoQY/nL8Jl4EVURst4K5OGLKmWJR6M bcIfJbkfd/8QTw0KKIHCEGUzU+ehy2Mh5iLSG3FbwdEtNCQDbKiUyCKCWm40T7rEdMkN 5rhZ3Vqj+gYbPyqGDY7jln7Ys35hpODJNsUrZvrcYNB4rSI1Iu9bO3c24TJWcD4m8zkD 0M6uoOcmei+cXSv5kqtac470NUSPNy6hsZ+NxV+houBxf4pjLiuzjkhEVPY5T+p8Q/9C BgOxxq8pWf/B/e4+iYrWnkielp07e+KM94jeIqB4wdh6Nrzs7OUOaBt43KToOlKdWpT6 HPdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xYdEHX35; 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 u25-20020a05620a085900b00775da6eacb2si1923718qku.19.2023.10.20.13.44.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:44:26 -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=xYdEHX35; 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 1qtwLQ-0007hH-EF; Fri, 20 Oct 2023 16:43:45 -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 1qtwLL-0007fP-Fb for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:39 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLJ-00088B-DD for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:39 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6b9af7d41d2so1253114b3a.0 for ; Fri, 20 Oct 2023 13:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834615; x=1698439415; 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=2zsMSRhlbZwVzQVen6DKnQDDskBCrZAwA6YeAeDVn/c=; b=xYdEHX353qnw1YqndbLVA53rMSjfEm0aJfZHoW/8+UZvismFWM9wgN0GQPw/g2q/ci hJVwC6+GqhZUlMw3fckshKHDxBYEM94RLba2SmfFm34fzLm3cHYfUwWb5X64dC1QisnD GEUoPMpPrXJifYrgf3vJFWLCWPZHMXiwQgSPvY8hga2jddyFnRXP/leqRj8Zy/al4wO1 mV+rmYrBxBAmw3PRiIsUL14Q2nSUkCYYbi7gDxIQjLHxw5e89fMDXyPSHMR7TPkQqw6E HeFhddoz6DkGeP3s32n7P6nCaqcEq1hXyqsL0dSdLqzDIFK4tCbKvmwaLwIScsv4jgBB NBvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834615; x=1698439415; 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=2zsMSRhlbZwVzQVen6DKnQDDskBCrZAwA6YeAeDVn/c=; b=wvlpSAVG/HU4LAHbDZMZQ2maHqlP8l/UVL8tvVb8BhVDehIH486L0Bgw3c4DCNGpbd +evkqGLsKyjL9iDFP7TrFJSqZTC0opXB6nVWb5rb2gVRi+n9ZjvoBHwex6RpZwyoG/2I moEf0wy37ICgLIQ02Zr6ZLsE8a15qTS2VXSVAzkblm2LB5eIXMi+VpWv4qexK8/vk7/R iBSnWX/2S9kB8MI3xiDMkerKObM8D1pz4XRAXHEXho/wdF7FCqpFclCT+v/ygETfdotp cGqgPwddTQrSqgvQcRp2Puywjdpk0YIWcrWqL7qLtzEOmdl3TsKau1PbAaKly0pyyAYl rkPQ== X-Gm-Message-State: AOJu0YxBAv8GHpwEpFBDs52/iWk7W/p/61xGea7GyMuC7r37b0vgov3i nJQTr2+QFwBCnLYLnnxLYGysjrSiQ3Ym0sR+PW8= X-Received: by 2002:a05:6a20:1604:b0:14e:43b0:5f99 with SMTP id l4-20020a056a20160400b0014e43b05f99mr2903499pzj.52.1697834615290; Fri, 20 Oct 2023 13:43:35 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 02/65] tcg: Improve expansion of deposit into a constant Date: Fri, 20 Oct 2023 13:42:28 -0700 Message-Id: <20231020204331.139847-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 Generalize tcg_gen_deposit_z_* from 0 to any constant. Use this to automatically simplify tcg_gen_deposit_*. Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 295 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 174 insertions(+), 121 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 2ef4b866e2..049b684ccc 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -597,6 +597,70 @@ void tcg_gen_rotri_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2) } } +static void tcg_gen_deposit_i_i32(TCGv_i32 ret, uint32_t i, TCGv_i32 arg, + unsigned int ofs, unsigned int len) +{ + i = deposit32(i, ofs, len, 0); + + if (ofs + len == 32) { + tcg_gen_shli_i32(ret, arg, ofs); + goto finish; + } + if (ofs == 0) { + tcg_gen_andi_i32(ret, arg, (1u << len) - 1); + goto finish; + } + if (TCG_TARGET_HAS_deposit_i32 + && TCG_TARGET_deposit_i32_valid(ofs, len)) { + tcg_gen_op5ii_i32(INDEX_op_deposit_i32, ret, + tcg_constant_i32(i), arg, ofs, len); + return; + } + + /* + * To help two-operand hosts we prefer to zero-extend first, + * which allows ARG to stay live. + */ + switch (len) { + case 16: + if (TCG_TARGET_HAS_ext16u_i32) { + tcg_gen_ext16u_i32(ret, arg); + tcg_gen_shli_i32(ret, ret, ofs); + goto finish; + } + break; + case 8: + if (TCG_TARGET_HAS_ext8u_i32) { + tcg_gen_ext8u_i32(ret, arg); + tcg_gen_shli_i32(ret, ret, ofs); + goto finish; + } + break; + } + /* Otherwise prefer zero-extension over AND for code size. */ + switch (ofs + len) { + case 16: + if (TCG_TARGET_HAS_ext16u_i32) { + tcg_gen_shli_i32(ret, arg, ofs); + tcg_gen_ext16u_i32(ret, ret); + goto finish; + } + break; + case 8: + if (TCG_TARGET_HAS_ext8u_i32) { + tcg_gen_shli_i32(ret, arg, ofs); + tcg_gen_ext8u_i32(ret, ret); + goto finish; + } + break; + } + tcg_gen_andi_i32(ret, arg, (1u << len) - 1); + tcg_gen_shli_i32(ret, ret, ofs); + + finish: + tcg_gen_ori_i32(ret, ret, i); +} + void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, unsigned int ofs, unsigned int len) { @@ -613,6 +677,14 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, tcg_gen_mov_i32(ret, arg2); return; } + + /* Deposit of a value into a constant. */ + ts = tcgv_i32_temp(arg1); + if (ts->kind == TEMP_CONST) { + tcg_gen_deposit_i_i32(ret, ts->val, arg2, ofs, len); + return; + } + if (TCG_TARGET_HAS_deposit_i32 && TCG_TARGET_deposit_i32_valid(ofs, len)) { tcg_gen_op5ii_i32(INDEX_op_deposit_i32, ret, arg1, arg2, ofs, len); return; @@ -667,53 +739,7 @@ void tcg_gen_deposit_z_i32(TCGv_i32 ret, TCGv_i32 arg, tcg_debug_assert(len <= 32); tcg_debug_assert(ofs + len <= 32); - if (ofs + len == 32) { - tcg_gen_shli_i32(ret, arg, ofs); - } else if (ofs == 0) { - tcg_gen_andi_i32(ret, arg, (1u << len) - 1); - } else if (TCG_TARGET_HAS_deposit_i32 - && TCG_TARGET_deposit_i32_valid(ofs, len)) { - TCGv_i32 zero = tcg_constant_i32(0); - tcg_gen_op5ii_i32(INDEX_op_deposit_i32, ret, zero, arg, ofs, len); - } else { - /* To help two-operand hosts we prefer to zero-extend first, - which allows ARG to stay live. */ - switch (len) { - case 16: - if (TCG_TARGET_HAS_ext16u_i32) { - tcg_gen_ext16u_i32(ret, arg); - tcg_gen_shli_i32(ret, ret, ofs); - return; - } - break; - case 8: - if (TCG_TARGET_HAS_ext8u_i32) { - tcg_gen_ext8u_i32(ret, arg); - tcg_gen_shli_i32(ret, ret, ofs); - return; - } - break; - } - /* Otherwise prefer zero-extension over AND for code size. */ - switch (ofs + len) { - case 16: - if (TCG_TARGET_HAS_ext16u_i32) { - tcg_gen_shli_i32(ret, arg, ofs); - tcg_gen_ext16u_i32(ret, ret); - return; - } - break; - case 8: - if (TCG_TARGET_HAS_ext8u_i32) { - tcg_gen_shli_i32(ret, arg, ofs); - tcg_gen_ext8u_i32(ret, ret); - return; - } - break; - } - tcg_gen_andi_i32(ret, arg, (1u << len) - 1); - tcg_gen_shli_i32(ret, ret, ofs); - } + tcg_gen_deposit_i_i32(ret, 0, arg, ofs, len); } void tcg_gen_extract_i32(TCGv_i32 ret, TCGv_i32 arg, @@ -2226,6 +2252,98 @@ void tcg_gen_rotri_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2) } } +static void tcg_gen_deposit_i_i64(TCGv_i64 ret, uint64_t i, TCGv_i64 arg, + unsigned int ofs, unsigned int len) +{ + i = deposit64(i, ofs, len, 0); + + if (ofs + len == 64) { + tcg_gen_shli_i64(ret, arg, ofs); + goto finish; + } + if (ofs == 0) { + tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); + goto finish; + } + if (TCG_TARGET_HAS_deposit_i64 + && TCG_TARGET_deposit_i64_valid(ofs, len)) { + tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, + tcg_constant_i64(i), arg, ofs, len); + return; + } + + if (TCG_TARGET_REG_BITS == 32) { + if (ofs >= 32) { + tcg_gen_deposit_i_i32(TCGV_HIGH(ret), i >> 32, + TCGV_LOW(arg), ofs - 32, len); + tcg_gen_movi_i32(TCGV_LOW(ret), i); + return; + } + if (ofs + len <= 32) { + tcg_gen_deposit_i_i32(TCGV_LOW(ret), i, TCGV_LOW(arg), ofs, len); + tcg_gen_movi_i32(TCGV_HIGH(ret), i >> 32); + return; + } + } + + /* + * To help two-operand hosts we prefer to zero-extend first, + * which allows ARG to stay live. + */ + switch (len) { + case 32: + if (TCG_TARGET_HAS_ext32u_i64) { + tcg_gen_ext32u_i64(ret, arg); + tcg_gen_shli_i64(ret, ret, ofs); + goto finish; + } + break; + case 16: + if (TCG_TARGET_HAS_ext16u_i64) { + tcg_gen_ext16u_i64(ret, arg); + tcg_gen_shli_i64(ret, ret, ofs); + goto finish; + } + break; + case 8: + if (TCG_TARGET_HAS_ext8u_i64) { + tcg_gen_ext8u_i64(ret, arg); + tcg_gen_shli_i64(ret, ret, ofs); + goto finish; + } + break; + } + /* Otherwise prefer zero-extension over AND for code size. */ + switch (ofs + len) { + case 32: + if (TCG_TARGET_HAS_ext32u_i64) { + tcg_gen_shli_i64(ret, arg, ofs); + tcg_gen_ext32u_i64(ret, ret); + goto finish; + } + break; + case 16: + if (TCG_TARGET_HAS_ext16u_i64) { + tcg_gen_shli_i64(ret, arg, ofs); + tcg_gen_ext16u_i64(ret, ret); + goto finish; + } + break; + case 8: + if (TCG_TARGET_HAS_ext8u_i64) { + tcg_gen_shli_i64(ret, arg, ofs); + tcg_gen_ext8u_i64(ret, ret); + goto finish; + } + break; + } + tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); + tcg_gen_shli_i64(ret, ret, ofs); + + finish: + tcg_gen_ori_i64(ret, ret, i); +} + void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, unsigned int ofs, unsigned int len) { @@ -2242,6 +2360,14 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, tcg_gen_mov_i64(ret, arg2); return; } + + /* Deposit of a value into a constant. */ + ts = tcgv_i64_temp(arg1); + if (ts->kind == TEMP_CONST) { + tcg_gen_deposit_i_i64(ret, ts->val, arg2, ofs, len); + return; + } + if (TCG_TARGET_HAS_deposit_i64 && TCG_TARGET_deposit_i64_valid(ofs, len)) { tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, arg1, arg2, ofs, len); return; @@ -2311,80 +2437,7 @@ void tcg_gen_deposit_z_i64(TCGv_i64 ret, TCGv_i64 arg, tcg_debug_assert(len <= 64); tcg_debug_assert(ofs + len <= 64); - if (ofs + len == 64) { - tcg_gen_shli_i64(ret, arg, ofs); - } else if (ofs == 0) { - tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); - } else if (TCG_TARGET_HAS_deposit_i64 - && TCG_TARGET_deposit_i64_valid(ofs, len)) { - TCGv_i64 zero = tcg_constant_i64(0); - tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, zero, arg, ofs, len); - } else { - if (TCG_TARGET_REG_BITS == 32) { - if (ofs >= 32) { - tcg_gen_deposit_z_i32(TCGV_HIGH(ret), TCGV_LOW(arg), - ofs - 32, len); - tcg_gen_movi_i32(TCGV_LOW(ret), 0); - return; - } - if (ofs + len <= 32) { - tcg_gen_deposit_z_i32(TCGV_LOW(ret), TCGV_LOW(arg), ofs, len); - tcg_gen_movi_i32(TCGV_HIGH(ret), 0); - return; - } - } - /* To help two-operand hosts we prefer to zero-extend first, - which allows ARG to stay live. */ - switch (len) { - case 32: - if (TCG_TARGET_HAS_ext32u_i64) { - tcg_gen_ext32u_i64(ret, arg); - tcg_gen_shli_i64(ret, ret, ofs); - return; - } - break; - case 16: - if (TCG_TARGET_HAS_ext16u_i64) { - tcg_gen_ext16u_i64(ret, arg); - tcg_gen_shli_i64(ret, ret, ofs); - return; - } - break; - case 8: - if (TCG_TARGET_HAS_ext8u_i64) { - tcg_gen_ext8u_i64(ret, arg); - tcg_gen_shli_i64(ret, ret, ofs); - return; - } - break; - } - /* Otherwise prefer zero-extension over AND for code size. */ - switch (ofs + len) { - case 32: - if (TCG_TARGET_HAS_ext32u_i64) { - tcg_gen_shli_i64(ret, arg, ofs); - tcg_gen_ext32u_i64(ret, ret); - return; - } - break; - case 16: - if (TCG_TARGET_HAS_ext16u_i64) { - tcg_gen_shli_i64(ret, arg, ofs); - tcg_gen_ext16u_i64(ret, ret); - return; - } - break; - case 8: - if (TCG_TARGET_HAS_ext8u_i64) { - tcg_gen_shli_i64(ret, arg, ofs); - tcg_gen_ext8u_i64(ret, ret); - return; - } - break; - } - tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); - tcg_gen_shli_i64(ret, ret, ofs); - } + tcg_gen_deposit_i_i64(ret, 0, arg, ofs, len); } void tcg_gen_extract_i64(TCGv_i64 ret, TCGv_i64 arg, From patchwork Fri Oct 20 20:42:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736319 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502672wrl; Fri, 20 Oct 2023 13:50:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExihLFQq8+w35xAfkkL2OgnSf1a1pcHcZMSfnXyA8/ePtL19BSXqHFX8CdoCuGKGPBIPdM X-Received: by 2002:a05:620a:4720:b0:777:71d7:fae8 with SMTP id bs32-20020a05620a472000b0077771d7fae8mr3294386qkb.50.1697835039894; Fri, 20 Oct 2023 13:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835039; cv=none; d=google.com; s=arc-20160816; b=GvjBYzQDz8rwTZaNnDauGz0yxiY3fuaNTuQ9xqBRhY+QwznatleCcRVRyh08OJsihQ ix6fs84S9J/qd9oBki/gVCS3nYygxmTSw1nv5Yh0gGXSXYJuq9E5Jcap3U7Yb/DTW3dJ CeaftPCRBKCkM5fUg+vGSa/LvpEH+/M3D8ybTNYCpvUC+JtHo8atKJKhmvbp5XtpYd3i zP+Cnu5MFcHGFed2Xc33bOfcQlDXt7evhc0h7dzu44c/Qqf4IlsGcEC/OdXKbQcR/vFX fASDFnSBCweZE/CMLZbTI5AQjDqsItG7Jl16FAwiEHjHpAP+AwCsCQZtS+12meDjO8ME dhvg== 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=EEVa0UToFhXataikrG28OSq2vCy6h8vLUqtzrSHrlk8=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=ex+b6yrCbx0qBHsBipyT6kHaZOrIny6j3LUOSD5K9p/746TnEdCj1c0zm3/uSz97RS IjBQioX4ev/IZ6r7i3PzYSgOv+BSdZroMztGN2YLIqvShE7Yif47jPT7T/zdB391A6g1 dITYKT4eSNkM3H0RgfWrXtqaaxNgvW6lEJv0zlrCWNytIbiqOyxHbjCpYh0fkdZL0pwA rQju4mtZZAOjF578E9ifnSZcijZMx2GiUxU+s7nAz8F0g61djKzYJ9Xc4dGrd6s8+XAa +LvsaUsGcjpPk3FlZ41K1GAkWyobINeF8hmdAvHjvAO9xmqF2sEqk/GFwWQM4PEhCQwJ ZdvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FiHA/uDI"; 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 g21-20020a05620a40d500b0077429eb9588si1939827qko.326.2023.10.20.13.50.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50:39 -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="FiHA/uDI"; 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 1qtwLq-0007oL-EC; Fri, 20 Oct 2023 16:44:10 -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 1qtwLL-0007ft-St for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:39 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLJ-00088H-Mz for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:39 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6bd0e1b1890so1095352b3a.3 for ; Fri, 20 Oct 2023 13:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834616; x=1698439416; 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=EEVa0UToFhXataikrG28OSq2vCy6h8vLUqtzrSHrlk8=; b=FiHA/uDIV9XFAaj/zdJdSGoX9N3o6t0QR/JKVxJ7t5lYAvXGCpHAlAi7keRiYBCuS3 P0baMmmC3SBR1lSn3MSrDCDQrqizc8GOt1ftrQAb0vcWtVEpeJ+nTSVHylyVvXtJgnP2 FtUbPMGgoQTFd5r6c4HsJaRuuCD9kyYZkKay8kdPej5hbd5XfNxIg7CeD8wlanNVvaQZ 7xQYK2rUEv3tgA219/BRt1yuT80ryOLcSq+7vTyR5wxEwy1psDv1ZofZtGt/Z4UiODPE FD5zF+QhxxEOSWaArdwg9MEZE0hvwZUSQUSzjtp9nT+fPrciM6alcZCwmjs3Mio+a5nw Er1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834616; x=1698439416; 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=EEVa0UToFhXataikrG28OSq2vCy6h8vLUqtzrSHrlk8=; b=gNaRuw+SUG8oYRmzip9UQh4InYorUHVdW51ALXFyEC6NW59O+ZE7pmMCeMCr4B7vJh ABeg6QaSky0rXp0zz7MQt+oqO48/+HNzcwUdPIFyaMhIZ9U1pQnlkOc6MvwumeiYV3nm BrK3UQ1nFWgR9j3NX1t/0jIyCdhCr5IWvgyb9aTu5TtOjFCJZ26nrZt6PQlTa49mzae2 9dupmWU1oWrU3SAwGka6mu6gEg6zsMTeewLReLX6BgjNFx0rY+9GtsoRwwTQeId0Inax RQ/LPi3sNR1bU9Ja+d/VDjGVR5AWJh3u8gwQlCuu5XqemFN8k4TJT7zPAeCwyMy4IXWy BjVA== X-Gm-Message-State: AOJu0YwBOunYQ5ZRnbTB7/egF1s8SZiK5bd2D10NhZoOjprEo9uKCt94 w9M38NQgnY6DUSeZ/km6SyqUzejXQ5yizFVver4= X-Received: by 2002:a05:6a00:194c:b0:6b7:18c1:c09a with SMTP id s12-20020a056a00194c00b006b718c1c09amr2737723pfk.5.1697834616278; Fri, 20 Oct 2023 13:43:36 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 03/65] target/hppa: Remove get_temp Date: Fri, 20 Oct 2023 13:42:29 -0700 Message-Id: <20231020204331.139847-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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 Replace with tcg_temp_new without recording into ctx. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 76 +++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 45 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 9f3ba9f42f..3065fbf625 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -254,8 +254,7 @@ typedef struct DisasContext { target_ureg iaoq_n; TCGv_reg iaoq_n_var; - int ntempr, ntempl; - TCGv_reg tempr[8]; + int ntempl; TCGv_tl templ[4]; DisasCond null_cond; @@ -492,13 +491,6 @@ static void cond_free(DisasCond *cond) } } -static TCGv_reg get_temp(DisasContext *ctx) -{ - unsigned i = ctx->ntempr++; - g_assert(i < ARRAY_SIZE(ctx->tempr)); - return ctx->tempr[i] = tcg_temp_new(); -} - #ifndef CONFIG_USER_ONLY static TCGv_tl get_temp_tl(DisasContext *ctx) { @@ -510,7 +502,7 @@ static TCGv_tl get_temp_tl(DisasContext *ctx) static TCGv_reg load_const(DisasContext *ctx, target_sreg v) { - TCGv_reg t = get_temp(ctx); + TCGv_reg t = tcg_temp_new(); tcg_gen_movi_reg(t, v); return t; } @@ -518,7 +510,7 @@ static TCGv_reg load_const(DisasContext *ctx, target_sreg v) static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { - TCGv_reg t = get_temp(ctx); + TCGv_reg t = tcg_temp_new(); tcg_gen_movi_reg(t, 0); return t; } else { @@ -529,7 +521,7 @@ static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) static TCGv_reg dest_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0 || ctx->null_cond.c != TCG_COND_NEVER) { - return get_temp(ctx); + return tcg_temp_new(); } else { return cpu_gr[reg]; } @@ -1071,7 +1063,7 @@ static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, static TCGv_reg do_add_sv(DisasContext *ctx, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) { - TCGv_reg sv = get_temp(ctx); + TCGv_reg sv = tcg_temp_new(); TCGv_reg tmp = tcg_temp_new(); tcg_gen_xor_reg(sv, res, in1); @@ -1085,7 +1077,7 @@ static TCGv_reg do_add_sv(DisasContext *ctx, TCGv_reg res, static TCGv_reg do_sub_sv(DisasContext *ctx, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) { - TCGv_reg sv = get_temp(ctx); + TCGv_reg sv = tcg_temp_new(); TCGv_reg tmp = tcg_temp_new(); tcg_gen_xor_reg(sv, res, in1); @@ -1108,20 +1100,20 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, cb_msb = NULL; if (shift) { - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_shli_reg(tmp, in1, shift); in1 = tmp; } if (!is_l || cond_need_cb(c)) { TCGv_reg zero = tcg_constant_reg(0); - cb_msb = get_temp(ctx); + cb_msb = tcg_temp_new(); tcg_gen_add2_reg(dest, cb_msb, in1, zero, in2, zero); if (is_c) { tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, cpu_psw_cb_msb, zero); } if (!is_l) { - cb = get_temp(ctx); + cb = tcg_temp_new(); tcg_gen_xor_reg(cb, in1, in2); tcg_gen_xor_reg(cb, cb, dest); } @@ -1414,11 +1406,11 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, /* Note that RX is mutually exclusive with DISP. */ if (rx) { - ofs = get_temp(ctx); + ofs = tcg_temp_new(); tcg_gen_shli_reg(ofs, cpu_gr[rx], scale); tcg_gen_add_reg(ofs, ofs, base); } else if (disp || modify) { - ofs = get_temp(ctx); + ofs = tcg_temp_new(); tcg_gen_addi_reg(ofs, base, disp); } else { ofs = base; @@ -1538,7 +1530,7 @@ static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, dest = dest_gpr(ctx, rt); } else { /* Make sure if RT == RB, we see the result of the load. */ - dest = get_temp(ctx); + dest = tcg_temp_new(); } do_load_reg(ctx, dest, rb, rx, scale, disp, sp, modify, mop); save_gpr(ctx, rt, dest); @@ -1854,7 +1846,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, if (link != 0) { copy_iaoq_entry(cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } - next = get_temp(ctx); + next = tcg_temp_new(); tcg_gen_mov_reg(next, dest); if (is_n) { if (use_nullify_skip(ctx)) { @@ -1896,7 +1888,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, a1 = ctx->null_cond.a1; tmp = tcg_temp_new(); - next = get_temp(ctx); + next = tcg_temp_new(); copy_iaoq_entry(tmp, ctx->iaoq_n, ctx->iaoq_n_var); tcg_gen_movcond_reg(c, next, a0, a1, tmp, dest); @@ -1938,11 +1930,11 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) return offset; case 3: /* Privilege 3 is minimum and is never allowed to increase. */ - dest = get_temp(ctx); + dest = tcg_temp_new(); tcg_gen_ori_reg(dest, offset, 3); break; default: - dest = get_temp(ctx); + dest = tcg_temp_new(); tcg_gen_andi_reg(dest, offset, -4); tcg_gen_ori_reg(dest, dest, ctx->privilege); tcg_gen_movcond_reg(TCG_COND_GTU, dest, dest, offset, dest, offset); @@ -2104,7 +2096,7 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) break; } - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); save_gpr(ctx, rt, tmp); @@ -2177,7 +2169,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) case CR_IIAOQ: /* FIXME: Respect PSW_Q bit */ /* The write advances the queue and stores to the back element. */ - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr_back[ctl - CR_IIASQ])); tcg_gen_st_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); @@ -2243,7 +2235,7 @@ static bool trans_rsm(DisasContext *ctx, arg_rsm *a) nullify_over(ctx); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, psw)); tcg_gen_andi_reg(tmp, tmp, ~a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); @@ -2263,7 +2255,7 @@ static bool trans_ssm(DisasContext *ctx, arg_ssm *a) nullify_over(ctx); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, psw)); tcg_gen_ori_reg(tmp, tmp, a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); @@ -2283,7 +2275,7 @@ static bool trans_mtsm(DisasContext *ctx, arg_mtsm *a) nullify_over(ctx); reg = load_gpr(ctx, a->r); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); gen_helper_swap_system_mask(tmp, tcg_env, reg); /* Exit the TB to recognize new interrupts. */ @@ -2692,7 +2684,7 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf *a, bool is_tc) } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_not_reg(tmp, tcg_r2); do_unit(ctx, a->t, tcg_r1, tmp, a->cf, is_tc, tcg_gen_add_reg); return nullify_end(ctx); @@ -2714,7 +2706,7 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf *a, bool is_i) nullify_over(ctx); - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_shri_reg(tmp, cpu_psw_cb, 3); if (!is_i) { tcg_gen_not_reg(tmp, tmp); @@ -2866,7 +2858,7 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) if (a->m) { /* Base register modification. Make sure if RT == RB, we see the result of the load. */ - dest = get_temp(ctx); + dest = tcg_temp_new(); } else { dest = dest_gpr(ctx, a->t); } @@ -2992,7 +2984,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, DisasCond cond; in2 = load_gpr(ctx, r); - dest = get_temp(ctx); + dest = tcg_temp_new(); tcg_gen_sub_reg(dest, in1, in2); @@ -3029,7 +3021,7 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, cb_msb = NULL; if (cond_need_cb(c)) { - cb_msb = get_temp(ctx); + cb_msb = tcg_temp_new(); tcg_gen_movi_reg(cb_msb, 0); tcg_gen_add2_reg(dest, cb_msb, in1, cb_msb, in2, cb_msb); } else { @@ -3388,7 +3380,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) nullify_over(ctx); #endif - tmp = get_temp(ctx); + tmp = tcg_temp_new(); tcg_gen_addi_reg(tmp, load_gpr(ctx, a->b), a->disp); tmp = do_ibranch_priv(ctx, tmp); @@ -3485,7 +3477,7 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) static bool trans_blr(DisasContext *ctx, arg_blr *a) { if (a->x) { - TCGv_reg tmp = get_temp(ctx); + TCGv_reg tmp = tcg_temp_new(); tcg_gen_shli_reg(tmp, load_gpr(ctx, a->x), 3); tcg_gen_addi_reg(tmp, tmp, ctx->iaoq_f + 8); /* The computation here never changes privilege level. */ @@ -3503,7 +3495,7 @@ static bool trans_bv(DisasContext *ctx, arg_bv *a) if (a->x == 0) { dest = load_gpr(ctx, a->b); } else { - dest = get_temp(ctx); + dest = tcg_temp_new(); tcg_gen_shli_reg(dest, load_gpr(ctx, a->x), 3); tcg_gen_add_reg(dest, dest, load_gpr(ctx, a->b)); } @@ -3834,7 +3826,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) nullify_over(ctx); - t = get_temp(ctx); + t = tcg_temp_new(); tcg_gen_ld32u_reg(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); if (a->y == 1) { @@ -4089,9 +4081,7 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4; ctx->base.max_insns = MIN(ctx->base.max_insns, bound); - ctx->ntempr = 0; ctx->ntempl = 0; - memset(ctx->tempr, 0, sizeof(ctx->tempr)); memset(ctx->templ, 0, sizeof(ctx->templ)); } @@ -4140,7 +4130,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) This will be overwritten by a branch. */ if (ctx->iaoq_b == -1) { ctx->iaoq_n = -1; - ctx->iaoq_n_var = get_temp(ctx); + ctx->iaoq_n_var = tcg_temp_new(); tcg_gen_addi_reg(ctx->iaoq_n_var, cpu_iaoq_b, 4); } else { ctx->iaoq_n = ctx->iaoq_b + 4; @@ -4161,13 +4151,9 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) } /* Forget any temporaries allocated. */ - for (i = 0, n = ctx->ntempr; i < n; ++i) { - ctx->tempr[i] = NULL; - } for (i = 0, n = ctx->ntempl; i < n; ++i) { ctx->templ[i] = NULL; } - ctx->ntempr = 0; ctx->ntempl = 0; /* Advance the insn queue. Note that this check also detects From patchwork Fri Oct 20 20:42:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736305 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502027wrl; Fri, 20 Oct 2023 13:48:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbbgSORHWztKPgq/dlVlavPSsb3dlHKWaSsEKTjard7nt1pRXhE3mZ6ERk8xYgdWCNs0Rw X-Received: by 2002:a05:620a:4407:b0:774:20b7:b88 with SMTP id v7-20020a05620a440700b0077420b70b88mr9773119qkp.0.1697834898543; Fri, 20 Oct 2023 13:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834898; cv=none; d=google.com; s=arc-20160816; b=IVvKTkEXhAIPJgKU6UBURGqwr0V0HMkFT8bpF9STen207rxNii2va65MiVw7gB6LOn MEAZH3BopC0hrM7UedwwmpIKx41Ivk9Q5FRPOAkjam14Y6U1aije3PMj3pgdEJrZ2/lL mEQu1utcUzsm9hwAeucW1mDv0nxxV4diSG+k/w4eiT6NOCr7auQ39v7ptcNoFGxag8Md HbXQltU4AJbbUFNykmMlc5Hr/GnuhgMAs8wTvJkL8PIaGgoFgOJCSyJwbYiurmb/en4m oyAFfU6E88joZ3tQf+16FWOKp8aRhhR/67VBOoZ+QxCwPQZ9EovSbs+xpqBBd4hk9gpi wwFA== 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=cad+KwQheUGAcPjvv3O2I1LwfS0pIqR17J6IWZnIATQ=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=BLe8dlC8kpacppjEWixfs09UBBjV3kB9YmXkwBVKZf2CNxl8vVIeksDEYPegaXxb1/ b28QFTkTvviPXp2N3naVUueEmtJu0NPw3giF1nzmcYrUHWoLI8wM02CwbO32Ysb6r4yc WzecumDBsCaj7iHU5GUVUomd3p0WyI0/gtiK/UvEpMCE3MwnhiSr3961TVm9ALwXizOK PgSkU3AOb/1dsfizp3wyC3ijOzAG2UWAIfXCXcfLF1ofexz0Rw3dedVIRRdzM+12xo1g wj4WuCUS3nPXnkCIPSdZJ2bKArS6neY6q7Ok5siHc2cNf32USU4HEY9FkuDqdBvVNIRo j35w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yrLd8eln; 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 fb16-20020ad44f10000000b0066d0edaf8fcsi1917338qvb.349.2023.10.20.13.48.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:48:18 -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=yrLd8eln; 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 1qtwLT-0007iY-Qe; Fri, 20 Oct 2023 16:43:48 -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 1qtwLM-0007gV-DY for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:40 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLK-00088d-Nn for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:40 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso996524b3a.1 for ; Fri, 20 Oct 2023 13:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834617; x=1698439417; 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=cad+KwQheUGAcPjvv3O2I1LwfS0pIqR17J6IWZnIATQ=; b=yrLd8elnFUXOPkMWbt7snigo7S8/mpPGXZad+c4iuMVkhqRUTENPF2vKEvl4tjGCry 2n7SRxex6CoPTmXwo5WMnyhhcmmUpR5OMOaxD0wxwQOuMPPiWtI3DhYos9d9tV/jardS 0tI3eRNSNyD2MTN3AFwBceYkk1FdpPvFlZiF6AxmMbu9MuJyGMea1+ScVB1rN9y5MwuH vafhPBL7/fEt+QJq62M2iOxvhH3qouARVbcVfDOT/ywvAFYV3m9jH59Ajk7D79encrv2 ZDb+C+unTvHHVfQvFiOXhwyQ+W1/e+zcD0ABkO9ToNfCKiHSrWGjMuJwn1CqwTpQpse0 6W8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834617; x=1698439417; 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=cad+KwQheUGAcPjvv3O2I1LwfS0pIqR17J6IWZnIATQ=; b=TRy2IkE9v3W+Kgr8SZgqm3zgpxrAaoBx+a0fgdXYuoe/YaQIe9yomuKfuLQHmU36bn /7aRsxmQ6wMCzrr04/nl1W++2SWW72rxr3zkIj6Few5yNKHlAipgCUEGOiEkKfQLzKEz vFYo/6gE3h1xwyp8/JTrspgjbgeYLlsFTqDSJ/M+Ay31NkTweVQ+1UN4wz7wOLmN4MaD uS2fZZxBVN/oaEy0o8WH2Yx+Q0YKR+EX3l2P4gbUFlP30lhBfIQiur3v8afbRyx20/wR AjBl66P2/3TItTgR/8UKr7CF/1dbqbRCngJIj/yzOZ7Gz8FUvoWX/EqMIVSs6CyetArw W/Yg== X-Gm-Message-State: AOJu0YzKCkwy4BF6efVy0WhVqpmBL4J4JXPWvfikuwT0XkqTXpNhKSLi 2XopIZ46E1onWTUqXiQ/j21b0MPFg1sGDwgKAMI= X-Received: by 2002:a05:6a20:e125:b0:f0:50c4:4c43 with SMTP id kr37-20020a056a20e12500b000f050c44c43mr4314914pzb.5.1697834617169; Fri, 20 Oct 2023 13:43:37 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 04/65] target/hppa: Remove get_temp_tl Date: Fri, 20 Oct 2023 13:42:30 -0700 Message-Id: <20231020204331.139847-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 Replace with tcg_temp_new_tl without recording into ctx. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 3065fbf625..5302381a56 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -254,9 +254,6 @@ typedef struct DisasContext { target_ureg iaoq_n; TCGv_reg iaoq_n_var; - int ntempl; - TCGv_tl templ[4]; - DisasCond null_cond; TCGLabel *null_lab; @@ -491,15 +488,6 @@ static void cond_free(DisasCond *cond) } } -#ifndef CONFIG_USER_ONLY -static TCGv_tl get_temp_tl(DisasContext *ctx) -{ - unsigned i = ctx->ntempl++; - g_assert(i < ARRAY_SIZE(ctx->templ)); - return ctx->templ[i] = tcg_temp_new_tl(); -} -#endif - static TCGv_reg load_const(DisasContext *ctx, target_sreg v) { TCGv_reg t = tcg_temp_new(); @@ -1374,7 +1362,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) if (sp < 0) { sp = ~sp; } - spc = get_temp_tl(ctx); + spc = tcg_temp_new_tl(); load_spr(ctx, spc, sp); return spc; } @@ -1384,7 +1372,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) ptr = tcg_temp_new_ptr(); tmp = tcg_temp_new(); - spc = get_temp_tl(ctx); + spc = tcg_temp_new_tl(); tcg_gen_shri_reg(tmp, base, TARGET_REGISTER_BITS - 5); tcg_gen_andi_reg(tmp, tmp, 030); @@ -1420,7 +1408,7 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, #ifdef CONFIG_USER_ONLY *pgva = (modify <= 0 ? ofs : base); #else - TCGv_tl addr = get_temp_tl(ctx); + TCGv_tl addr = tcg_temp_new_tl(); tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); if (ctx->tb_flags & PSW_W) { tcg_gen_andi_tl(addr, addr, 0x3fffffffffffffffull); @@ -4080,9 +4068,6 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) /* Bound the number of instructions by those left on the page. */ bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4; ctx->base.max_insns = MIN(ctx->base.max_insns, bound); - - ctx->ntempl = 0; - memset(ctx->templ, 0, sizeof(ctx->templ)); } static void hppa_tr_tb_start(DisasContextBase *dcbase, CPUState *cs) @@ -4111,7 +4096,6 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) DisasContext *ctx = container_of(dcbase, DisasContext, base); CPUHPPAState *env = cpu_env(cs); DisasJumpType ret; - int i, n; /* Execute one insn. */ #ifdef CONFIG_USER_ONLY @@ -4150,12 +4134,6 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) } } - /* Forget any temporaries allocated. */ - for (i = 0, n = ctx->ntempl; i < n; ++i) { - ctx->templ[i] = NULL; - } - ctx->ntempl = 0; - /* Advance the insn queue. Note that this check also detects a priority change within the instruction queue. */ if (ret == DISAS_NEXT && ctx->iaoq_b != ctx->iaoq_f + 4) { From patchwork Fri Oct 20 20:42:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736323 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502719wrl; Fri, 20 Oct 2023 13:50:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlZNEiqTg4vZhGJMKRqSVQFOmgbgTJxQPmd2dk5L4+EWD3CIIXJjyWIUuhmLDH9xSaNYHy X-Received: by 2002:a05:620a:2b8c:b0:773:d86f:ec88 with SMTP id dz12-20020a05620a2b8c00b00773d86fec88mr2838400qkb.35.1697835051817; Fri, 20 Oct 2023 13:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835051; cv=none; d=google.com; s=arc-20160816; b=nN6kg0EDugs0iGLY3J2+Yhj7CnhIWNFaRnIZeHEjsB4qn9IjDjwFtX4KP2mKMCB9rD cknNRXrFZwN3IIjTaypl0lyvcIAA854fjD+K9KMLkRhYAyI1dQKJ9vnMs3cc1pze8t4l MPWiwZ4ONNW9GXLAqfY0NZq8TCliFK+Mgt+7gNa5ASKoo7gX+GCb9rQlX6LUGVlxesHq rRr0MOpL0pmRESAuhrdnrTJntvVZwEixFlNsGsg8z1VyB8Ctlgk+YALiVaggwyyqnJ4u 2lyPlPzLbAuncK5T2SmLQl5J6YYjIrTs4AB0I5/dGXaHrDhM0ESX+h81YzipzsOeu2jh NGOw== 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=mNZMizemvrujc4XnqyNiXy5WpOSPf3XvMMBFfWR0das=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=PL7j8pYWj0syEKoWnKSmlKODt0hZxzXEq49WQqkb2g3aa6lbj4Dq8dej77vzk11ACD FiGtlCU6xcUaadPL7tWEMv6d3EuaKdecGbxhx+gR9TIc8SQN5zWqRXUKO6y1bo4tXLyR V6nY6dLs+4hCkhrutDkt4FX4xdZBBZvnnITc8eGXzL2VGb23g0AYWaAigQ/cEXw3/PCm jI/EUH3vt5hoCiLPd189EEuuw8tQBAojWDh15G4nrOJDsQTEPzsnSP84y9WPYJXQVZQu lEDMMzcpkX+5++USxiQ6+r6dhcrzxR+gjEI6A6umCpc2mPU/EiNN5J09SpUv8CHa8gMG 4RVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RnmRBdrI; 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 d13-20020a37c40d000000b007706c5a23f6si1936297qki.175.2023.10.20.13.50.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50: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=RnmRBdrI; 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 1qtwLq-0007oi-Ex; Fri, 20 Oct 2023 16:44:10 -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 1qtwLN-0007hh-Pp for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:42 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLM-00088k-53 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:41 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6be0277c05bso1102452b3a.0 for ; Fri, 20 Oct 2023 13:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834618; x=1698439418; 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=mNZMizemvrujc4XnqyNiXy5WpOSPf3XvMMBFfWR0das=; b=RnmRBdrI+h5w9HRYz5jsc0pzZA+pd/07bKZNk8Au1qN48sQiBy5lFCgv9e/RtuLL1q GiEs+2tuuz1a8ncXaT2Cq23IvAFsJlYVKN/g0vQiPh6YDH9HsHucPG8y8Ar5D9NAJjbF MoIVwKnFUx5adszealubgwGKkZ6+U9ZEVqqRv98m776tw60lSouaS52qEMg8II1i1Hrj FhHDoKS356gCCWuigb3/G7XeHUa44lhWBJ7cfoUvt5m2Ddatygycs4EePh4iGrV6qRHP NrGPtQ8L0E13C1V+tO5PgLaa0372IWgR0JkylgTmYtRi6eXWVatAkknXLewv0fND5moa c1/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834618; x=1698439418; 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=mNZMizemvrujc4XnqyNiXy5WpOSPf3XvMMBFfWR0das=; b=qyTcaXOfhuDSQQXn0C3g4v1x/7jngbDGdcNQ2kz3tCK9ZX0aCCZn/ENeq2cs4V6BOD TOl4ltFaN5Xkx/hk22oWWD3MJXYqWSmfyG40pZXZaTpFL05J8RHYMfQJY9oAZSAOuaj7 V5THhE6i5LtwZBQgiZC16qeGXt+ZkYGsOgJeBGBgUgjdi41qnkK+yA3GGzkezbXbB68M lrW1FZT2JEmcDwASPpZ52EfrS9hJfEQJHm9hL1hMqAzXttaFE999cBvUYenGhVsu9Q1A Fjfo/Q1PLpGfKviXO1x+eO8w4+3dq5INb6+hN9YSY8yDMMFOUlj587SwxDP+k+723ocs encQ== X-Gm-Message-State: AOJu0YyHbqR59Y7f+Ot2NLhZ0q6yHGNJsHhDv96/FdXuBeZl7RRyuDyS PgP/R5SrFydDoe+Rc7UaHOBuWI0oY+azrmcSRsc= X-Received: by 2002:a05:6a20:728c:b0:15a:836:7239 with SMTP id o12-20020a056a20728c00b0015a08367239mr3260263pzk.11.1697834618352; Fri, 20 Oct 2023 13:43:38 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 05/65] target/hppa: Remove load_const Date: Fri, 20 Oct 2023 13:42:31 -0700 Message-Id: <20231020204331.139847-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 Replace with tcg_constant_reg. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/hppa/translate.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 5302381a56..21f97f63a9 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -488,13 +488,6 @@ static void cond_free(DisasCond *cond) } } -static TCGv_reg load_const(DisasContext *ctx, target_sreg v) -{ - TCGv_reg t = tcg_temp_new(); - tcg_gen_movi_reg(t, v); - return t; -} - static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { @@ -1164,7 +1157,7 @@ static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, if (a->cf) { nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf); return nullify_end(ctx); @@ -1253,7 +1246,7 @@ static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) if (a->cf) { nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf); return nullify_end(ctx); @@ -2808,7 +2801,7 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf *a) nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf); @@ -2994,7 +2987,7 @@ static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a) static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) { nullify_over(ctx); - return do_cmpb(ctx, a->r, load_const(ctx, a->i), a->c, a->f, a->n, a->disp); + return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); } static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, @@ -3033,7 +3026,7 @@ static bool trans_addb(DisasContext *ctx, arg_addb *a) static bool trans_addbi(DisasContext *ctx, arg_addbi *a) { nullify_over(ctx); - return do_addb(ctx, a->r, load_const(ctx, a->i), a->c, a->f, a->n, a->disp); + return do_addb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); } static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) @@ -3345,7 +3338,7 @@ static bool trans_depwi_sar(DisasContext *ctx, arg_depwi_sar *a) if (a->c) { nullify_over(ctx); } - return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, load_const(ctx, a->i)); + return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, tcg_constant_reg(a->i)); } static bool trans_be(DisasContext *ctx, arg_be *a) @@ -3852,7 +3845,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) return true; } if (inv) { - TCGv_reg c = load_const(ctx, mask); + TCGv_reg c = tcg_constant_reg(mask); tcg_gen_or_reg(t, t, c); ctx->null_cond = cond_make(TCG_COND_EQ, t, c); } else { From patchwork Fri Oct 20 20:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736347 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503787wrl; Fri, 20 Oct 2023 13:54:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErT8GmAPYj93WEPzRhtYArf6LApcPccdhG3P6WuKhvu4CGIWvHyUDkVVmDfiCii3Kea7Aj X-Received: by 2002:a05:6214:501b:b0:66d:81bb:5234 with SMTP id jo27-20020a056214501b00b0066d81bb5234mr4723482qvb.11.1697835287480; Fri, 20 Oct 2023 13:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835287; cv=none; d=google.com; s=arc-20160816; b=e5SAE75WpjZvqS9pVUwJsBPsu6US0xt0Vp0BXTK3Wx3XpbXrNp6Q/av5cRjspFWlY6 v/A441cxgdv7+bmeP8LS8RnAQW2xOJXVAm/e9MgDzaDQidiG8Yqu1HT8A5azZzGiDhex Neoa7WsmI7wIrwMwzOIw4hJcA08SPF3UciQWd9YIVBVeMrOdUZWOir5AtSQVGQdVfgyo 8Em4MwANf8wl9W3TIPkG5pYEn9xC5yfZmgDCTxf6dMzGJgHTvAfLSH4UXupqY3CtrJ2u OL1/nKOKh9CVjFVVvsUI1elihVaqEftnDqxAcyDnFdCWd9b0FuXl5RzXdK1eDL18PD4y vaAA== 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=F2CpBYHyN5WTjKAnF9eC52gwF9DPW7ui+s7AIy3W9Zs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=XDiZ4GWi8GdMAAR6ePgHltiX3CkqH1O1r0mgQFwtIzcy6lhX3jxf/NidJuLfHt81n3 ohyXqrOMRqVPPkPTFbyb/atKXT2HN0KplckQhrI/uJgp4HOiAOkJQwsQxLN84aC0AAPQ hZ4FBij7R2yGw5ciVTXhsjSN1iyUO7z/sY2ytSuARn+cUGb1mPS0dHN+wTEMOY1o2RkJ z54iHCjSiJMDWDrnTuUtOuXIY7eMqpDqge5mpYFa95ZmCrBV/RUyw6Lsa0aDV0vc1Zt1 zVhWzJfwVHylHqQbqXMvGE/0qziVWO+5nSsSkcXKVlBC2ju31uBFRKSzDkrA98mWdy4Q 1oLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pImwqOd/"; 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 e4-20020a056214162400b00656304f4f1esi1970451qvw.421.2023.10.20.13.54.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:47 -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="pImwqOd/"; 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 1qtwLr-0007p3-AS; Fri, 20 Oct 2023 16:44:11 -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 1qtwLO-0007hp-29 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:42 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLM-00088x-Hl for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:41 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso996538b3a.1 for ; Fri, 20 Oct 2023 13:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834619; x=1698439419; 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=F2CpBYHyN5WTjKAnF9eC52gwF9DPW7ui+s7AIy3W9Zs=; b=pImwqOd/1AE+NzS0DLx3mHVnCxK6ZP0NwiA/mCv3t17g7qVml1OWE3lVM8p31Gqfcz RNw3nIydILK45fDD3/HdX1bKHR8gTSsNHs72YBcIrv3JBZe9E+v/LFTClVUxkVHQ2Csk PuA4gsvhqS/dWK2SSmTIFQIBS3bg5QuLlRLJ+If/HvRVORf1iEs2Z2rsv+xBofbhf7wv PYb9RNqxpzK9VFlubISvOq+9oXmXlE/oTRBr6SKA5pAzcSulf4cDMXpiet7ZBqTDEA+I UpUhJ5HbH13/HrNofDVZHTzZl2rD9MsC3gp91Fbam4JW8ZA+JQtREvfSB9pS9AvZNCAz QUFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834619; x=1698439419; 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=F2CpBYHyN5WTjKAnF9eC52gwF9DPW7ui+s7AIy3W9Zs=; b=k8yoeXCw0135Dd8F3zSbRrEx6KKClkY9EnmR2d58fOjxeOu7yv4Ehfy32RgVNT6FM/ YvdS8x0lLxsKRB6sz04OnVhbYJlhCK4C2q6T2yj13/Lo6befUTArtbfRVdPoOg2IeWx2 K43gngya7my5l4HjgxbyMrWr+LEEyr9eiIaZOSVMZ67LervQPSQplMFBPxaM/kOOdqK+ Ez6S3A39Y+dePzPqHmASeoUqYLTtz0Pdoce5Hgb7G4MFSZm6BU5KN+rwZKWj7R178jGr HlTqp75wM2zj0+qBYRNNOZPHeAP86ComH7GEbtsTxiqsKtWwrUbdEOtAwmrU2ITb246h SqLg== X-Gm-Message-State: AOJu0Yw6Nig2rdPC5oKwLPuU//HI2wgiVOSAS+hQwqYqAXQfmW+BnHKu BbgKnF+6wYuUglkpDgiCKmjqc+uq6v7hT0DpDOM= X-Received: by 2002:a05:6a20:144c:b0:159:e4ab:15ce with SMTP id a12-20020a056a20144c00b00159e4ab15cemr4053103pzi.15.1697834619119; Fri, 20 Oct 2023 13:43:39 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 06/65] target/hppa: Fix hppa64 case in machine.c Date: Fri, 20 Oct 2023 13:42:32 -0700 Message-Id: <20231020204331.139847-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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 Typo of VMSTATE_UINTTR_V and VMSTATE_UINTTR_ARRAY_V macros. Signed-off-by: Richard Henderson --- target/hppa/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/machine.c b/target/hppa/machine.c index 905991d7f9..0c0bba68c0 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -24,9 +24,9 @@ #if TARGET_REGISTER_BITS == 64 #define qemu_put_betr qemu_put_be64 #define qemu_get_betr qemu_get_be64 -#define VMSTATE_UINTTL_V(_f, _s, _v) \ +#define VMSTATE_UINTTR_V(_f, _s, _v) \ VMSTATE_UINT64_V(_f, _s, _v) -#define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \ +#define VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, _v) \ VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) #else #define qemu_put_betr qemu_put_be32 From patchwork Fri Oct 20 20:42:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736334 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502963wrl; Fri, 20 Oct 2023 13:51:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWlcxDyLjG2QfduBGPM68hKwxBjCYy+sJI161o1FxiKD4uYYWnnnKDyhvIqiZAfyfojKBt X-Received: by 2002:a05:620a:1707:b0:777:2e8b:3446 with SMTP id az7-20020a05620a170700b007772e8b3446mr3068475qkb.55.1697835108124; Fri, 20 Oct 2023 13:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835108; cv=none; d=google.com; s=arc-20160816; b=bvMSEwSTWKhgt8B8AGhjJMwhXCj+ABxcEFtzsFqR/P79G1kl3l68zCCyDr3NpEuZjI I8hXrVvqU0pTpQSzLD1Bzy6AVyoMjKzrCi3fW9fiXgPhK7qSkjM5zQWUP1qP0Lb5E21+ ZYb/n0TI1YmRKbo4xmdZYJAcnWjgdGY5lIrd85unNtGkAhJuIfsBKFbovm8+YVtxKLZJ TWj4agvFHrWf17T6AB39fwp8+lkLPMzjEYsPRvTRbMdyKLKetvR/xT2ZzflpkdPelzsU C+yDrhtybfYfAyzfwbsGqVdyFKTuh5IFHbK9kEQ8gRI1BG3D4BeIgFluhat/KFnudWRd NL1Q== 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=gizyszKoYOssiFVO/W3NqegBEKVfjjL7AQSlumE/K80=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=b0mPf+c2s6ENsS0SuUN8iAurILTukwE6Y7jNq72vWj6LSC2rmGJnVdL67lbGaDdB43 immHMJOMr0Kn+jUIjfVOBgfYiGx+iUgaFfkp3hfHrJ2vFOKZCmB76jJYhtgsFG4mMOdN UI/9VEGGXNsErs4YEzH43Abn7lfnTq2/Lm9Jc7fNGskYVYRFFhdFr9ntHm4p9ik1gHDy 6n26nuKJ4GrdEoGdlh09msGQ/aS06WcY0Mwl0Yd+6S5KQIeae49vLhcfFPB47Kvaap3f GGXhVCtxjyL5KqT6+NOZItsjYl7McaYD7VEGtE4xOCU3XrhewsTWmbmCzDP+JDE/Kquf 4FyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="t6u4/ecE"; 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 e19-20020a05620a209300b0076cb682f501si1949554qka.777.2023.10.20.13.51.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:48 -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="t6u4/ecE"; 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 1qtwLu-0007t8-VJ; Fri, 20 Oct 2023 16:44:14 -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 1qtwLP-0007iH-SX for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:44 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLN-00089G-9Y for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:42 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b3c2607d9bso1163944b3a.1 for ; Fri, 20 Oct 2023 13:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834620; x=1698439420; 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=gizyszKoYOssiFVO/W3NqegBEKVfjjL7AQSlumE/K80=; b=t6u4/ecE9d+4l1w1L/AD+gd9pFhZAsHDD3w66yDJOIIJw5lVU9ue2SeZG3obp/U6GF fLGrNwLYue3AmYzSNudq3NASvxGJJOfVIsNOPbNTCUVv79Am8hxLt/VCzUcYmo6aJLO8 xdSipfKU6VT82J0sgeqXDKzet0Sq/BY0NxTmGazZFcW8Ufzoo7TeuHTQMVp3JcyGNecm pmRfBLoPThHFowT15sCJKDyGf0srQmUwFXDDaoCEjeczhwKeuYe5IYuYBNc4cDp5SwLS nBB1K5YXhxUML0/JG0UFgLhFCSZAQoCAfc1BD0QwAqbOCZ7sBARIPoJ5ibh4AALdSICW /+iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834620; x=1698439420; 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=gizyszKoYOssiFVO/W3NqegBEKVfjjL7AQSlumE/K80=; b=aDDkgHfX+4ZwA3QesXN+FEo7LgqIPdffO8uBH5iPts/zHgF4dQDvdSFkQs5nCyujEk yc36IvbxN7tPGfAdFSPu3oBbbPAnal9rEh+BTQCjkCvG8ZetT/YEbcWGYhdks5HyqqHF j4p4ALmfMxlv8PO4F3GE4qK1TTYoHr6dkDpfrIU+Az4+yrf7/b9LwyMF6ugcPZ2+ax7s ngeNNt+lZpc7ZHzWeq3blcLRdTrF1JmEBVHf6S4ksn2xRs6u9YFYif+kIMVAWIn1/FK+ QXWJvWI1XW9K2s7LkI5GJFMnps6UlaDnaxdw5wPUsewuxFHLcMeTOyvS7Z5lz5/2oqwH N7ag== X-Gm-Message-State: AOJu0YwIShPI6Nt3W8QujaGJ2YC5GfVw2g+nuQh10kMd8X9+JS31U3hY kGZVJ20YpD/PVp3lKcQQy7UaFEtDREw5WBgHjag= X-Received: by 2002:a05:6a00:2d10:b0:6b2:2a2d:7a26 with SMTP id fa16-20020a056a002d1000b006b22a2d7a26mr3084508pfb.28.1697834620086; Fri, 20 Oct 2023 13:43:40 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 07/65] target/hppa: Fix load in do_load_32 Date: Fri, 20 Oct 2023 13:42:33 -0700 Message-Id: <20231020204331.139847-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 destination is TCGv_i32, so use tcg_gen_qemu_ld_i32 not tcg_gen_qemu_ld_reg. Reviewed-by: Philippe Mathieu-Daudé 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 21f97f63a9..ff559ed21d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1430,7 +1430,7 @@ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb, form_gva(ctx, &addr, &ofs, rb, rx, scale, disp, sp, modify, ctx->mmu_idx == MMU_PHYS_IDX); - tcg_gen_qemu_ld_reg(dest, addr, ctx->mmu_idx, mop | UNALIGN(ctx)); + tcg_gen_qemu_ld_i32(dest, addr, ctx->mmu_idx, mop | UNALIGN(ctx)); if (modify) { save_gpr(ctx, rb, ofs); } From patchwork Fri Oct 20 20:42:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736291 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp500923wrl; Fri, 20 Oct 2023 13:44:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzNRyuFdLWvmyIVvSHQKqkHNsVSNOlC0IDwqX1TMejOgOmu8vbOjJJrAXcdzfNouBJa3VP X-Received: by 2002:ac8:4b73:0:b0:41b:7737:d70f with SMTP id g19-20020ac84b73000000b0041b7737d70fmr2516138qts.0.1697834681781; Fri, 20 Oct 2023 13:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834681; cv=none; d=google.com; s=arc-20160816; b=zMCPI+dTy2dMpdNQGTa1yoEPB8SgFQAiNQwK88n7eV+YULuheEAtivAG6qGCKnQWb6 cD2dJ9HqcmK4lX1YC6rFGqMoWZGWfedmfdCgadKcyZ1zYyxNnxVMkSRJYuBVlOrYiQ6s ySv2qHChTmoVDosZ1yIJm2FS4CQc1T+2nMUeF3D0Soq4KL5IZCz2t6l28S78PZVE1nuQ 7j+nyG9c0Q7z5bAGAvh1eB4BfM1LOfhASjYkTAm2lejMn7L/7LrzaB2VlG6rKDyOCFJy jv3sCiTax0rk1EJD5gAqelC7bshDwGGwSMH+eLEvdjo0Y3j208Od290gZZtxsc0GBtXb Yi5w== 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=HcidF9Jk1N+Ej8dbQUUvFmfE2V7LiGtPgLbzAI4Qab4=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Z5yC8AqKdPH/5MmH74H9WYPdzx65vc5PA5bwCMcFneATPBpwcLmlKQEkXPa62XX7fR 1bsi7bKCj1opAkAsywqTiPpxcgcvfvxf7U6lJ21NNSt6wICNsYGP2A/QRxbvJoaCRmn1 1PYhdV7PtFlE0mFqAxADtwuO+gelGcjpippykU+RpwOMcLBAFcpVneElfEqAZuV0JP6C OOcnPQaNxWtBOl3VOz+L/ae3hZXqCis8hycH12utglegsPhYu+LRiAaXM18bx8yPAg+3 syqYLxSkVuhC8pWNtj9CU3Mz2wftFY64ZjviG/80PRaxCIrBBMQtnurXaf/GdC3SJWLk 2fkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KmYY5kSu; 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 h5-20020a05622a170500b004181f579652si1964566qtk.118.2023.10.20.13.44.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:44:41 -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=KmYY5kSu; 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 1qtwLs-0007pM-TI; Fri, 20 Oct 2023 16:44:12 -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 1qtwLQ-0007iX-K5 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:45 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLO-00089d-CS for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:43 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b1e46ca282so1210179b3a.2 for ; Fri, 20 Oct 2023 13:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834621; x=1698439421; 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=HcidF9Jk1N+Ej8dbQUUvFmfE2V7LiGtPgLbzAI4Qab4=; b=KmYY5kSuhKvWvreARar5znrPZwqqrCquIekLLmI9/Lr/ARU9EPyZZuUTlfnUBXh2gm YJ9SP/gQiaG4EHIEDoPO/n1kGn726U6CKF3RNuVHlLapOUHAfTBux1hl1r2m3gjwGcMp +bFuCVkvywD1lot+ohOrexCG8svDxt69Wcz75SO84g8Kj/Ds1Ek0GdTMW3JY8RvuFSIr EDXRtWVixTCGAnIgL4DW6vylvRPSFyedk0lRGQ4tbjCVkFU2Qli9+HhvmEt4gxuSkNxW Rcm1ODiHQXNV+uMURY2phNRfLKgW8bTaHfqyEaI6z9Qyr/D7IKWIdNAQXU/I9tdYuTA0 D1xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834621; x=1698439421; 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=HcidF9Jk1N+Ej8dbQUUvFmfE2V7LiGtPgLbzAI4Qab4=; b=r6BsAe4z5OyxBrgxMyhIwKXQsp//Ig7I0DuUSdSBaHvmNTBY2mTBxekoEQTuXDFjur MJtfE8KwPkXIMiLFNn4/wKdbHUMzqOUhIvOXpbev2DEktS3aoaEzLz1i90+GCfIRGoZZ aCHXond4IqYwM1ddU2/0AaYHIHU2lTYG7D0PdK43XlI0j/8LYMzlZXWLu+AB63dnWdEw 2wG3EyUPF2pMI/deuCzG/pa4LmcKqAxuTZpV9Y7Tsu0ctL7BAtOgBxsT979X+uI3yzuy 9i/kji9PO4XR8W/TsIn6ZgFd8KFTb1C90z2ueymGtKm/z70NFzodWbl5L5tx/iRYIgYi xvfA== X-Gm-Message-State: AOJu0YzUBgMYqS0bdu1+2+h7y6CRu5sQYIANAIWJXwpM5HXHaNbSokY0 Q5/+AYRhCVJ5bIV7Vdj42yz9K6Pd0Ye2OA/1XnI= X-Received: by 2002:a05:6a00:10c4:b0:6b5:608d:64f6 with SMTP id d4-20020a056a0010c400b006b5608d64f6mr3132210pfu.20.1697834620857; Fri, 20 Oct 2023 13:43:40 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 08/65] target/hppa: Truncate rotate count in trans_shrpw_sar Date: Fri, 20 Oct 2023 13:42:34 -0700 Message-Id: <20231020204331.139847-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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 When forcing rotate by i32, the shift count must be as well. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ff559ed21d..e6ab113a1c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3105,8 +3105,11 @@ static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) tcg_gen_shr_reg(dest, dest, cpu_sar); } else if (a->r1 == a->r2) { TCGv_i32 t32 = tcg_temp_new_i32(); + TCGv_i32 s32 = tcg_temp_new_i32(); + tcg_gen_trunc_reg_i32(t32, load_gpr(ctx, a->r2)); - tcg_gen_rotr_i32(t32, t32, cpu_sar); + tcg_gen_trunc_reg_i32(s32, cpu_sar); + tcg_gen_rotr_i32(t32, t32, s32); tcg_gen_extu_i32_reg(dest, t32); } else { TCGv_i64 t = tcg_temp_new_i64(); From patchwork Fri Oct 20 20:42:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736309 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502181wrl; Fri, 20 Oct 2023 13:48:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHs5WjAxPckigiLM0SiW/7nZMRcXW2FAdtVRcf14DZ8wNes/c22ZEsx2fUsxd7lSxSWclxn X-Received: by 2002:a05:6808:3b0:b0:3ab:929e:c5e1 with SMTP id n16-20020a05680803b000b003ab929ec5e1mr2560751oie.39.1697834928122; Fri, 20 Oct 2023 13:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834928; cv=none; d=google.com; s=arc-20160816; b=XeI4BsGZ3L5wZpFmbWGH5n9Z5CUXV9jtFMYIEJ0NbvOGD1jqr3jespFLCq5OE0+bSY CnPO7lTeDMR2t9lYyLn2d3NdpW4bkVd+xM9Fm11rTWDREq2882CIZkHzCmZKiU/i0vya QEiHu7wTzENuA5S0Q3eMkG3Ggs72EUB9kLzmkrtJyv9A9W7Qy8WKUb+/+pqJKVWNyu1o JX6loQ9ibqZvSsyMw2Lolr1NZ+epPQvDdUMUqMCPU4QXR+nc0+5nfXP/Aa5iMg2c8hgk 0hY/orh2t69MG2XkIpWXK7DoTT63kPTZ2Oi9PN6SpXApkDjeRv5cPev82lVx3W27nC8Y sBUQ== 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=jy+spAs5u7WgOQZspkjRSxDs5g0jtQCLczTslsy9ExE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=y4qHCgvopUdO50igSSLDthQ9u+eOqtMWproTgWAAAX3ZKPVARUiMA2hi4ueT4C87vo gMupo2VsykoIzeYKKGEBsRF1TzACBp3NQ8NYigjYJ719TqbSneXneIR6Exe3edPeZbiO 3k76M8rvbvMVItosbETnDDS7G+DeaPEICXuFghgkcyCFyRKCvKzXDs57NLTjE/gBY28G WrNIzgTi0hKrhY+I4miboROfhfpNVAsoTq5dqq8V828ioZLIXTs8Xgc7fa0OGKlgUFQI 0MuSqabNdCceuRkB1RsFWbpM+eD9y4tYNLFOn0o+5fjolgcyU6r1Xl9UmjBhI0fUguv3 0rXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hC8IZ3Vi; 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 14-20020ac8574e000000b0041980065908si1956770qtx.506.2023.10.20.13.48.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:48:48 -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=hC8IZ3Vi; 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 1qtwLs-0007pK-Eu; Fri, 20 Oct 2023 16:44:12 -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 1qtwLT-0007iv-6T for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:47 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLP-00089q-P7 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:45 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so1107289b3a.1 for ; Fri, 20 Oct 2023 13:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834621; x=1698439421; 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=jy+spAs5u7WgOQZspkjRSxDs5g0jtQCLczTslsy9ExE=; b=hC8IZ3VinQnesMt+Lo0qkAAfWtu1W1+oc1WqznhSBsVZSP8JvQH84i7abk+qC1XArd 68ubvz804AEdxvOjO4B/7cjZYS5mpIthz+CI2d7LlzqSwfKbU41UPsUbL2vBiz7tGc7k 6uySOVzg1rgNh2jnfhJoI2MyFrSJBQcFKdO/jx8d3yLR33eEICZsoGC4pNFbBgAwKRLH do1Tt2+zvMt+tQSD7ue/641FoaDKsIVVpSuZ+U5cv6VxW1tbePDQTaU6CrVUYgFghHfn OTFBlJK7W9tgfA8dJOMqlbNr/+yTQVAewm57ebeBrK8TeDz92JoqVhsY1yCamNzeMGjt v3Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834621; x=1698439421; 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=jy+spAs5u7WgOQZspkjRSxDs5g0jtQCLczTslsy9ExE=; b=c2jFXilOmQ+y9g8hgiobAXczsMinA61rPfSaphDFYuE8bfGcFpCA5m4KwxywZLVK8d vK6g8F6IMcFT66ZbbRargW0Fipj2nHYwlgENHNDaaq+sdCEb1JY+v90frpqMK3XeyKRr Z7q8suJzotIf6GcpdGNntJKoCeokL5YmdadsZGfx4RsYO6eNDH6WgEQ5L+WHOmZRN2Qj t0q6qmG2LUzD8AyU3EnVHI2kKAYoZiC6mox/yu/2HliV/xBxq8bHkURNYKqOlekWNtHt t8NHaSrL2jEjavatyp/RWkmOm70ucrau1B9MoWN7UX6FS3hXEIpt7LE25JbCUeuz8dBO OrQA== X-Gm-Message-State: AOJu0Yza2pEjZJPdP0Roel7JZmpRxELUVTRdDW9ZqSPcj+dwq4EeIte1 RZRydY3GlBtl4v0W50uRLMqmNXxXoRHCUX37XJY= X-Received: by 2002:a05:6a00:22c5:b0:6b4:c21c:8b56 with SMTP id f5-20020a056a0022c500b006b4c21c8b56mr3193565pfj.23.1697834621559; Fri, 20 Oct 2023 13:43:41 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 09/65] target/hppa: Fix trans_ds for hppa64 Date: Fri, 20 Oct 2023 13:42:35 -0700 Message-Id: <20231020204331.139847-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 This instruction always uses the input carry from bit 32, but produces all 16 output carry bits. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 48 +++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index e6ab113a1c..fb7a295367 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -803,6 +803,12 @@ static bool cond_need_cb(int c) return c == 4 || c == 5; } +/* Need extensions from TCGv_i32 to TCGv_reg. */ +static bool cond_need_ext(DisasContext *ctx, bool d) +{ + return TARGET_REGISTER_BITS == 64 && !d; +} + /* * Compute conditional for arithmetic. See Page 5-3, Table 5-1, of * the Parisc 1.1 Architecture Reference Manual for details. @@ -1040,6 +1046,22 @@ static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, return cond; } +static TCGv_reg get_carry(DisasContext *ctx, bool d, + TCGv_reg cb, TCGv_reg cb_msb) +{ + if (cond_need_ext(ctx, d)) { + TCGv_reg t = tcg_temp_new(); + tcg_gen_extract_reg(t, cb, 32, 1); + return t; + } + return cb_msb; +} + +static TCGv_reg get_psw_carry(DisasContext *ctx, bool d) +{ + return get_carry(ctx, d, cpu_psw_cb, cpu_psw_cb_msb); +} + /* Compute signed overflow for addition. */ static TCGv_reg do_add_sv(DisasContext *ctx, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) @@ -2712,6 +2734,7 @@ static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf *a) static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) { TCGv_reg dest, add1, add2, addc, zero, in1, in2; + TCGv_reg cout; nullify_over(ctx); @@ -2726,18 +2749,20 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) /* Form R1 << 1 | PSW[CB]{8}. */ tcg_gen_add_reg(add1, in1, in1); - tcg_gen_add_reg(add1, add1, cpu_psw_cb_msb); + tcg_gen_add_reg(add1, add1, get_psw_carry(ctx, false)); - /* Add or subtract R2, depending on PSW[V]. Proper computation of - carry{8} requires that we subtract via + ~R2 + 1, as described in - the manual. By extracting and masking V, we can produce the - proper inputs to the addition without movcond. */ - tcg_gen_sari_reg(addc, cpu_psw_v, TARGET_REGISTER_BITS - 1); + /* + * Add or subtract R2, depending on PSW[V]. Proper computation of + * carry requires that we subtract via + ~R2 + 1, as described in + * the manual. By extracting and masking V, we can produce the + * proper inputs to the addition without movcond. + */ + tcg_gen_sextract_reg(addc, cpu_psw_v, 31, 1); tcg_gen_xor_reg(add2, in2, addc); tcg_gen_andi_reg(addc, addc, 1); - /* ??? This is only correct for 32-bit. */ - tcg_gen_add2_i32(dest, cpu_psw_cb_msb, add1, zero, add2, zero); - tcg_gen_add2_i32(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); + + tcg_gen_add2_reg(dest, cpu_psw_cb_msb, add1, zero, add2, zero); + tcg_gen_add2_reg(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); /* Write back the result register. */ save_gpr(ctx, a->t, dest); @@ -2747,7 +2772,8 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) tcg_gen_xor_reg(cpu_psw_cb, cpu_psw_cb, dest); /* Write back PSW[V] for the division step. */ - tcg_gen_neg_reg(cpu_psw_v, cpu_psw_cb_msb); + cout = get_psw_carry(ctx, false); + tcg_gen_neg_reg(cpu_psw_v, cout); tcg_gen_xor_reg(cpu_psw_v, cpu_psw_v, in2); /* Install the new nullification. */ @@ -2757,7 +2783,7 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) /* ??? The lshift is supposed to contribute to overflow. */ sv = do_add_sv(ctx, dest, add1, add2); } - ctx->null_cond = do_cond(a->cf, dest, cpu_psw_cb_msb, sv); + ctx->null_cond = do_cond(a->cf, dest, cout, sv); } return nullify_end(ctx); From patchwork Fri Oct 20 20:42:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736299 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501431wrl; Fri, 20 Oct 2023 13:46:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG61YqMiLd/c+VyxsFwCmTK2FLH3hf3FnF2zonvl36xM7dZ3Z+lBfAuqpYM+Hk1TPSTYF8t X-Received: by 2002:a05:6358:4324:b0:132:d333:4a5c with SMTP id r36-20020a056358432400b00132d3334a5cmr3207099rwc.10.1697834783602; Fri, 20 Oct 2023 13:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834783; cv=none; d=google.com; s=arc-20160816; b=UVDA+nZLKzqMWmuEV9iqgZiOt12h9Ai95K+4N4OJcyBkYAfMbEOUZNP2O6hqPCmYpL N2J63t09DbxvHcMgvGnySSwPfZUkgrtqdDA9qxcyqNyjD8llJpg0KJzZj1Wjp/aS7l7g 1+QhZGg5Ru/nuKu6o+RNJU1rwLfSJVJfbTYhAYcEsNOlpIYNREchIeD6Ju4gwM3lfPS5 qecIsOQFzfakrNUJlR2J3hLQgikMcVrmsQBH48QOTNl4ZDM6hpprcUz99QoYtsnOL3rw ThOgp3uZ09iGn570Zf0yaIHcoFL4SkxpvMq7itpsUPBlAfm0xQAuuf23YisWuXbeU0KA UbqQ== 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=vj5Zj+Bw57JH4E175sUuTw9SkCPkXc9sWUiIDH26gck=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=KiW/RlGYWdMpRI3oaCdUMqWhwEftt+udcehuxt5RbFAUsvGIRwCmS9GrVDoVfIOlTB +4xD40WO4BQctBQMT73HhjTAyeeAINnv/5DYD4eAzua7o1FmZsrfoFitDyFcOhOqCL9l tC+BpQ8Ufxqx8KQi287ouw7KzZp6397k5kj7Bprjb7QWhnF2gGPdAxYPRFV2C0OmmCW6 HkJaQ4YQcT+FYcgNp+8U0KWIjPWGe14zYCyZIdY2/6Gako27rxqQ2RHCaC7nc9ZV3vyw 3fRR5xvswUPbUXo+bQE6XcHALieFzp8fvLnkuawHjysbzrF861Y/YMLKbDRFX2/AkkkO sjkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=enH7rGJb; 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 eu18-20020ad44f52000000b0065e0125a6besi1988991qvb.410.2023.10.20.13.46.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:46:23 -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=enH7rGJb; 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 1qtwLs-0007pG-5L; Fri, 20 Oct 2023 16:44:12 -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 1qtwLU-0007jO-Dj for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:51 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLQ-0008A0-DB for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:48 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6b709048d8eso1082101b3a.2 for ; Fri, 20 Oct 2023 13:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834622; x=1698439422; 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=vj5Zj+Bw57JH4E175sUuTw9SkCPkXc9sWUiIDH26gck=; b=enH7rGJb+3DB9sJMVEgD+exnNafObOJfJKbLWTeia8Ssb5b3w6rToSXFOq/Dh8umAx tae8x8ddcnEBiLLpXdXQKupb8i5YFRhd01eqjgTR8CeYCPMhPvCHOFFQSPJhQRjFvu2e ZU7DCHb65I2sbZ97V1vbp6YgsLes4Zp8B6kdmwOG9s08Ull1yiPr11hhdaamK4k6r3aW 0m1nS4Zrb5NXLqasSu043ZwShouPHK/Ntsxibhr5UBa0rY7mROFgmyz2Voip0LYHVetF OUtnuPe8/Q3+J29BdLPtGwPhmka6rI6fQLzmWXHnU7gnaRyKA6vvA8rc0gbVFXxyCYRy yzvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834622; x=1698439422; 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=vj5Zj+Bw57JH4E175sUuTw9SkCPkXc9sWUiIDH26gck=; b=oL7Pl2l4Aj/1fMdPq4ZfDmxtF7lvQAf8bchkKD2VrOkdWmXVgOONr9GD4kfA49E0IE x8wgPPNIzde2+VcqPF1cjjGSJfsRVqvPz1tuIwOpzEIOwPOCgCdrzdGxSH6Ky7vMmmXV XXJJYFI9mmYgSkpMsm37iL4dB1q1DigOEVZ27CtzY/1QfgjcLs8PQFW419zwQf+JJrEz CDQOQOcqZr7wO3sHXo0CAGsDqK9vIj9ivSK/EhkSWlfZzKs+ksE5P/OC0aGF+xJHTtvF jdDtbmutyZ2GR/75qmH+DC11EgVdajlHT5PM4W8c2R+ct+WXu5GsPGL1uIPQPortpL9J DFDQ== X-Gm-Message-State: AOJu0Yw1y6YpTDyoMi9guTdSJvLaXBNjHDZEsQ/X7EdbXBg/YV69k7vW ZFKngXpnZAbpbMYvYbUbREbRgZSMiusXwWubqYQ= X-Received: by 2002:a05:6a00:99e:b0:6be:265:1bf5 with SMTP id u30-20020a056a00099e00b006be02651bf5mr3314607pfg.24.1697834622534; Fri, 20 Oct 2023 13:43:42 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 10/65] target/hppa: Fix do_add, do_sub for hppa64 Date: Fri, 20 Oct 2023 13:42:36 -0700 Message-Id: <20231020204331.139847-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 Select the proper carry bit for input to the arithmetic and for output for the condition. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 50 ++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index fb7a295367..8ebe7523a7 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1094,13 +1094,15 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, TCGv_reg in2, unsigned shift, bool is_l, bool is_tsv, bool is_tc, bool is_c, unsigned cf) { - TCGv_reg dest, cb, cb_msb, sv, tmp; + TCGv_reg dest, cb, cb_msb, cb_cond, sv, tmp; unsigned c = cf >> 1; DisasCond cond; + bool d = false; dest = tcg_temp_new(); cb = NULL; cb_msb = NULL; + cb_cond = NULL; if (shift) { tmp = tcg_temp_new(); @@ -1111,19 +1113,22 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, if (!is_l || cond_need_cb(c)) { TCGv_reg zero = tcg_constant_reg(0); cb_msb = tcg_temp_new(); + cb = tcg_temp_new(); + tcg_gen_add2_reg(dest, cb_msb, in1, zero, in2, zero); if (is_c) { - tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, cpu_psw_cb_msb, zero); + tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, + get_psw_carry(ctx, d), zero); } - if (!is_l) { - cb = tcg_temp_new(); - tcg_gen_xor_reg(cb, in1, in2); - tcg_gen_xor_reg(cb, cb, dest); + tcg_gen_xor_reg(cb, in1, in2); + tcg_gen_xor_reg(cb, cb, dest); + if (cond_need_cb(c)) { + cb_cond = get_carry(ctx, d, cb, cb_msb); } } else { tcg_gen_add_reg(dest, in1, in2); if (is_c) { - tcg_gen_add_reg(dest, dest, cpu_psw_cb_msb); + tcg_gen_add_reg(dest, dest, get_psw_carry(ctx, d)); } } @@ -1138,7 +1143,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, } /* Emit any conditional trap before any writeback. */ - cond = do_cond(cf, dest, cb_msb, sv); + cond = do_cond(cf, dest, cb_cond, sv); if (is_tc) { tmp = tcg_temp_new(); tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); @@ -1192,6 +1197,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, TCGv_reg dest, sv, cb, cb_msb, zero, tmp; unsigned c = cf >> 1; DisasCond cond; + bool d = false; dest = tcg_temp_new(); cb = tcg_temp_new(); @@ -1201,15 +1207,17 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, if (is_b) { /* DEST,C = IN1 + ~IN2 + C. */ tcg_gen_not_reg(cb, in2); - tcg_gen_add2_reg(dest, cb_msb, in1, zero, cpu_psw_cb_msb, zero); + tcg_gen_add2_reg(dest, cb_msb, in1, zero, get_psw_carry(ctx, d), zero); tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, cb, zero); tcg_gen_xor_reg(cb, cb, in1); tcg_gen_xor_reg(cb, cb, dest); } else { - /* DEST,C = IN1 + ~IN2 + 1. We can produce the same result in fewer - operations by seeding the high word with 1 and subtracting. */ - tcg_gen_movi_reg(cb_msb, 1); - tcg_gen_sub2_reg(dest, cb_msb, in1, cb_msb, in2, zero); + /* + * DEST,C = IN1 + ~IN2 + 1. We can produce the same result in fewer + * operations by seeding the high word with 1 and subtracting. + */ + TCGv_reg one = tcg_constant_reg(1); + tcg_gen_sub2_reg(dest, cb_msb, in1, one, in2, zero); tcg_gen_eqv_reg(cb, in1, in2); tcg_gen_xor_reg(cb, cb, dest); } @@ -1227,7 +1235,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, if (!is_b) { cond = do_sub_cond(cf, dest, in1, in2, sv); } else { - cond = do_cond(cf, dest, cb_msb, sv); + cond = do_cond(cf, dest, get_carry(ctx, d, cb, cb_msb), sv); } /* Emit any conditional trap before any writeback. */ @@ -3019,18 +3027,24 @@ static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, unsigned c, unsigned f, unsigned n, int disp) { - TCGv_reg dest, in2, sv, cb_msb; + TCGv_reg dest, in2, sv, cb_cond; DisasCond cond; + bool d = false; in2 = load_gpr(ctx, r); dest = tcg_temp_new(); sv = NULL; - cb_msb = NULL; + cb_cond = NULL; if (cond_need_cb(c)) { - cb_msb = tcg_temp_new(); + TCGv_reg cb = tcg_temp_new(); + TCGv_reg cb_msb = tcg_temp_new(); + tcg_gen_movi_reg(cb_msb, 0); tcg_gen_add2_reg(dest, cb_msb, in1, cb_msb, in2, cb_msb); + tcg_gen_xor_reg(cb, in1, in2); + tcg_gen_xor_reg(cb, cb, dest); + cb_cond = get_carry(ctx, d, cb, cb_msb); } else { tcg_gen_add_reg(dest, in1, in2); } @@ -3038,7 +3052,7 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, sv = do_add_sv(ctx, dest, in1, in2); } - cond = do_cond(c * 2 + f, dest, cb_msb, sv); + cond = do_cond(c * 2 + f, dest, cb_cond, sv); save_gpr(ctx, r, dest); return do_cbranch(ctx, disp, n, &cond); } From patchwork Fri Oct 20 20:42:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736332 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502907wrl; Fri, 20 Oct 2023 13:51:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3c5KBu/OIWZ0o7kKhGEEa6QmK/SdYgDTtW0RZg6fqwGDu70rx9bbs0EVDA4XOZ2f9TQdh X-Received: by 2002:a05:620a:454e:b0:775:ce76:474a with SMTP id u14-20020a05620a454e00b00775ce76474amr3507101qkp.52.1697835095923; Fri, 20 Oct 2023 13:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835095; cv=none; d=google.com; s=arc-20160816; b=fwgtSG0qd67gc7p1ceHP4doT76RE2bj7XAgDKzP7s2P9XXtFh+w6fWAy+HRtr4u0o3 Ir5VQDulP7C+vAmBppg32JYyNs6Jlg7ZCbDU7PW/yDD9KyyA2UbQ2PP5XH3rhlVGJdZd WxDFHsGNYx1J8n3rhseXAuedVf+XUGFW63QPzv+zMglNs8BlqvQQu3AbQrqCdXeoflU6 ZNiDO2dJFehD1gWhMOdpil6ZcJnXKX/a3XeXhg42648eanaGlmRiMAe5rsSvpoCSe+hG cFcKOIecMTCFYeku31yrcDgCVZV4PnPLn3v09pUg4tSuzJtAG4k06p7JChtqg1lf8HXt isEA== 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=+3Cca9a0dUfxOMmsrbDZSCnt4BuRnsfCclCPiSMy9B8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=0oDL+XQYvumqk47SIhovVa2kqAHEZ4WXV8HxHaUqwHJw7TTG4WsozQIhNcEfnBGIut RMOkczINP5aALmmViFKJq5AWn9jEh+01M6wNrZt6AH4x6xPM/vLkKgnm9mEBgOS+gcOi 28wbP7oXBX/1x3csFLuYD+4nJuQ5OAZK01EywPaKhVHhRUYO5zhsShpQTZCbIswebN5I vZa4NZJP/3tNy3o+Z16OVPt0rc92QS+xb9vy2ihJ0lXrxEbWWSc0ppFJd/5TUbBmsGPc zIZNv0cbG2yx9Ydilc9knM9HUC+hxLLv8uJ+FtYnKjl5hk7UkzhxHc/jkimU8Fj6e+wt x0bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ikUtBKj+; 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 g5-20020a37e205000000b00774384dabe3si1856298qki.563.2023.10.20.13.51.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:35 -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=ikUtBKj+; 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 1qtwLt-0007pO-6D; Fri, 20 Oct 2023 16:44:13 -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 1qtwLU-0007jP-Du for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:51 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLS-0008AD-Lt for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:48 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b709048f32so1136118b3a.0 for ; Fri, 20 Oct 2023 13:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834623; x=1698439423; 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=+3Cca9a0dUfxOMmsrbDZSCnt4BuRnsfCclCPiSMy9B8=; b=ikUtBKj+/5QIBQ8z8gMQcGNZow41MD5jPJqIkK00UwMACNaeEoPlkWGsbP1qvW0R1+ eKDze6xwHSKC0cnUq+OA1KWzV9VdcKBgdzolDMYyBUDFnz/kGbIU1FP1pIyEJQ4BUH31 qiFT079IDJQAYAQEVdgpIvxPxB4Yl9SUnwP/W0+zZQki+wBS8p/xI6netdKDC3Z95USg zfnepvNpI++tdsVja3MpY8o1HFOc/Zt2uKw0OABYLRiszFpJVwFKCDu0SKNupnnj9kCD CCRRjrugcl7qsQXDUK+Q8XIu05Hf7Ya5yykQaLCprwPoLhqnc8URvWIPDT8mHYGI8ulj 8YFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834623; x=1698439423; 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=+3Cca9a0dUfxOMmsrbDZSCnt4BuRnsfCclCPiSMy9B8=; b=OSQrE1FEt3RLkI0KpiahwcDy1hxv3ULcI2ObInVug3gkFmIk2zGD1hkg5em3IwXpuW juKGF+HQrnVZXb1IeUk7rmusca5z3Y0Kqhc7XbJJ1GC8pzEXFb1IOWyvdVta9HO3xMHm b9vqoZqSBj/U+ldoQf7Qs2kc+8Fo0yjpx2lz1k/1qcN87Lw/j0QT9JEj6dvWIZWcz8VW MmdoHR7u0m+76F/cWry1xKYHuFCjaZZ0meM4DD15suKxcqRfKg/9Za5QgyIXyVhdmtE3 SAevbDZNkiw2GHLmFI3iO5v7+eMO7FGKqpeMO8Lgk+UY092OhNupQ7+0UjRts8rOL6Qt iooQ== X-Gm-Message-State: AOJu0YwAEzEqeOlKLec8fuV35z7yIPbU8iqXN2ov1F3sCUJ/f9EtDGCc NRFJS6DGVE1IQyBFMDkmtIJl9P7vwsx6Cv4IRBE= X-Received: by 2002:a05:6a20:4924:b0:14c:5dc3:f1c9 with SMTP id ft36-20020a056a20492400b0014c5dc3f1c9mr2380653pzb.49.1697834623353; Fri, 20 Oct 2023 13:43:43 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 11/65] target/hppa: Fix bb_sar for hppa64 Date: Fri, 20 Oct 2023 13:42:37 -0700 Message-Id: <20231020204331.139847-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 Signed-off-by: Richard Henderson --- target/hppa/translate.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 8ebe7523a7..119422870c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3073,14 +3073,21 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) { TCGv_reg tmp, tcg_r; DisasCond cond; + bool d = false; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - tcg_gen_shl_reg(tmp, tcg_r, cpu_sar); + if (cond_need_ext(ctx, d)) { + /* Force shift into [32,63] */ + tcg_gen_ori_reg(tmp, cpu_sar, 32); + tcg_gen_shl_reg(tmp, tcg_r, tmp); + } else { + tcg_gen_shl_reg(tmp, tcg_r, cpu_sar); + } - cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); + cond = cond_make_0_tmp(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3088,12 +3095,15 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) { TCGv_reg tmp, tcg_r; DisasCond cond; + bool d = false; + int p; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - tcg_gen_shli_reg(tmp, tcg_r, a->p); + p = a->p | (cond_need_ext(ctx, d) ? 32 : 0); + tcg_gen_shli_reg(tmp, tcg_r, p); cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); return do_cbranch(ctx, a->disp, a->n, &cond); From patchwork Fri Oct 20 20:42:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736321 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502701wrl; Fri, 20 Oct 2023 13:50:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5LG3g4rcLd1tH9ct9u9K2shnFt3l837HWVXEJMB6u2ZghK55nygJe39hgi/ndpDO+wXak X-Received: by 2002:a05:6214:411a:b0:66d:1ccc:7df8 with SMTP id kc26-20020a056214411a00b0066d1ccc7df8mr3263208qvb.15.1697835048374; Fri, 20 Oct 2023 13:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835048; cv=none; d=google.com; s=arc-20160816; b=QyrWJmosVYdE2hWnhE21/XwekjiQ0y3Pzg8mgpt7v0hT/QshDbHQ0Mrx7pVYoG8B9w b0CREZVn4WFC+Cq3LrK04yUGjrOWYXw6BaUjxNCuxEnNcPq4Y8Qgu/x9Il9OBqJb2Im5 QBgfrKfFLMunSX8WrnwqnCpk/yf+Lf5RXRniK924QIEiPNkY4Cz414Hw269Y2hQ2Rq2q 1ih7mEIvAFQPf+UjVopOUA/XGUlEam/OqyEDdq6N1dgEndxsGOteBiRxau0YWRNDJPBq hj07TO2IdAVswEglqSxODEwRULX7zDbMAMxudUpRNoq/nnRE7JyjjzkKbycFabnOhsZW jWhQ== 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=T6DEfOhGSAuzHVOiFy6ZRmh1nqeZSzZi7HDKv5g8+j0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=oj/eZmgobrgjyXnWq1WJC7ify7YF+tnwBPo4ffyoIAj6IpXsZFFnTgQCvM4RyBFX1s fECe8mDJtTdNJoqHBew7CeUTUzpyBJOgyb9z/p5dLvj6nzVrOMA3iOSX1n5lfMJ4BeDC 7FEk5qShvtmm6h8qSlLJEPn5RwK0uBAG16uw09yXAO/tc7iuB623ZINVcH5DfD8TgKhu UqpFzx8sNsKTtfbDvD2GRVI6G3ad8rB/WosiqZxGM4oLfcYPuCj2EpUoGV1SS2/beupb T+Ezm1ItXMSxyqn2cVeEWJIK5c/jgKOdjUf13BxmCEOe+hQTIwlp8fnoJhkVRZNeEnRM Di4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BsNZ67kc; 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 p18-20020a0cfad2000000b0066d054257a6si1984914qvo.476.2023.10.20.13.50.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50:48 -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=BsNZ67kc; 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 1qtwLv-0007tw-LL; Fri, 20 Oct 2023 16:44:15 -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 1qtwLV-0007jQ-TZ for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:52 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLS-0008AL-U4 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:49 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6bd32d1a040so1213420b3a.3 for ; Fri, 20 Oct 2023 13:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834624; x=1698439424; 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=T6DEfOhGSAuzHVOiFy6ZRmh1nqeZSzZi7HDKv5g8+j0=; b=BsNZ67kc7dWCgOMVsBf0JFCqD79DLaZDrGCUzvsdUCPWwm6gQhnrpuq8SzI/7/7bkf VIuV7gu8G1cQPiPUIz4TksdANcT0tQlqRY7GGJ5/dcnaU66DNvtoCNo3JeMT/hku9FCV zs+66E+kR1tr6XrTyFqoMw1D7qdPvmOTyYhRdkplyoG0ZAZC4aqrWCyI+sVC0u1bBSy9 KadQDApw5c//NAl8We7C4yeZpSou3eQ/HUgxYabVe4nFI3dUmoZAB6q7SDR2KOH1CQCJ 6EuWM/rCDXnpWyhSmZvlVCy3y+Q6SeVofK7PGU1bw8NThnPAbZ0JTbBgOE7DXyrovCGH KRAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834624; x=1698439424; 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=T6DEfOhGSAuzHVOiFy6ZRmh1nqeZSzZi7HDKv5g8+j0=; b=o0OisxBZBumrWwkq5h3KMX6IGsIU+cA0VyW4ayT59jFWQmPU71q1kqiMZuALR3lPsj HjeJ6+l8Sp8aMDu1Ma2LkdFs+JyWhyHJKcWG5oUxQAA88B0EWZnFvxrN8moIx+IrwLPg uRfdbYq/57UU8CfoaiH6j/AnFANltZoiu5EXAn5qII29ZdLA4XCvahwraIZvHdh8iCkE /P/R7tesV31ZNnDxM4lNpIYF9tuKPkIg+nTIrYrbxhumdFgxTUIspPVpBYaDZzsbvXlo b1eawsemXRLq1NtvBBJr7vywp77cT8g5JevEwWWRKifnMQb5zLUoTadcBRnHgKtsnfGC 0YuA== X-Gm-Message-State: AOJu0YxPkejekG7aynsEghq4L5qz+ffWYTaUWzilguJGxHtGPhMqm+Q9 /Z+6K9jHMAADpS6ndLHDUnoJT4Gjz0bIohWidow= X-Received: by 2002:a05:6a00:84f:b0:6bd:b3b9:649f with SMTP id q15-20020a056a00084f00b006bdb3b9649fmr3273030pfk.7.1697834624318; Fri, 20 Oct 2023 13:43:44 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 12/65] target/hppa: Fix extrw and depw with sar for hppa64 Date: Fri, 20 Oct 2023 13:42:38 -0700 Message-Id: <20231020204331.139847-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 These are 32-bit operations regardless of processor. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 119422870c..f86ea9b9ca 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3230,7 +3230,9 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) tmp = tcg_temp_new(); /* Recall that SAR is using big-endian bit numbering. */ - tcg_gen_xori_reg(tmp, cpu_sar, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(tmp, cpu_sar, 31); + tcg_gen_xori_reg(tmp, tmp, 31); + if (a->se) { tcg_gen_sar_reg(dest, src, tmp); tcg_gen_sextract_reg(dest, dest, 0, len); @@ -3355,7 +3357,8 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, tmp = tcg_temp_new(); /* Convert big-endian bit numbering in SAR to left-shift. */ - tcg_gen_xori_reg(shift, cpu_sar, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(shift, cpu_sar, 31); + tcg_gen_xori_reg(shift, shift, 31); mask = tcg_temp_new(); tcg_gen_movi_reg(mask, msb + (msb - 1)); From patchwork Fri Oct 20 20:42:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736336 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502982wrl; Fri, 20 Oct 2023 13:51:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaEIad9hZkeKoBzDqEBFxSh3GItX+L7dwuJJ86bPcgYUlzg3VhTS/2M9xyb4xIwLGtI/RA X-Received: by 2002:a05:622a:11c9:b0:41c:c3ae:f272 with SMTP id n9-20020a05622a11c900b0041cc3aef272mr3122946qtk.32.1697835112440; Fri, 20 Oct 2023 13:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835112; cv=none; d=google.com; s=arc-20160816; b=YRkyMAJ720dWUcBGxnWiA8CDGDgrmMSeDThmtLlEUl2gjP4POIapgNl8K2RgsuBfjp d1GN9ExQ2AJggSfoEl79U6mIXo5huS3qvJrErggInLvDUShgpowZqPqZyCyY8823HyB2 FFJhLsZCj++GMFVQsV3jAn08OW2znpJq1A23cp0bWEjec0BkoG72licfSzQGWfFjDfil nVpS++TVsb0eF5HHLYVqY/vjW/LdUCoFXv2+Upr6E631EZtNJKdekXX3pXwHAazwCjqd t/TeNwshmuhvR3z5y0pjTu9OO5m8ZjqXMkJ8PWQdShpuRyQdVH3ZLhTPbF5uD3lGdnxK VrCg== 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=3+gAls5QIov6whAU2ymHpvhxd4z68DFwK7+v+pcFR8U=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=NXqNZZGzrvIHsOHnsjl0jA83PmeQu6vMR5rho98vT/r3IXyyVHSFOiiD33/ti7memO /LlCsQSP0mfIz895XMSRphATWVeWX1xhIdWmpgWOyAgtIfBKnXDzsk8q38xsbXlO8wzo VV9cJsw/GtS0d6vskSyME5oIPIU2aS51CuFlS0Uq0FPlb854bF7QEfYfrUufg9reMCWk btHhIbldcRvV6no7M1pWMeUB/4xbLGROcVb2HSdBumV2qqXM+V9HpBmmP5SKZZY69WKi sriiwCcgOCd9yOpI8WxHAZiKqBVNM/37jrw4ojgfrb2iKfq4f5gTV/sF6hpnSI54xq1g /1Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UC1E1T0Q; 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 f22-20020a05622a1a1600b0041971052879si1928978qtb.120.2023.10.20.13.51.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:52 -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=UC1E1T0Q; 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 1qtwLt-0007pd-IC; Fri, 20 Oct 2023 16:44:13 -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 1qtwLW-0007jR-GE for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:54 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLS-0008AP-Mz for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:49 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b497c8575aso1217919b3a.1 for ; Fri, 20 Oct 2023 13:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834625; x=1698439425; 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=3+gAls5QIov6whAU2ymHpvhxd4z68DFwK7+v+pcFR8U=; b=UC1E1T0QoBTZaYUaS/aVXB1qWv4b6R559A+euFUfEW1Ukygv+BpAxtlgjfc0QmV7oS 4ZenXhxFLs2bw/7NhNcMFQJboU+xirzc943ZkJJOhuLYK9UwPhefWMkfxxHsmvPIzWpg H95HCBYx9Pouh5K9QDFere82+g2tvXUyhPvovPzFDS034JnPEzjlDN/WUwfuezuyrqNg 4ttYpZEPAuhCKH9aIMj6IuYAss3Q6GSrnBsymOC1P6v7VH/NWZtLk29d+99wcRagwn/T HlP3cEC/BBE8MM0M3Qa4piFWK55IeLlY/WGItkWRpWjJr8xucjnZHb/UKb32mMezjU6V OpmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834625; x=1698439425; 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=3+gAls5QIov6whAU2ymHpvhxd4z68DFwK7+v+pcFR8U=; b=JbTJtJyLhcO9zxfl43jNxuyk6b2N39NRAd5KE92wTDG3Hs/9g/X3HWaJtpHV5mMnP+ 61g6m69ySQf2dpeRKd4lMJ/UosLDQt4nRHrm89ppaHDaGI8sNKZRv5K5LsCER8P/u1AL KHjFxAGYOSvztogSbBkeLSqbZhZA8Dc15u7RCjv5X/3iy3dUqbQPm4iFS7X9YwQiXV5b skEOPJ8V1efppo0FSsTuMYwXwdOuIoM4784F1y1TDzHfMs5VnqOVUfTWZsSbp83PInjr zCD+DEMsCxVViad6jde3aO4I0ILa5MImRd6bC/CjdKIRSH/7PgQ8Lq8BKvy16Det2+z6 /AUg== X-Gm-Message-State: AOJu0YxI24rOnuA8Pw+dtRVKmuXIwzapTGqKl2kUL8FSOpX07Y5uqV4b MnAGvhuQhcR9ntQth9cML96tKj9KA3M88nd0vbE= X-Received: by 2002:a05:6a20:3950:b0:17c:d4f0:87e0 with SMTP id r16-20020a056a20395000b0017cd4f087e0mr733413pzg.53.1697834625141; Fri, 20 Oct 2023 13:43:45 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 13/65] target/hppa: Introduce TYPE_HPPA64_CPU Date: Fri, 20 Oct 2023 13:42:39 -0700 Message-Id: <20231020204331.139847-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 Prepare for the qemu binary supporting both pa10 and pa20 at the same time. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/hppa/cpu-qom.h | 1 + target/hppa/cpu.h | 5 +++++ target/hppa/cpu.c | 34 +++++++++++++++++++--------------- target/hppa/translate.c | 2 ++ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index b96e0318c7..4a85ebf5e0 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -24,6 +24,7 @@ #include "qom/object.h" #define TYPE_HPPA_CPU "hppa-cpu" +#define TYPE_HPPA64_CPU "hppa64-cpu" OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 798d0c26d7..6995eb69ef 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -243,6 +243,11 @@ struct ArchCPU { #include "exec/cpu-all.h" +static inline bool hppa_is_pa20(CPUHPPAState *env) +{ + return object_dynamic_cast(OBJECT(env_cpu(env)), TYPE_HPPA64_CPU) != NULL; +} + static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch) { #ifdef CONFIG_USER_ONLY diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 1644297bf8..192aae268d 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -207,20 +207,24 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops = &hppa_tcg_ops; } -static const TypeInfo hppa_cpu_type_info = { - .name = TYPE_HPPA_CPU, - .parent = TYPE_CPU, - .instance_size = sizeof(HPPACPU), - .instance_align = __alignof(HPPACPU), - .instance_init = hppa_cpu_initfn, - .abstract = false, - .class_size = sizeof(HPPACPUClass), - .class_init = hppa_cpu_class_init, +static const TypeInfo hppa_cpu_type_infos[] = { + { + .name = TYPE_HPPA_CPU, + .parent = TYPE_CPU, + .instance_size = sizeof(HPPACPU), + .instance_align = __alignof(HPPACPU), + .instance_init = hppa_cpu_initfn, + .abstract = false, + .class_size = sizeof(HPPACPUClass), + .class_init = hppa_cpu_class_init, + }, +#ifdef TARGET_HPPA64 + { + .name = TYPE_HPPA64_CPU, + .parent = TYPE_HPPA_CPU, + .instance_init = hppa64_cpu_initfn, + }, +#endif }; -static void hppa_cpu_register_types(void) -{ - type_register_static(&hppa_cpu_type_info); -} - -type_init(hppa_cpu_register_types) +DEFINE_TYPES(hppa_cpu_type_infos) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f86ea9b9ca..83115c944b 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -262,6 +262,7 @@ typedef struct DisasContext { int mmu_idx; int privilege; bool psw_n_nonzero; + bool is_pa20; #ifdef CONFIG_USER_ONLY MemOp unalign; @@ -4091,6 +4092,7 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->cs = cs; ctx->tb_flags = ctx->base.tb->flags; + ctx->is_pa20 = hppa_is_pa20(cpu_env(cs)); #ifdef CONFIG_USER_ONLY ctx->privilege = MMU_IDX_TO_PRIV(MMU_USER_IDX); From patchwork Fri Oct 20 20:42:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736352 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp504307wrl; Fri, 20 Oct 2023 13:56:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGg64G4jhmeshEuyZbaRdlLX7yuhb86lA8ovuLvLTvRMmGvKJWsq6azMejaVw9D7Gs0Tkb4 X-Received: by 2002:a05:620a:bcb:b0:770:f346:e9e8 with SMTP id s11-20020a05620a0bcb00b00770f346e9e8mr3351779qki.10.1697835405637; Fri, 20 Oct 2023 13:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835405; cv=none; d=google.com; s=arc-20160816; b=Flph83QOJR/FCbILdxRRC5t3FWeLVZWEzSU1ZU5dxlvKwwWx+PZ1fHv/3G8eGEt6bD cFewtIY+kDtGChG4V0NluP8rfLe4DoetddaU4lrVzJXZQmVNrjI40a6yNPawemJgAThw mPyy9DHqdyrhZy0+3VLoZ1N5/hCrJzTHndrv/deGRCwktj+/i72A0BJCdCLF/sGZPFRQ Io+QdUDv37GWuugxo567nQalk/p4LL1IZismHZHsWqEfB/fjuYGuMSLcRVmiuJgMAMeC e1B78P+TGLLkdZAYS09Vs0hC7bV8NLuQ1QQ1PLK3eEJwxnODGYD5iUezdNKU2nnNizOk Q2vg== 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=UGijUKxOjssioK5c9G9sCxgwEWxi/0wrwl9TMa9PkY0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Mjx/SwUwtyQq79fPC/e+WASy83064TUgw8uDNG3KFUlyCAUgb+QoT2xArY7qStILOU +8atCrARuaw8Y4EeAHzHE7VcAwGxBNkcprple1RuD5j2pphWA0dPgkigNlz3sA5foOfF jdSaaHjnnhHa1ISyir+fuK5cgQUCeY1+B9MxG4CcS7DfrzxzMh3ktfQBvjWp+0nGuj// rQXDEOtlLcieRpL6PPf8Q6l/iH9aFX4lPzCTFTtiX1Rwuhs/BenfF9Gge6F3HQdE2U02 IsdGJiUwM5WdYlCf4+ud29eDa1Ign7oTfAU1dAdnMY5dZ2c8x4MyHi0RvUgsd2B/fpR0 W9/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i2DlNLCQ; 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 f14-20020a05620a408e00b00777721dd71esi1833407qko.396.2023.10.20.13.56.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:56:45 -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=i2DlNLCQ; 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 1qtwLr-0007p5-De; Fri, 20 Oct 2023 16:44:11 -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 1qtwLW-0007jS-MJ for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:54 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLT-0008AW-Dy for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:49 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b5af4662b7so1157591b3a.3 for ; Fri, 20 Oct 2023 13:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834626; x=1698439426; 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=UGijUKxOjssioK5c9G9sCxgwEWxi/0wrwl9TMa9PkY0=; b=i2DlNLCQ5pbZ4c3vp3z81bYED6D+1uMs5Sfa0XqFMUfKPv0M0mdar+4/VQUCZESS8c rgJGIae5p6zvfsc/bNr2nqgTVk9TBy5BUNbJWJ/5Qn2NKrV5rK2Qz2sJv7YGE8sGKJDt IjFWhuCkmkJp4gvEHFPxeGXxMLJvhZfd8tRrOo8kZeAKcXe6GplRABkCi8vqJdrH/i+1 BVl537irErTfSuKnNwTUPANgCmaEDPl1R76nqe6afp9ky4jlLTcSdrjmAGzoUgHvcpgg i+bAYo7QvR6W1VNLHHImk5S4QB7D+rhhQLXjWW3fsHMdyjagblIBoLJzGZyVnOa3vesJ 3gOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834626; x=1698439426; 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=UGijUKxOjssioK5c9G9sCxgwEWxi/0wrwl9TMa9PkY0=; b=mEAlchh29DDhVOZMCq7VEzBqK807NgS+aPq0SyB1+xcGqjfcsyKhQFcDm4d2oqOfLj kDP04cqKFyj3AWBCpRrE+zf61fEFoSu1i3dq/Pxd9EwECx3afjV+hs723zs9tbyAtFke UMUUBk/heWg92CueknePF4demjG5ZJyym9lhRedlyt1j9fF8iGgPvwP0JLkDWVMpxPsv eM72c7hkG2W8GMSZOSUDxg53Eu7KjhgyxMFCqJAvNT3okkanT1lvAov+a2syPkm+mw6U B6uwCy8L7d+Rry0G8OEHdQQpfSQlV7PNk4L2dpQO9c/FtEiDeYanHS7iypVZzt+TMgSq VhFg== X-Gm-Message-State: AOJu0YzJ5HQxzdItWTEqZll2Txh/t7zRRd3TI+l2hw5zVrDngdijEOGh YstsiFpSD2H4cmZtVYna9rZSCVhxiIQVj31diuo= X-Received: by 2002:a05:6a21:4983:b0:172:83b8:67f7 with SMTP id ax3-20020a056a21498300b0017283b867f7mr2752274pzc.44.1697834626130; Fri, 20 Oct 2023 13:43:46 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 14/65] target/hppa: Make HPPA_BTLB_ENTRIES variable Date: Fri, 20 Oct 2023 13:42:40 -0700 Message-Id: <20231020204331.139847-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Depend on hppa_is_pa20. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 19 +++++++++++-------- hw/hppa/machine.c | 9 +++------ target/hppa/cpu.c | 3 +++ target/hppa/mem_helper.c | 40 ++++++++++++++++++++++------------------ 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 6995eb69ef..60fdd9e295 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -210,15 +210,13 @@ typedef struct CPUArchState { target_ureg cr_back[2]; /* back of cr17/cr18 */ target_ureg shadow[7]; /* shadow registers */ - /* ??? The number of entries isn't specified by the architecture. */ -#ifdef TARGET_HPPA64 -#define HPPA_BTLB_FIXED 0 /* BTLBs are not supported in 64-bit machines */ -#else -#define HPPA_BTLB_FIXED 16 -#endif -#define HPPA_BTLB_VARIABLE 0 + /* + * ??? The number of entries isn't specified by the architecture. + * BTLBs are not supported in 64-bit machines. + */ +#define PA10_BTLB_FIXED 16 +#define PA10_BTLB_VARIABLE 0 #define HPPA_TLB_ENTRIES 256 -#define HPPA_BTLB_ENTRIES (HPPA_BTLB_FIXED + HPPA_BTLB_VARIABLE) /* ??? Implement a unified itlb/dtlb for the moment. */ /* ??? We should use a more intelligent data structure. */ @@ -248,6 +246,11 @@ static inline bool hppa_is_pa20(CPUHPPAState *env) return object_dynamic_cast(OBJECT(env_cpu(env)), TYPE_HPPA64_CPU) != NULL; } +static inline int HPPA_BTLB_ENTRIES(CPUHPPAState *env) +{ + return hppa_is_pa20(env) ? 0 : PA10_BTLB_FIXED + PA10_BTLB_VARIABLE; +} + static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch) { #ifdef CONFIG_USER_ONLY diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 67d4d1b5e0..85682e6bab 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -185,6 +185,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus) uint64_t val; const char qemu_version[] = QEMU_VERSION; MachineClass *mc = MACHINE_GET_CLASS(ms); + int btlb_entries = HPPA_BTLB_ENTRIES(&cpu[0]->env); int len; fw_cfg = fw_cfg_init_mem(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4); @@ -196,11 +197,11 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus) fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version", g_memdup(&val, sizeof(val)), sizeof(val)); - val = cpu_to_le64(HPPA_TLB_ENTRIES - HPPA_BTLB_ENTRIES); + val = cpu_to_le64(HPPA_TLB_ENTRIES - btlb_entries); fw_cfg_add_file(fw_cfg, "/etc/cpu/tlb_entries", g_memdup(&val, sizeof(val)), sizeof(val)); - val = cpu_to_le64(HPPA_BTLB_ENTRIES); + val = cpu_to_le64(btlb_entries); fw_cfg_add_file(fw_cfg, "/etc/cpu/btlb_entries", g_memdup(&val, sizeof(val)), sizeof(val)); @@ -608,10 +609,6 @@ static void hppa_machine_reset(MachineState *ms, ShutdownCause reason) cs->exception_index = -1; cs->halted = 0; - - /* clear any existing TLB and BTLB entries */ - memset(cpu[i]->env.tlb, 0, sizeof(cpu[i]->env.tlb)); - cpu[i]->env.tlb_last = HPPA_BTLB_ENTRIES; } /* already initialized by machine_hppa_init()? */ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 192aae268d..e1293857f5 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -139,6 +139,9 @@ static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) HPPACPU *cpu = HPPA_CPU(cs); cpu->alarm_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, hppa_cpu_alarm_timer, cpu); + + memset(cpu->env.tlb, 0, sizeof(cpu->env.tlb)); + cpu->env.tlb_last = HPPA_BTLB_ENTRIES(&cpu->env); } #endif } diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 350485f619..48cb5b0d76 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -57,7 +57,7 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, hppa_tlb_entry *ent, HPPA_MMU_FLUSH_MASK, TARGET_LONG_BITS); /* never clear BTLBs, unless forced to do so. */ - if (ent < &env->tlb[HPPA_BTLB_ENTRIES] && !force_flush_btlb) { + if (ent < &env->tlb[HPPA_BTLB_ENTRIES(env)] && !force_flush_btlb) { return; } @@ -68,11 +68,11 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, hppa_tlb_entry *ent, static hppa_tlb_entry *hppa_alloc_tlb_ent(CPUHPPAState *env) { hppa_tlb_entry *ent; - uint32_t i; + uint32_t i, btlb_entries = HPPA_BTLB_ENTRIES(env); - if (env->tlb_last < HPPA_BTLB_ENTRIES || env->tlb_last >= ARRAY_SIZE(env->tlb)) { - i = HPPA_BTLB_ENTRIES; - env->tlb_last = HPPA_BTLB_ENTRIES + 1; + if (env->tlb_last < btlb_entries || env->tlb_last >= ARRAY_SIZE(env->tlb)) { + i = btlb_entries; + env->tlb_last = btlb_entries + 1; } else { i = env->tlb_last; env->tlb_last++; @@ -279,7 +279,7 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) int i; /* Zap any old entries covering ADDR; notice empty entries on the way. */ - for (i = HPPA_BTLB_ENTRIES; i < ARRAY_SIZE(env->tlb); ++i) { + for (i = HPPA_BTLB_ENTRIES(env); i < ARRAY_SIZE(env->tlb); ++i) { hppa_tlb_entry *ent = &env->tlb[i]; if (ent->va_b <= addr && addr <= ent->va_e) { if (ent->entry_valid) { @@ -363,11 +363,13 @@ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) number of pages/entries (we choose all), and is local to the cpu. */ void HELPER(ptlbe)(CPUHPPAState *env) { + uint32_t btlb_entries = HPPA_BTLB_ENTRIES(env); + trace_hppa_tlb_ptlbe(env); qemu_log_mask(CPU_LOG_MMU, "FLUSH ALL TLB ENTRIES\n"); - memset(&env->tlb[HPPA_BTLB_ENTRIES], 0, - sizeof(env->tlb) - HPPA_BTLB_ENTRIES * sizeof(env->tlb[0])); - env->tlb_last = HPPA_BTLB_ENTRIES; + memset(&env->tlb[btlb_entries], 0, + sizeof(env->tlb) - btlb_entries * sizeof(env->tlb[0])); + env->tlb_last = btlb_entries; tlb_flush_by_mmuidx(env_cpu(env), HPPA_MMU_FLUSH_MASK); } @@ -427,12 +429,14 @@ void HELPER(diag_btlb)(CPUHPPAState *env) hppa_tlb_entry *btlb; uint64_t virt_page; uint32_t *vaddr; + uint32_t btlb_entries = HPPA_BTLB_ENTRIES(env); -#ifdef TARGET_HPPA64 /* BTLBs are not supported on 64-bit CPUs */ - env->gr[28] = -1; /* nonexistent procedure */ - return; -#endif + if (btlb_entries == 0) { + env->gr[28] = -1; /* nonexistent procedure */ + return; + } + env->gr[28] = 0; /* PDC_OK */ switch (env->gr[25]) { @@ -446,8 +450,8 @@ void HELPER(diag_btlb)(CPUHPPAState *env) } else { vaddr[0] = cpu_to_be32(1); vaddr[1] = cpu_to_be32(16 * 1024); - vaddr[2] = cpu_to_be32(HPPA_BTLB_FIXED); - vaddr[3] = cpu_to_be32(HPPA_BTLB_VARIABLE); + vaddr[2] = cpu_to_be32(PA10_BTLB_FIXED); + vaddr[3] = cpu_to_be32(PA10_BTLB_VARIABLE); } break; case 1: @@ -464,7 +468,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) (long long) virt_page << TARGET_PAGE_BITS, (long long) (virt_page + len) << TARGET_PAGE_BITS, (long long) virt_page, phys_page, len, slot); - if (slot < HPPA_BTLB_ENTRIES) { + if (slot < btlb_entries) { btlb = &env->tlb[slot]; /* force flush of possibly existing BTLB entry */ hppa_flush_tlb_ent(env, btlb, true); @@ -484,7 +488,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) slot = env->gr[22]; qemu_log_mask(CPU_LOG_MMU, "PDC_BLOCK_TLB: PDC_BTLB_PURGE slot %d\n", slot); - if (slot < HPPA_BTLB_ENTRIES) { + if (slot < btlb_entries) { btlb = &env->tlb[slot]; hppa_flush_tlb_ent(env, btlb, true); } else { @@ -494,7 +498,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) case 3: /* Purge all BTLB entries */ qemu_log_mask(CPU_LOG_MMU, "PDC_BLOCK_TLB: PDC_BTLB_PURGE_ALL\n"); - for (slot = 0; slot < HPPA_BTLB_ENTRIES; slot++) { + for (slot = 0; slot < btlb_entries; slot++) { btlb = &env->tlb[slot]; hppa_flush_tlb_ent(env, btlb, true); } From patchwork Fri Oct 20 20:42:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736326 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502799wrl; Fri, 20 Oct 2023 13:51:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvnB5OTN8Lo8eKfrby4hDvqFgr/POo2GxZ52HUygve9VScT8e0YovZKBLbo+UfKYpC8RVW X-Received: by 2002:a67:ab4f:0:b0:457:dcf3:50ba with SMTP id k15-20020a67ab4f000000b00457dcf350bamr3058041vsh.26.1697835071204; Fri, 20 Oct 2023 13:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835071; cv=none; d=google.com; s=arc-20160816; b=Ovr3LAAHw6DLTSYHNgaOLwwtpr0/zTvZdJTuMhraLcA5i8vbcSpKhCmxLUAXUKfE2W sBodaNDDXrVzjYyKkoinBklPXvAgMH7LqkHNvUS/XxLBVBIlDoBq136ijwkbPbd/hHsl J8oEkLJlqUGQCgyzDdICA5/L6GzdNB2tfPKtdT/vWLgGrxkRkBtj7RdNT+sudciA2WIk XhyFDd7e7iTw4UexzmxCpofzIbuyEavl5e5MxbXNjMFDK2vlahCiqo92eTOG5Yl76fwU BDiJyx/A3GZBXDjYAiZof4wFFQwds02PL0UNA717wMxJvP64cGXFwHLFmOD3tH4xVU4+ GKPA== 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=cQ/zP1DZL3tOaBi0pMnG+Bu7Z8qJlO2g1403oqO8/6Q=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ktKu/IKj6ipzyIIEe9C4JjVX0cXuI95F1Z9qO0kaTYP9FB1ArqIeNTKFNSXEmyisgq fppP4hXNDdIaEoZL3O/gQyK7SirYG+NOd6rAwGw3aV78FDs1ADc6UXUxex84El1v/jYI YtmDiEJ5Oyxqzph29vVOU0F2APo+ZwrM1ZTbpZcR5DsVttW3FHe6gyn0pGGtMeDNWlV1 CdxLSDlsYw9Cyxpq+CgLtbZqK9ZRTmhDffhhd+QnBynvF77jsDj/Ci7Q5ZELLHqx4BbG diRC1r/tHKuQPTZCwnmqY3LT2ZVCLcpLHbkh0WHKNtYBRyjkbpuPp0ouLBUdrLSxe5ju WU4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wuk7oFPq; 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 o11-20020a05622a008b00b00419629f7784si1990258qtw.198.2023.10.20.13.51.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:11 -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=wuk7oFPq; 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 1qtwLq-0007ot-IF; Fri, 20 Oct 2023 16:44:10 -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 1qtwLW-0007jT-T2 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:54 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLU-0008Ah-Ei for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:50 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b497c8575aso1217932b3a.1 for ; Fri, 20 Oct 2023 13:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834627; x=1698439427; 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=cQ/zP1DZL3tOaBi0pMnG+Bu7Z8qJlO2g1403oqO8/6Q=; b=wuk7oFPqhIz3yPG/9A0KHnrSczKZRyia8Y0LPGe10rSnC62Dej9QGdsJ0oJDwEOxIO 9k5GnaQSRL3sAMhJg+g08CuhgvX1vkKCM+uRx0PnmUn9hIKKgZNab8zz0KHZarb81G5Y ie0COGHczahwG28MLAbGb18PoqcAXLFVAXAa6ogLQ5TmMHSus+jCfobVLgPgyyh520jV 1GU2C6fFXMxxP1e3DRba8u80zdotxalkPiYYxaJlr3oGdsnZLe8MV8EI1trcZgG5hiCD DyCcWRWQsU7V65y+uNbAPd9hgwrH7UrJeds5fHnLFsGwM2ahnREWRIk8okwP0leHAqKk 4Sxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834627; x=1698439427; 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=cQ/zP1DZL3tOaBi0pMnG+Bu7Z8qJlO2g1403oqO8/6Q=; b=QShsrzu6x9y9yIBJZLHbhP6jaKRioztcKfFWwFbhuA7/9CLSL7CG+ulGoSR5Gs8ilL nzK2PL0OkK9spP+MshLA1n+eAaOc+n45mJyDyFAjdsdPcRn4BiA9xFWCZ3toQrVf9N+g TstagrX5LwYsOeVYGMwyvddeo11rVsVnKrco1xVe/X7W2Pf5g/ZSD7ZQ5rQGylMGPlAT ipRI6Uwp2jMiJdhEsx67v3f1YGrHkJLEnphlgUPh/wyoG48wLbiWoK29QyVeJZ7ddzJ/ hY1VcS1l7fc64JwSx3VqPJnbRv1ULYoX/wNHvO+DtZVdC4DOK5xxT6Y8EG+HFXJKu0Mo E1dA== X-Gm-Message-State: AOJu0YxNcOj6tDYQitb59ZpDzWep98rjV3ul1/ct8iEtcJ+geZxV/ySw ERipmv1oRbaLfPw+qlvNEtLK3Nznhkygve5saRs= X-Received: by 2002:a05:6a20:5481:b0:173:e36c:6d03 with SMTP id i1-20020a056a20548100b00173e36c6d03mr3600808pzk.22.1697834626998; Fri, 20 Oct 2023 13:43:46 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 15/65] target/hppa: Implement cpu_list Date: Fri, 20 Oct 2023 13:42:41 -0700 Message-Id: <20231020204331.139847-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 5 +++++ target/hppa/cpu.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 60fdd9e295..e087879399 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -366,4 +366,9 @@ int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr); #endif G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t ra); +#define CPU_RESOLVING_TYPE TYPE_HPPA_CPU + +#define cpu_list hppa_cpu_list +void hppa_cpu_list(void); + #endif /* HPPA_CPU_H */ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index e1293857f5..b063255b30 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -162,6 +162,30 @@ static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) return object_class_by_name(TYPE_HPPA_CPU); } +static void hppa_cpu_list_entry(gpointer data, gpointer user_data) +{ + ObjectClass *oc = data; + CPUClass *cc = CPU_CLASS(oc); + const char *tname = object_class_get_name(oc); + g_autofree char *name = g_strndup(tname, strchr(tname, '-') - tname); + + if (cc->deprecation_note) { + qemu_printf(" %s (deprecated)\n", name); + } else { + qemu_printf(" %s\n", name); + } +} + +void hppa_cpu_list(void) +{ + GSList *list; + + list = object_class_get_list_sorted(TYPE_HPPA_CPU, false); + qemu_printf("Available CPUs:\n"); + g_slist_foreach(list, hppa_cpu_list_entry, NULL); + g_slist_free(list); +} + #ifndef CONFIG_USER_ONLY #include "hw/core/sysemu-cpu-ops.h" From patchwork Fri Oct 20 20:42:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736297 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501371wrl; Fri, 20 Oct 2023 13:46:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEasHpxtmGfyulkTaldAgNXK1SmWdYXHAiNYk8uRRnxnyTVH32UBW7jp97fEXUXnI1FjCku X-Received: by 2002:a05:6871:3147:b0:1ea:3746:b7d6 with SMTP id lu7-20020a056871314700b001ea3746b7d6mr3985446oac.28.1697834767889; Fri, 20 Oct 2023 13:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834767; cv=none; d=google.com; s=arc-20160816; b=gywOkf4lgkmqNtESGhkhloKqhP8+xVkFzqgZGnsPOnpB6pJjV6rw/jiKHsQBy5jfFR 2KXOi2ceTypH8ZLyvB+kDpINhvMT54DXimH7J+PNkq67jDE1xF4sy62r+939UrIcCQdm XdSI44e0GS1Kgm9Ie9j1JPaU4PT0/7XZ+jaYdj8EYV9I74Zo+lt3MlIrA003qrig3tvC qrVAxOk9s0JjnrlBWkqcOvvgJRsZ+enjy7AAdUrE8t30FSynPaBwkVT7Ggl3f7UUBvxn JOCw0IlDXNTxYIdgB33JEzWZCHOM8pNJzX1yJcYYLismbUSItM2kIOozW6jQ7NDJX1S1 Q+Xg== 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=9ctFFMD0i4UBxb8cY/h6EWp2LE3DVdzDCEH3soxezJg=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=WBG9DjdWqOziuKeYLeFixq5XdXhiNKw5dwbcDZpAtp5E8NZuEZ8zFvp7FVs7rejiZ4 W+C7ZY/wx990K4XOvO2bIe4X5/7Z4BxD6YF8Cz/Dtjsv5nkljkYfxeA34ugruH6oo3nB UuW8beEIVx3dRUBT2F+kLXkPP+yALh3gMS0JA9ArGatIfE/WnFG2aBu9h19yETsNicFP 05aGPa+T5BYs9z1gxXwIl620nvolUqnnOvdM8BvyObv6i2kf2jWh261t46w+xycdPKVr y9ciqzKtW/mcw4+bgxQnUTLpuwuKxfrWIW7fG4hd+sEOt+P2Dzu5NApOlN2bQG8NkAWU r9Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A0sRakxq; 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 l16-20020ad44d10000000b0066d08ac0ba0si1976634qvl.230.2023.10.20.13.46.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:46:07 -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=A0sRakxq; 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 1qtwLw-0007uq-Dz; Fri, 20 Oct 2023 16:44:16 -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 1qtwLY-0007jd-2Y for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:59 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLU-0008Ao-VV for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:50 -0400 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5aaebfac4b0so854638a12.2 for ; Fri, 20 Oct 2023 13:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834627; x=1698439427; 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=9ctFFMD0i4UBxb8cY/h6EWp2LE3DVdzDCEH3soxezJg=; b=A0sRakxqQFl7yfixQ3EG/Fvq2FLgA+y/9L/W5+WgGO2kuoDq+wFeASq0ZitjQbU5Qc C9SBJhlL2WHZWidS252JcdmJI91EKbT3f5cVkOJFpKS+2fal02nKjKo51/+xd2CkT4hA /s/lCiuM2qRGHEhusLCWvbtNLJPVsDGSPZ5QMuqDki4zO95IEwd5wssUlh0vdtG8H3+v kF01kYabU7kRY3NSd98o2H4e+GumQwSMdizEhlZMhFO9dM9brK9FgzBZrGAvW7ApzRIt sslVqLF96sZjSA1PqMTvpQVXXgDFutCkESHMoxmVD2XiN3tT9wC7OnnW4XaWXvDGQQox 8Suw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834627; x=1698439427; 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=9ctFFMD0i4UBxb8cY/h6EWp2LE3DVdzDCEH3soxezJg=; b=cK7ILpzwE/nt6FF7Pu+5n8TNxOdAA7xjhyX3HlXvKfsrANEowIYL0qDglouUh5eayi 3Az0ayHE5rml3AscU6k9ZpJuUkoZKh/Ofszxak0pUviYdspJzOEneeKhvPkEmfSADFY4 PqylSN7/K+a2oym9wIaCBrG7ICBV+PvUznQ9nvbSAzmlk3DsEMrMU4C0I6aPB+oy/O7T s7YpfPD50H/O1jC6sjyvVphDPfeyOi6LPDZbwBhbDZFXZJwplrs37IfPYgIZOVxBaBQk 7Z30zaKZ2/RKgeBUu0X+V5Hha5ZJgoNaZ8RxPNVW7a5i1noVRCIfymyAD9Ot7fS7PXsk Paow== X-Gm-Message-State: AOJu0YzFeU2LfQ997MLiC3+OSSUVVPwaPsXs+O9n1C3RT03xnKuQOsj8 7pMvz5wM8J40xBtczmEtN/86UzjHATKiiucpUK4= X-Received: by 2002:a05:6a21:3282:b0:17b:689e:c757 with SMTP id yt2-20020a056a21328200b0017b689ec757mr3344562pzb.11.1697834627673; Fri, 20 Oct 2023 13:43:47 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 16/65] target/hppa: Implement hppa_cpu_class_by_name Date: Fri, 20 Oct 2023 13:42:42 -0700 Message-Id: <20231020204331.139847-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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 Signed-off-by: Richard Henderson --- linux-user/hppa/target_elf.h | 2 +- target/hppa/cpu.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/linux-user/hppa/target_elf.h b/linux-user/hppa/target_elf.h index 82b4e9535e..19cae8bd65 100644 --- a/linux-user/hppa/target_elf.h +++ b/linux-user/hppa/target_elf.h @@ -9,6 +9,6 @@ #define HPPA_TARGET_ELF_H static inline const char *cpu_get_model(uint32_t eflags) { - return "any"; + return "hppa"; } #endif diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index b063255b30..81d51e98b6 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -159,7 +159,15 @@ static void hppa_cpu_initfn(Object *obj) static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) { - return object_class_by_name(TYPE_HPPA_CPU); + g_autofree char *typename = g_strconcat(cpu_model, "-cpu", NULL); + ObjectClass *oc = object_class_by_name(typename); + + if (oc && + !object_class_is_abstract(oc) && + object_class_dynamic_cast(oc, TYPE_HPPA_CPU)) { + return oc; + } + return NULL; } static void hppa_cpu_list_entry(gpointer data, gpointer user_data) From patchwork Fri Oct 20 20:42:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736292 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501043wrl; Fri, 20 Oct 2023 13:45:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1hVCJ3e//mNl3xZ4RNBRENQ9hnXM03QMsACtp892oBYZTLFB5mqnb9DooHNAS0caY9Wom X-Received: by 2002:a05:620a:2444:b0:774:2c5c:557e with SMTP id h4-20020a05620a244400b007742c5c557emr2492015qkn.1.1697834704731; Fri, 20 Oct 2023 13:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834704; cv=none; d=google.com; s=arc-20160816; b=q2zSNMaWxl4x08m/d7pyGbSp4cO2mxyO9V7qCZfA8t8GeORMeQ3eFF7CuCMMXnmGS2 jc0X3ki9X0cnZNQtEsI5sCWo06SIJkNbfQoAtGmrHMcV2GNQzRhV3/uBAhU2KpD1CAX2 gHZyGw8zvlxRofyqgf/8bfN0npjNATugEYcMFEdMdAiEM8b0e6EcHe6yXqGv23PRyiJE X8zZ1F7UEPMUVcNZWGpMe6X1eq+xY3cU6534J5gCsQ9JEO7a6h2Q+45uL280UkIWZH8k IgfVoTeXJCHDIRB63a5ufxHYukcWBeNK+uMASYNZVVIrYzNAbuzLesLRxx6vrzx1ibEd xOKg== 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=/Td/Ysv7eoH4uj7r0UKubRW7kAk7MGHOo1UhYXHuswg=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=I+8t5iy0y3BIDNRe9LLFl/TcHFNd5CoxXf5fRPiBzJj20vUWXKHgc014C5ZTkvYigu Qm3Cyg0ep+MBQagw5mYgJ569ZdZzVg5QWbcpj0F116TiHFXq1cXRrxu2C/jgcAejKBYX bmrvNd9emZXv5U2g+u5viC49On9rXtbq5NNd/ivNO0hhEJ8Wm1NAcHZbfUFFMq2ElK8+ zumpwyrL7LE6venYCGAaSDJvTQ8pBTkH6joE3c8XXhf05r0HqEn5sQnqJR1PUtwrmLAb g7HJP1ivyJbYO0NKfmWGW5U4GWAEpiGAaIJ2NigliX26KmjHYgxYkcqf0OARWkQGpVA/ iipQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jW/ul2Sl"; 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 12-20020a05620a040c00b007757f6e19bbsi1934138qkp.412.2023.10.20.13.45.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:45:04 -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="jW/ul2Sl"; 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 1qtwLs-0007pL-Q7; Fri, 20 Oct 2023 16:44:12 -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 1qtwLY-0007jc-2d for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:59 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLV-0008B2-Mo for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:51 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6ba54c3ed97so1176085b3a.2 for ; Fri, 20 Oct 2023 13:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834628; x=1698439428; 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=/Td/Ysv7eoH4uj7r0UKubRW7kAk7MGHOo1UhYXHuswg=; b=jW/ul2Slp828MP+g9H2aGmAcE6rfJS84M1qrSQhvBpG9uDxMxzfg43tzMCzGnWyFUh RHKB1r52nWEtu7EHS7aFf+lyuoB7vXUdf9YZu0+OqGzDLC0/16rIgpmOxxywcpp/tq6z dn7C1LJEn9tJg7zRmyl/VA/32Pd9BV/tts21SyCy5ssoYTqHWCCUr7RSfodtv7Yn2Orv xnCEJ/+hve8m8miHpCIjTjo2IWfTMgm6jnMDQR5fZZlyy4tdC6QY4aIB8qdO2tgxr4eW mJyv1Ms2+ZeaCWQGBhe7CJ+/o1JvB7KwExvNrKx/djw7qJb7A2m+vYKCbQuvC60Df0/M mR4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834628; x=1698439428; 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=/Td/Ysv7eoH4uj7r0UKubRW7kAk7MGHOo1UhYXHuswg=; b=acuBzn0V4onwTRhABNmHkC7npzKjJA7Y5tcmUmBU1PjN5LzM4OdzDybLyHryUDFMGR /WU+Kt+QTgTUFxgFjasTMRWLSIhCc/ZOiaUKHPQZoa65IXehHJ1uz10nm3Dzasq9w1CC LFxeUeq7Yg0czLsZ4Oj7YvUFYTpBnX5xaoflDUR4PEYoUXESDtUN+jXi6AXVKNgxwbzo J1wuvFSKjznQ8Y7CcPPZrIEmUV4pPHPGXvkQ3qBIbqBK/XbUHTXVaEyuRd3jP3pBaXq+ vfbwOI/M1Uzc5xznVJQbZBM7k5b2vnpk77qt3yDdF6QyDZZXOdgfMtGDm/vsgY+7lYjP YB3A== X-Gm-Message-State: AOJu0YyNKxF84YboBHUv1peRFlDnuvatNCsDil2UPvVdTXaUHwOO59DQ Zbmml2aW+5Tba5cgUR7qbcHS5eYpk/B6JSKLIH8= X-Received: by 2002:a05:6a20:7fa6:b0:17a:eddb:ac6a with SMTP id d38-20020a056a207fa600b0017aeddbac6amr4113829pzj.6.1697834628432; Fri, 20 Oct 2023 13:43:48 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 17/65] target/hppa: Update cpu_hppa_get/put_psw for hppa64 Date: Fri, 20 Oct 2023 13:42:43 -0700 Message-Id: <20231020204331.139847-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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 With 64-bit registers, there are 16 carry bits in the PSW. Clear reserved bits based on cpu revision. Signed-off-by: Richard Henderson --- target/hppa/helper.c | 63 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index a8d3f456ee..534a9e374c 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -28,19 +28,35 @@ target_ureg cpu_hppa_get_psw(CPUHPPAState *env) { target_ureg psw; + target_ureg mask1 = (target_ureg)-1 / 0xf; + target_ureg maskf = (target_ureg)-1 / 0xffff * 0xf; /* Fold carry bits down to 8 consecutive bits. */ - /* ??? Needs tweaking for hppa64. */ - /* .......b...c...d...e...f...g...h */ - psw = (env->psw_cb >> 4) & 0x01111111; - /* .......b..bc..cd..de..ef..fg..gh */ + /* ^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^i^^^j^^^k^^^l^^^m^^^n^^^o^^^p^^^^ */ + /* ^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^^ */ + psw = (env->psw_cb >> 4) & mask1; + /* .......b...c...d...e...f...g...h...i...j...k...l...m...n...o...p */ + /* .......b...c...d...e...f...g...h */ psw |= psw >> 3; - /* .............bcd............efgh */ - psw |= (psw >> 6) & 0x000f000f; - /* .........................bcdefgh */ - psw |= (psw >> 12) & 0xf; - psw |= env->psw_cb_msb << 7; - psw = (psw & 0xff) << 8; + /* .......b..bc..cd..de..ef..fg..gh..hi..ij..jk..kl..lm..mn..no..op */ + /* .......b..bc..cd..de..ef..fg..gh */ + psw |= psw >> 6; + psw &= maskf; + /* .............bcd............efgh............ijkl............mnop */ + /* .............bcd............efgh */ + psw |= psw >> 12; + /* .............bcd.........bcdefgh........efghijkl........ijklmnop */ + /* .............bcd.........bcdefgh */ + psw |= env->psw_cb_msb << (TARGET_REGISTER_BITS == 64 ? 39 : 7); + /* .............bcd........abcdefgh........efghijkl........ijklmnop */ + /* .............bcd........abcdefgh */ + + /* For hppa64, the two 8-bit fields are discontiguous. */ + if (hppa_is_pa20(env)) { + psw = (psw & 0xff00000000ull) | ((psw & 0xff) << 8); + } else { + psw = (psw & 0xff) << 8; + } psw |= env->psw_n * PSW_N; psw |= (env->psw_v < 0) * PSW_V; @@ -51,14 +67,39 @@ target_ureg cpu_hppa_get_psw(CPUHPPAState *env) void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) { + uint64_t reserved; target_ureg old_psw = env->psw; target_ureg cb = 0; + /* Do not allow reserved bits to be set. */ + if (hppa_is_pa20(env)) { + reserved = MAKE_64BIT_MASK(40, 24) | MAKE_64BIT_MASK(28, 4); + reserved |= PSW_G; /* PA1.x only */ + reserved |= PSW_E; /* not implemented */ + } else { + reserved = MAKE_64BIT_MASK(32, 32) | MAKE_64BIT_MASK(28, 2); + reserved |= PSW_O | PSW_W; /* PA2.0 only */ + reserved |= PSW_E | PSW_Y | PSW_Z; /* not implemented */ + } + psw &= ~reserved; + env->psw = psw & ~(PSW_N | PSW_V | PSW_CB); env->psw_n = (psw / PSW_N) & 1; env->psw_v = -((psw / PSW_V) & 1); - env->psw_cb_msb = (psw >> 15) & 1; +#if TARGET_REGISTER_BITS == 32 + env->psw_cb_msb = (psw >> 15) & 1; +#else + env->psw_cb_msb = (psw >> 39) & 1; + cb |= ((psw >> 38) & 1) << 60; + cb |= ((psw >> 37) & 1) << 56; + cb |= ((psw >> 36) & 1) << 52; + cb |= ((psw >> 35) & 1) << 48; + cb |= ((psw >> 34) & 1) << 44; + cb |= ((psw >> 33) & 1) << 40; + cb |= ((psw >> 32) & 1) << 36; + cb |= ((psw >> 15) & 1) << 32; +#endif cb |= ((psw >> 14) & 1) << 28; cb |= ((psw >> 13) & 1) << 24; cb |= ((psw >> 12) & 1) << 20; From patchwork Fri Oct 20 20:42:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736314 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502305wrl; Fri, 20 Oct 2023 13:49:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPHCzMrn8tjz0DC8tVFe2qj6GcV+PsmiVMoJW1yw3PC1rkT0DEibM2G0wtymYRuu31xX/I X-Received: by 2002:a05:620a:25cc:b0:778:90a1:d3e7 with SMTP id y12-20020a05620a25cc00b0077890a1d3e7mr3201240qko.41.1697834958082; Fri, 20 Oct 2023 13:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834958; cv=none; d=google.com; s=arc-20160816; b=g8jRVtKXsC6RPHaN3qTtbWIOi9xKdpAiqlJizqs+Y7R4jiiSVIig+qw/XNasz3P6Bx P93EcDydNYq5fJmweVXzqQZ6+d/hZdDidmoYW+hOqiFgQ07YlaXOAbn6rHcbLAJPvxIl EZ21gzBGOMtpPv+0uHmo9JHTupRPWvC4A9xbz9DMzCstGZrSMHvvSljw+oyXucli2gxf YfQpKnmFqCfXNkwR73pqyyOEMxOV0QQ0v6FJ7muGBuaS7h8GcfngNLAbhOdgKKorMWBs 4O4bgadf2G97Tj0kVOUk3VbsiIANCeeguqA7M5CG+8N0wu1Bgat1HWg1P2IhV/kpmiF+ Vrug== 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=Bc0q97Cx2QaZpbCyXU6bCv+F4YXYfta8rMxuf/N3B78=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=kxkjUaZ+gY4XazlMgDXsOqmTmlDCyhpwWzTmw7kGuuASY81yBmH1YQnYcaLf6ht2vE zzzqR7XoHhs+++W6rpBBbZinygfoSD8362rlCKIjQ99anoHSEHpQwxcFovXha6cjkPYz ytXoW8ZmvXTc94NOm8GOzzjuUJvVodZhWhpaiDn2nZUDg/1ICJpwDsquslXrAQBFsD5d OXJFEvLTcV9D9xAYnhCgYMsyCidtLy16xqP3orNS/kZa2FsfcnT0q+kcHZ+/db6xjjgP iN3y6Bj5qGtqYIIwHCEwH8eZpKRTAfaBa8ftaEFuLc11kXmVPQ6r4FtRn5nNevD3qB1w uYVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rW/kjKel"; 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 v16-20020a05620a123000b0076da4734528si1862643qkj.357.2023.10.20.13.49.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:49:18 -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="rW/kjKel"; 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 1qtwLs-0007pI-6D; Fri, 20 Oct 2023 16:44:12 -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 1qtwLd-0007kQ-M3 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:01 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLW-0008BJ-M2 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:53 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b6f4c118b7so1179584b3a.0 for ; Fri, 20 Oct 2023 13:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834629; x=1698439429; 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=Bc0q97Cx2QaZpbCyXU6bCv+F4YXYfta8rMxuf/N3B78=; b=rW/kjKelHxED4dVZpxbclHoxpPgzeOVW9Bx3NWCM7cHYvBKjrHTn2+K4Lp73se4As/ HcWVShCzKZDjSlrGpyrhKrjW6kgsomJwSClOM8cpFZgIIulhBu/vXXNYvw1C8lzWjgaq DF23daqYyVf7xwMBZSaANpjZ6Y7lLV8X1lar6xwn2Fy14I1tvN4Q6HeFtnlRrnZbujQM q+c5RUsX5GtvF/qLV1L7zh2aJL3Oh5pEXPPYaPCDr23GJAxBLQ/bWMU8+tHhk2QgkSOZ dWW97c+5ZvWvICQJ47Y+GS1gHVwG8Zx0ox02VqONvS/EvvwDJRieNTFWQzgqWUEm3c2M dU/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834629; x=1698439429; 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=Bc0q97Cx2QaZpbCyXU6bCv+F4YXYfta8rMxuf/N3B78=; b=lZ68XeQRv39RPora6Ka4SSaONAZkOw5ji98iyF8gkwjMoSsTO96HEg3JvTYtZ0fWFK 1dX95lPdZJN2yVIE/N+JwBGMSlJ2VF9NRZ32TnYIOnUj+qtfSWzsBPYl780WyxEOvWq2 Kfp3XNqeo6XsCRcX+xMrQZ7zaWNEO0BYwc0z6ar0Uh1aLK+SpGtXl+H/qx+nsCN9WAgy 2a+6WWpLQW18kOX3eVjMBap2Uk67UYFLBXAKCuKyWnrShqjB0Qu+Cmzxhz2agKmiGh9+ RdhGumuOQ00PZR0khgQniIXvbBRUR+uM8Bssc/olBVRxx/xg3pgSFmoDmyY7zA4wBiwY iQnw== X-Gm-Message-State: AOJu0YxPRP1U0SqUMaNFnuTdgsbgAlbGR4YwQz8CSjrBafh+aDmTX7SM BM3I2G68rZrdYK5x0yVKNgVBxdBg3Wdc1oAESXw= X-Received: by 2002:a05:6a20:918e:b0:179:f81b:12d9 with SMTP id v14-20020a056a20918e00b00179f81b12d9mr3080473pzd.11.1697834629239; Fri, 20 Oct 2023 13:43:49 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 18/65] target/hppa: Handle absolute addresses for pa2.0 Date: Fri, 20 Oct 2023 13:42:44 -0700 Message-Id: <20231020204331.139847-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 With pa2.0, absolute addresses are not the same as physical addresses, and undergo a transformation based on PSW_W. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 3 +++ target/hppa/helper.c | 4 ++-- target/hppa/mem_helper.c | 49 +++++++++++++++++++++++++++++++++++++--- target/hppa/sys_helper.c | 9 ++++++++ 4 files changed, 60 insertions(+), 5 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index e087879399..622b4af890 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -284,6 +284,9 @@ static inline target_ulong hppa_form_gva(CPUHPPAState *env, uint64_t spc, return hppa_form_gva_psw(env->psw, spc, off); } +hwaddr hppa_abs_to_phys_pa2_w0(vaddr addr); +hwaddr hppa_abs_to_phys_pa2_w1(vaddr addr); + /* * Since PSW_{I,CB} will never need to be in tb->flags, reuse them. * TB_FLAG_SR_SAME indicates that SR4 through SR7 all contain the diff --git a/target/hppa/helper.c b/target/hppa/helper.c index 534a9e374c..6a00085dae 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -109,8 +109,8 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) cb |= ((psw >> 8) & 1) << 4; env->psw_cb = cb; - /* If PSW_P changes, it affects how we translate addresses. */ - if ((psw ^ old_psw) & PSW_P) { + /* If P or W changes, it affects how we translate addresses. */ + if ((psw ^ old_psw) & (PSW_P | PSW_W)) { #ifndef CONFIG_USER_ONLY tlb_flush_by_mmuidx(env_cpu(env), HPPA_MMU_FLUSH_MASK); #endif diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 48cb5b0d76..1a63717571 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -25,6 +25,45 @@ #include "hw/core/cpu.h" #include "trace.h" +hwaddr hppa_abs_to_phys_pa2_w1(vaddr addr) +{ + if (likely(extract64(addr, 58, 4) != 0xf)) { + /* Memory address space */ + return addr & MAKE_64BIT_MASK(0, 62); + } + if (extract64(addr, 54, 4) != 0) { + /* I/O address space */ + return addr | MAKE_64BIT_MASK(62, 2); + } + /* PDC address space */ + return (addr & MAKE_64BIT_MASK(0, 54)) | MAKE_64BIT_MASK(60, 4); +} + +hwaddr hppa_abs_to_phys_pa2_w0(vaddr addr) +{ + if (likely(extract32(addr, 28, 4) != 0xf)) { + /* Memory address space */ + return addr & MAKE_64BIT_MASK(0, 32); + } + if (extract32(addr, 24, 4) != 0) { + /* I/O address space */ + return addr | MAKE_64BIT_MASK(32, 32); + } + /* PDC address space */ + return (addr & MAKE_64BIT_MASK(0, 24)) | MAKE_64BIT_MASK(60, 4); +} + +static hwaddr hppa_abs_to_phys(CPUHPPAState *env, vaddr addr) +{ + if (!hppa_is_pa20(env)) { + return addr; + } else if (env->psw & PSW_W) { + return hppa_abs_to_phys_pa2_w1(addr); + } else { + return hppa_abs_to_phys_pa2_w0(addr); + } +} + static hppa_tlb_entry *hppa_find_tlb(CPUHPPAState *env, vaddr addr) { int i; @@ -99,7 +138,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, /* Virtual translation disabled. Direct map virtual to physical. */ if (mmu_idx == MMU_PHYS_IDX) { - phys = addr; + phys = hppa_abs_to_phys(env, addr); prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; goto egress; } @@ -213,7 +252,7 @@ hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) /* ??? We really ought to know if the code mmu is disabled too, in order to get the correct debugging dumps. */ if (!(cpu->env.psw & PSW_D)) { - return addr; + return hppa_abs_to_phys(&cpu->env, addr); } excp = hppa_get_physical_address(&cpu->env, addr, MMU_KERNEL_IDX, 0, @@ -299,7 +338,11 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) /* Note that empty->entry_valid == 0 already. */ empty->va_b = addr & TARGET_PAGE_MASK; empty->va_e = empty->va_b + TARGET_PAGE_SIZE - 1; - empty->pa = extract32(reg, 5, 20) << TARGET_PAGE_BITS; + /* + * FIXME: This is wrong, as this is a pa1.1 function. + * But for the moment translate abs address for pa2.0. + */ + empty->pa = hppa_abs_to_phys(env, extract32(reg, 5, 20) << TARGET_PAGE_BITS); trace_hppa_tlb_itlba(env, empty, empty->va_b, empty->va_e, empty->pa); } diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index 4bb4cf611c..f0dd5a08e7 100644 --- a/target/hppa/sys_helper.c +++ b/target/hppa/sys_helper.c @@ -71,6 +71,15 @@ target_ureg HELPER(swap_system_mask)(CPUHPPAState *env, target_ureg nsm) * so let this go without comment. */ env->psw = (psw & ~PSW_SM) | (nsm & PSW_SM); + + /* + * Changes to PSW_W change the translation of absolute to physical. + * This currently (incorrectly) affects all translations. + */ + if ((psw ^ env->psw) & (PSW_P | PSW_W)) { + tlb_flush(env_cpu(env)); + } + return psw & PSW_SM; } From patchwork Fri Oct 20 20:42:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736303 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501775wrl; Fri, 20 Oct 2023 13:47:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtHx4waADuO/8Hyy7id04986qHW4lOl2nh5lIGzXm9GJ8/LBKc6ZjwL//NHpiYrxEAbEdW X-Received: by 2002:a05:6214:508:b0:656:48e3:7afe with SMTP id px8-20020a056214050800b0065648e37afemr8411307qvb.17.1697834853629; Fri, 20 Oct 2023 13:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834853; cv=none; d=google.com; s=arc-20160816; b=eBoA+MPdMY2QeIuXqEqTy5ZDb5QWnFDWKQcFjFxr9M6tVw0KXpyhpd9xW6jxikmBm1 7L9DrRzi+BTEc81uykp4VxlIM11MmAygE2hU7XDQIqY27izHWu4G9nlRTegDnzkzHwhe pTqSlNvEMEWfIxgAyrjAic3+CVVoiRXpv3rpVuQ10QP/Zg/HUo6JAq544Re1Hgg6fzu1 XxGyFLZfmRSt0WDFJ0hNI7Jdk5NyDr0jsRiYozkW/uQ5Mt/fuA+c3tn9gJ6oDflSHx7v pQY2ckKUzssdOiDy19lRQuElWOuXOHTTKwZNHsZZkqj1YVHR3hLY1K9letz1eTUR4RLH WAwg== 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=ka76jULHKdXJXE2rW24+yLIEC0vFTRHnoerX56yKdQY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=vKhMv24nS36XOETlzCn5bFD1eb4RInaA1143oXT1v2SxX34Fl/qucCPGUWQ7wZSs+d mq5+36eiCZzX2+xMXEkXBP4NOh5kKuOFIhCNoKFrMu2PvJZlrl5KBOC7HPdk6chGKcBf 9ZamnC/oZu4MDhTM7HHwrxX7mv/7+UgkA/IzcHW5FQDDKHMI3/Zcueem1vpIlZvdvQ8W HKfxPCx07WfcbgDWc68lwHVGDHVn/ojtith8nB6ndfbUibXRxCc6mx3mOsQOsDSowHfm B8hVr0uewEywAu/be3gxSFYshDfC4a5ZEHtj04LbmclmiyFUc09n8CWmG2H+a9vVu5Pe 8CAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qk9+nZ6o; 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 m17-20020ad44d51000000b0065cfea0fee7si1915513qvm.423.2023.10.20.13.47.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:47:33 -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=Qk9+nZ6o; 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 1qtwLx-0007v6-IE; Fri, 20 Oct 2023 16:44:17 -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 1qtwLd-0007kR-Ox for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:01 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLX-0008BU-Qg for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:53 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b44befac59so1870647b3a.0 for ; Fri, 20 Oct 2023 13:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834630; x=1698439430; 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=ka76jULHKdXJXE2rW24+yLIEC0vFTRHnoerX56yKdQY=; b=Qk9+nZ6oQUhUh9SXpMX4MSu6yV0rykmmZVlWtU5JL6qDcKcq2lGWUxbra8bN/CNIco peQ2i6QNEa0WI+OyvRK+XIyHS0HrUCqoKd6ARbG+ln+eQhxYNWwy3eAtDaIAdrfeD1qI uJxtYUgbGbj/wt4G+rYfa7fjTuydqgd+heIUOE/M/eFGjK1oSh1A28bAfsJJGxWWyVuE wkMAAYoPZY4KZBss/RYMnCZ4z7CaJVbUM1g7I6dG0Yd+kqSxPxMMKVXWEq+XpVKwLNa5 2k15bFevOU9GVy9BOST5B3AYdfn3ftEB+SVqCDPwJ+tJLxtpmG1uNTmqnK1x68J7bV57 yYtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834630; x=1698439430; 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=ka76jULHKdXJXE2rW24+yLIEC0vFTRHnoerX56yKdQY=; b=Ta2f7c9sLKg8+rIOd/QIg6CxaYpYB9KCP9N/xvqFMTgafITaNnqUKW1yiTzi+5oRPO nKkVcVI/6Ip+Gi/bBpaOtvsKOnqka4htiRF+52JWNDyH4DlTJWd8OQc/FRVEzJdw8Yaw Q8lXoIrMhdod9Q4XvSJO5LlssJLSJq1fEv7i+OoDVP3tEe/U6hmWkErBYy4lnlLjHL8H EDPHZWYwC9osr7u/Y3H1xNT5WfHAp+7qW3WAFOCT1pWQUlSeCDnxo5O/pdS2kW4TR6dL F+scVwxzl39sLWNSOE/bFw+gNlINcDwVzQtab0N+MEy/+ENS0EQLx9Z5MECM3uuob5Z5 No/g== X-Gm-Message-State: AOJu0Yw8e1O9INfCPkA0fjcgkdp+xTZKy3SABQQbRSnN0TqSm3bmooPd 0HVVWndRcP3AkyMOftrCPeoE+MDjeAIZITDiCbw= X-Received: by 2002:a05:6a20:a110:b0:17b:40:ccc6 with SMTP id q16-20020a056a20a11000b0017b0040ccc6mr3754626pzk.4.1697834630033; Fri, 20 Oct 2023 13:43:50 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 19/65] target/hppa: Adjust hppa_cpu_dump_state for hppa64 Date: Fri, 20 Oct 2023 13:42:45 -0700 Message-Id: <20231020204331.139847-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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 Dump all 64 bits for pa2.0 and low 32 bits for pa1.x. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/hppa/helper.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index 6a00085dae..a2ae7aca30 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -119,18 +119,26 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) { - HPPACPU *cpu = HPPA_CPU(cs); - CPUHPPAState *env = &cpu->env; + CPUHPPAState *env = cpu_env(cs); target_ureg psw = cpu_hppa_get_psw(env); target_ureg psw_cb; char psw_c[20]; - int i; + int i, w; + uint64_t m; + + if (hppa_is_pa20(env)) { + w = 16; + m = UINT64_MAX; + } else { + w = 8; + m = UINT32_MAX; + } qemu_fprintf(f, "IA_F " TARGET_FMT_lx " IA_B " TARGET_FMT_lx - " IIR " TREG_FMT_lx "\n", + " IIR %0*" PRIx64 "\n", hppa_form_gva_psw(psw, env->iasq_f, env->iaoq_f), hppa_form_gva_psw(psw, env->iasq_b, env->iaoq_b), - env->cr[CR_IIR]); + w, m & env->cr[CR_IIR]); psw_c[0] = (psw & PSW_W ? 'W' : '-'); psw_c[1] = (psw & PSW_E ? 'E' : '-'); @@ -151,13 +159,15 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) psw_c[16] = (psw & PSW_D ? 'D' : '-'); psw_c[17] = (psw & PSW_I ? 'I' : '-'); psw_c[18] = '\0'; - psw_cb = ((env->psw_cb >> 4) & 0x01111111) | (env->psw_cb_msb << 28); + psw_cb = ((env->psw_cb >> 4) & ((target_ureg)-1 / 0xf)) + | (env->psw_cb_msb << (TARGET_REGISTER_BITS - 4)); - qemu_fprintf(f, "PSW " TREG_FMT_lx " CB " TREG_FMT_lx " %s\n", - psw, psw_cb, psw_c); + qemu_fprintf(f, "PSW %0*" PRIx64 " CB %0*" PRIx64 " %s\n", + w, m & psw, w, m & psw_cb, psw_c); for (i = 0; i < 32; i++) { - qemu_fprintf(f, "GR%02d " TREG_FMT_lx "%c", i, env->gr[i], + qemu_fprintf(f, "GR%02d %0*" PRIx64 "%c", + i, w, m & env->gr[i], (i & 3) == 3 ? '\n' : ' '); } #ifndef CONFIG_USER_ONLY From patchwork Fri Oct 20 20:42:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736344 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503683wrl; Fri, 20 Oct 2023 13:54:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEp2KYaaSKV7QnWSEQnFhFJxyd3od54GlFt/o4G8+RrClDSRXiyY5lbkTUJIhMkxtxRvRbf X-Received: by 2002:ad4:5966:0:b0:66d:2eab:85ec with SMTP id eq6-20020ad45966000000b0066d2eab85ecmr3068449qvb.61.1697835268579; Fri, 20 Oct 2023 13:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835268; cv=none; d=google.com; s=arc-20160816; b=K/WlEGtaDErxztjG2gYTP7QIZw9dR+bkVuOE8IFdD13oE6rRVEo5yFBdY/kfFSypgb 2AzZkSVZjdgxvojf2aVPILx4ME052P+HY00ZmP+ItHnoenDktjIjkUGV6Fgj+oMA4Scq RPTKPi2gLRwrkccCreQCOuUNDT/N5AfsKIRdHtvbzToVGbXG3BOUMfuOVK4mXp7gFJwY cpsiHEI4yPfkPeEZPezKdAYIRsXydXdeFNBcWrExjxCJB/CIv7nhEbIaJ2EURzhVVgYG SP3qX7PgNvCpqm5Tu+65uB9yuJr3ll8/BFjIOIY6htNwewmY4hROK8IxrYXmGTJD5Yss ztGw== 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=kr+C20DtXtMGy3xs/PIBOfM94TBLe/tVvjYddrVGe/s=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ZYAZcKGu7HuKEG2zoY+VArLsTPOGgE3611dUxeEOZPGnDizG80gQRzxI7emSCbiXb7 2F4qZDKavCf2NCIkvZmgtqlRsIjdcjoLbjDpbXiKxsv8FVuQmwtkYhnWnSHrs/UjIK1w xfIdcMqrQ+GWdozpezUBxo0KXCbZPrfuUDRQycDKoL4fn/ESY03QUzEi0z2Xmw3xEf8W X48UKFttRjhuWifJN9uRxPZWJ1vvPpzuvDFqKxhPcOaooj65c5SwMSkEjsIOdripxHWW PTPSBgSkn5eV0wo24sboP2gnjZMRmZJqNm0nRK93IUZOqbgtxMXV3unWUnKck9CRwXgX +rhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VYK1KCH8; 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 3-20020a0562140cc300b0066d17e5f43esi2305653qvx.0.2023.10.20.13.54.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:28 -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=VYK1KCH8; 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 1qtwM2-0007yI-LU; Fri, 20 Oct 2023 16:44:22 -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 1qtwLh-0007ka-GF for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:03 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLZ-0008Bh-IM for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:00 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6934202b8bdso1184928b3a.1 for ; Fri, 20 Oct 2023 13:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834631; x=1698439431; 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=kr+C20DtXtMGy3xs/PIBOfM94TBLe/tVvjYddrVGe/s=; b=VYK1KCH8P88I1lQcPtliJgur28/Cvh5PwVaYNli3FUZvqQ4CMC//Q3VaFA9ulhfUrJ m69nR+qBddUE4XGtj3uJs1cHY3vni4MulZXd7fpoUlPQtGBBYNmKti6mfABV8hl87nMi 5UO2d4zKb133HyO2SyIJrGGh0NmfC8uvWTz1rKMgDMyVHXXnOREzpejiCqNyL1hQq6tb HwcFjsou36fGqEsSXLJ8qblBfBbfEXoEKHkS2Rc/LNZiZUZyq0efmKNzxcQl4zsnn1AI IDULg2s/WnckL5BQDMFvv5N7SdOSrljNQCdYRL3OTk4xz9Dd282xk8XOV8RIiieaIMPx 7CVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834631; x=1698439431; 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=kr+C20DtXtMGy3xs/PIBOfM94TBLe/tVvjYddrVGe/s=; b=K713+T4Cf1LIQkrXuAqH737pHUU7z2ZBSerIQ/6CqpzlOPMUO/mxJD/cnGETAhnQJo Dmhlaq1zlS+B41+pWo98oEkZcimxAIXqvmllEkseMjq6Fkbgk7ml0pHURGKCAjYp20lX YWgJfHPZ31UEKa5MqqSdl0/R2n8NtKvkZ9zQ7aKpHKBEmxxpkjZXZ5pOFxXbiaODtAdh QWTUMiWoyUYOXgNqM3Z9XE7exaHw9CASwerIzxSX0pcp5i2PThnP5yMTCOG8I6N1DdAG W+2NK+bUxhTgHZ/91QG7c5eTHP/jtFFIAVrqfOoGvefpxXL6wcFi2PHAay1kIOMkQMuO cKIA== X-Gm-Message-State: AOJu0Yy8OcTd9PVeS5xanpdrNj3NJqKOzWwQLUIKKXle+F5t6nB0uCh1 zrvZFB9F/j1VzUIIzsjJel7JFNZIsbrr+aIrkBw= X-Received: by 2002:a05:6a00:1747:b0:6b1:c1c4:ae98 with SMTP id j7-20020a056a00174700b006b1c1c4ae98mr3458507pfc.18.1697834630740; Fri, 20 Oct 2023 13:43:50 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 20/65] target/hppa: Fix hppa64 addressing Date: Fri, 20 Oct 2023 13:42:46 -0700 Message-Id: <20231020204331.139847-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 In form_gva and cpu_get_tb_cpu_state, we must truncate when PSW_W == 0. In space_select, the bits that choose the space depend on PSW_W. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 7 +++---- target/hppa/translate.c | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 622b4af890..2182437882 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -273,7 +273,7 @@ static inline target_ulong hppa_form_gva_psw(target_ureg psw, uint64_t spc, #ifdef CONFIG_USER_ONLY return off; #else - off &= (psw & PSW_W ? 0x3fffffffffffffffull : 0xffffffffull); + off &= psw & PSW_W ? MAKE_64BIT_MASK(0, 62) : MAKE_64BIT_MASK(0, 32); return spc | off; #endif } @@ -314,9 +314,8 @@ static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, flags |= env->psw & (PSW_W | PSW_C | PSW_D); flags |= (env->iaoq_f & 3) << TB_FLAG_PRIV_SHIFT; - *pc = (env->psw & PSW_C - ? hppa_form_gva_psw(env->psw, env->iasq_f, env->iaoq_f & -4) - : env->iaoq_f & -4); + *pc = hppa_form_gva_psw(env->psw, (env->psw & PSW_C ? env->iasq_f : 0), + env->iaoq_f & -4); *cs_base = env->iasq_f; /* Insert a difference between IAOQ_B and IAOQ_F within the otherwise zero diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 83115c944b..c7d17900f1 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -764,6 +764,13 @@ static bool gen_illegal(DisasContext *ctx) } while (0) #endif +static target_ureg gva_offset_mask(DisasContext *ctx) +{ + return (ctx->tb_flags & PSW_W + ? MAKE_64BIT_MASK(0, 62) + : MAKE_64BIT_MASK(0, 32)); +} + static bool use_goto_tb(DisasContext *ctx, target_ureg dest) { return translator_use_goto_tb(&ctx->base, dest); @@ -1398,7 +1405,8 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) tmp = tcg_temp_new(); spc = tcg_temp_new_tl(); - tcg_gen_shri_reg(tmp, base, TARGET_REGISTER_BITS - 5); + /* Extract top 2 bits of the address, shift left 3 for uint64_t index. */ + tcg_gen_shri_reg(tmp, base, (ctx->tb_flags & PSW_W ? 64 : 32) - 5); tcg_gen_andi_reg(tmp, tmp, 030); tcg_gen_trunc_reg_ptr(ptr, tmp); @@ -1415,6 +1423,7 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, { TCGv_reg base = load_gpr(ctx, rb); TCGv_reg ofs; + TCGv_tl addr; /* Note that RX is mutually exclusive with DISP. */ if (rx) { @@ -1429,18 +1438,13 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, } *pofs = ofs; -#ifdef CONFIG_USER_ONLY - *pgva = (modify <= 0 ? ofs : base); -#else - TCGv_tl addr = tcg_temp_new_tl(); + *pgva = addr = tcg_temp_new_tl(); tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); - if (ctx->tb_flags & PSW_W) { - tcg_gen_andi_tl(addr, addr, 0x3fffffffffffffffull); - } + tcg_gen_andi_tl(addr, addr, gva_offset_mask(ctx)); +#ifndef CONFIG_USER_ONLY if (!is_phys) { tcg_gen_or_tl(addr, addr, space_select(ctx, sp, base)); } - *pgva = addr; #endif } From patchwork Fri Oct 20 20:42:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736338 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503140wrl; Fri, 20 Oct 2023 13:52:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZy+efahnXSRavDmL2g52jG17XOYTUFM2M748gihQf+GQcgQcEz5+P7ckFX/tBt5VRbxcl X-Received: by 2002:a05:620a:2847:b0:774:1992:15c9 with SMTP id h7-20020a05620a284700b00774199215c9mr3363441qkp.42.1697835149827; Fri, 20 Oct 2023 13:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835149; cv=none; d=google.com; s=arc-20160816; b=Jr/jiKSIdWtn8KEPMmTvq73XS0q99DzASBe1hSyVeFECiewYOcWsZrhbKE9YHNYEyb HFzWw01hXM6LEfauV3eYiUsauzMe2Crr1RWh7auc7DDBI1RZvNrKAWSlAsIDki4epn/p ecpvMVlcw0LPXzrQRVfwnNkuCvo7hoU3rCrqaVmp/1AfLmUCgkPfsQSq0/osuXAkro0T uPSWnFskuMJnUK2F7PPi2t9zhlBd9bFdF2vBg7nJspMO7rd+ihpw0MvQMzfyMA4DyxRX apPStvQXITFTsUx+sIZEMcC8RzV/dlfL7bmRygBt5OdNjEaPaOovuOuudBVNiJIlXzzr F/+w== 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=DKFMtzklc2r0hLRnVa0CHOkIqsensBgIOA/UoJLswZ8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=wBM35d8Z21ii48xmMIAaDEmN7/1NFNzODYsPMg6MZ2gBR50mE83kfuM1Oj0MW+vI0p z+e9trjbwqu2uHh2zGqebx9bTwDX0wsD0OE/SDd/+yIk61/nf/eIAOq1nXe9muPCikhm 0ZgAbPG6vaMk3qZ8b+hh4+VbsbJ+KIb44EaxjiuNRAmwBpFZHiJhMH1uaZsAaKiPYgUt Wv8BmtRC1w21SoExzkzSZ9OGLnSg4v5tNIEm8we3vS0nuaQK6fnW+O81cDtPS+E9X3Qr rNjqwXQ0OKD+/49hbMMHZOqf+ugEkFiKNprmPsox6rr148wc9vQZzw6ftr3AQGtTe7xD cGLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n+vv0XYa; 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 de44-20020a05620a372c00b0077411b34538si1931565qkb.270.2023.10.20.13.52.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:52:29 -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=n+vv0XYa; 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 1qtwM2-0007yH-HA; Fri, 20 Oct 2023 16:44:22 -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 1qtwLh-0007kb-H9 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:03 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLc-0008Bt-Qa for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:00 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6be0277c05bso1102640b3a.0 for ; Fri, 20 Oct 2023 13:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834631; x=1698439431; 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=DKFMtzklc2r0hLRnVa0CHOkIqsensBgIOA/UoJLswZ8=; b=n+vv0XYaVqyTsUQorrO2xte/AXynlK78uJjPYUpgjDxEPO89urosIvSTgz1f4112vD z5Fp61HzLGZ3p0QdtiffK8EUo5yqzCoOUFZW8qxDZ298JKb1mmhheEioGdWiypadY0mj Ma2eptDMgYc+ohB7TlYp6a0eaqmAHjCCfMkuFjl4I+AGog9A3erHh1qszZdHhzXvWm87 BBBE+KGL7YJ4prU8496zDifMJhXCF77wttrGJadV54zf0/KBnGXwedeDRZWzuMJACiJN pSku9bvyI4/6MUMIhoB9qaU94NOYbXHoPJldWI8lCgvpAWhARbrMsNyhPuz8pDouEMPF qLig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834631; x=1698439431; 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=DKFMtzklc2r0hLRnVa0CHOkIqsensBgIOA/UoJLswZ8=; b=MZE+Z/lxQ1gMMFH97VkJ1NnyAKZGr0I/+0f73vBru1ldx6ZqUfzzJ47cDngMkmnAXR 3x+W2m+Z+3LvIGBslHfzO8vgMlExCCDmmP8WHHzTEDJrhjoVO/ZY07FkQrTB5cvb1ZCC RhzFcgomynAZ33FpVh1SLY2KZPNusV2Dv+yO8ErZKx72I1/NgUPKq7IypXrSJNfCaE1N I2AMnnR/aoZZRXLA2Rm/tWyOEzNr0GqhnAHhqOy7FuphKqMMNKBmPbeCI3mOnrG6qWZD Bx1xN1U+hI/3Q0wMyag9dDxMxVGHSNnuO2540DOXhmBoct+ep6AJqDn3cUg4v3ZeelOx Gazw== X-Gm-Message-State: AOJu0YzU/wrJrgJluJBEyjd9pfLph5Ix9+Lhizv8kld0JZP9vdhPxg5o 2yaFEh9hfK47FlSG8bQtjzDm0xKxnwU6v7vUklI= X-Received: by 2002:a05:6a20:cea3:b0:174:af85:954b with SMTP id if35-20020a056a20cea300b00174af85954bmr3091205pzb.22.1697834631577; Fri, 20 Oct 2023 13:43:51 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 21/65] target/hppa: sar register allows only 5 bits on 32-bit CPU Date: Fri, 20 Oct 2023 13:42:47 -0700 Message-Id: <20231020204331.139847-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 From: Helge Deller The sar shift amount register is limited to 5 bits when running a 32-bit CPU. Strip off the remaining bits. The interesting part is, that this register allows to detect at runtime if a physical CPU is capable to execute PA2.0 (64-bit) instructions. Signed-off-by: Helge Deller --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c7d17900f1..cb60485cbb 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2155,7 +2155,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) if (ctl == CR_SAR) { reg = load_gpr(ctx, a->r); tmp = tcg_temp_new(); - tcg_gen_andi_reg(tmp, reg, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(tmp, reg, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); @@ -2216,7 +2216,7 @@ static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) TCGv_reg tmp = tcg_temp_new(); tcg_gen_not_reg(tmp, load_gpr(ctx, a->r)); - tcg_gen_andi_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(tmp, tmp, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); From patchwork Fri Oct 20 20:42:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736306 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502052wrl; Fri, 20 Oct 2023 13:48:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErXGP9qV2C5bWLi42gEEfdRR03Y4eAMTa1ymqzgnsg46jCMAkwqXAX81Wu8s1Re6gDHdor X-Received: by 2002:ac8:4b73:0:b0:400:9f2c:1211 with SMTP id g19-20020ac84b73000000b004009f2c1211mr3359153qts.29.1697834903357; Fri, 20 Oct 2023 13:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834903; cv=none; d=google.com; s=arc-20160816; b=vj+qXboatJyr9CUBORLzvfAC5srGiBuejSL/nhUp9FODdIcgCh4pYXQ1neqTsqeFew ESSY6Jn2z9E5Cmk+zbGX5vZUiDTMw2sd3aNIe/B7wP3LIhw2ga/enBKAwLMVNe/Ov6x/ lqDqPgZE6pwJGjwFYOYRUkEEqmkJtEnTTWa2Q7YPmhDPi+spwyhxSDdLpv/9x69008lG bY3R3VUqJOM5uPcb7dizv+E7qn9m6ZaBPct8JnCmdJbk/29uL+6WLX1o0WpcohPiuE96 bh2G5vyb2qGYfI8vsFtrx1LBXQlGZxmmqLIjz1qOrP5R5HSStd1uPU14PheVXnDtVfXo E+UQ== 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=Zge3ex/yn6oStv5+4EsP6t9DbvB5wzQOrcigC9xjD9g=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=af+sDJxv4l8VIQOVwOKeACK0JnX/1wcfKnnPYPTBbfWVV27lyhZBGYht637sNoniNm 34U+nFHxzzX2oJ2roj1TE1O/tUGmCi5lhUiNGdDxri7HTGTLUsveZMhbc/rFHEPTz3ry BBKFesNVJXjb9Btm6pQmzDFGFOK9Hl5I1tR3hl1YjMuO91MqO8HPwnIrl/oUIsobWsAG ZvFYVPjf5tVFgQgUSzOBRXqQnOE3Moa73nNjZPujTpgX4TgvCzY74mQ+yP2CBHL0vZuo ajsjg3DUdNxF91B4fPpi5kGz+IupYs+uob4e+MgEXi2l6TNBahabtmMgToQ3jIV2xYfR 5e9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bFe1R92j; 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 u17-20020a05622a011100b004054648ff3bsi1900201qtw.284.2023.10.20.13.48.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:48:23 -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=bFe1R92j; 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 1qtwM5-0007yz-DH; Fri, 20 Oct 2023 16:44:25 -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 1qtwLk-0007lp-Vi for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:08 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLd-0008C0-IH for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:03 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6bd73395bceso1020900b3a.0 for ; Fri, 20 Oct 2023 13:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834632; x=1698439432; 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=Zge3ex/yn6oStv5+4EsP6t9DbvB5wzQOrcigC9xjD9g=; b=bFe1R92j1iz1zLM9bnysicrjk0VttdwlJrKhDBGb8eAUaqbYw3T8YWYBQvMkYZ2xjU fDmNPxTQ7h3wYItN3H5oMiwZhM82uo7SiszoQWotWF0fHX21EO4PwagLasyy/hZu+sI9 6dnOxdEm2GFlnTt1iK8vI4y9oLH0GwmnfkDla7pbNzWvy3wepJHvY0cFtlVF5jSgqghL 6DeEPJM0Ue46F4BECGpK4xeOKCqx75m2o/SV1J0hLJpCYee0z0zluoghdT8m7kbTu63B z8w8/HWs3tmsksKd7KZi0En5hgGmpbbPrtLwaNgKGZp58b3cNLqL3Zz9J0EtKVoNc9B/ Ki2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834632; x=1698439432; 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=Zge3ex/yn6oStv5+4EsP6t9DbvB5wzQOrcigC9xjD9g=; b=wVd+eK92N6YkvZL5Ul/EzxKtCdIZ1Q+YFSiOPZJba/VcRvaJGVMlMyi6dKkM/6hpQ5 xlGeewXPcLD9z6sg6aFurRWVTAq+sIts0VwGlr8I3tThidzeceyzTKbPMHq3HndsuTPO 2kT70O1fAcxFl8hADBhlezlJc9fF+F/Xcs4VtVaYa5sojqJB8i2zQZaSFWPQrBkrwgES KQgmaAxAsgSTaEXEvJ75D5n9hjE9qJedTJ8fgYPPWi1fLvcsxGseovAMhqsJ37Lg9Pnj CIQtVaYfi+j4R2zqMeavvUGf7MR2jkJnO8NsrcUTkkFQfjiqGTmhJsXw/002onxeia8k E2wA== X-Gm-Message-State: AOJu0YyTyBXHy3pZ4m3AQGU8jlKKxq27GxxwKoIjkhADjdsPIG0PU7LU oKSRKHI3zDNMq4CWxFeayg/e/YJWpw1T9VmMHzE= X-Received: by 2002:a05:6a20:2593:b0:15d:8366:65be with SMTP id k19-20020a056a20259300b0015d836665bemr3794091pzd.9.1697834632468; Fri, 20 Oct 2023 13:43:52 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 22/65] target/hppa: Pass d to do_cond Date: Fri, 20 Oct 2023 13:42:48 -0700 Message-Id: <20231020204331.139847-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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 Hoist the resolution of d up one level above do_cond. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 82 +++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 28 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index cb60485cbb..e84311d886 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -814,7 +814,7 @@ static bool cond_need_cb(int c) /* Need extensions from TCGv_i32 to TCGv_reg. */ static bool cond_need_ext(DisasContext *ctx, bool d) { - return TARGET_REGISTER_BITS == 64 && !d; + return TARGET_REGISTER_BITS == 64 && !(ctx->is_pa20 && d); } /* @@ -822,8 +822,8 @@ static bool cond_need_ext(DisasContext *ctx, bool d) * the Parisc 1.1 Architecture Reference Manual for details. */ -static DisasCond do_cond(unsigned cf, TCGv_reg res, - TCGv_reg cb_msb, TCGv_reg sv) +static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, + TCGv_reg res, TCGv_reg cb_msb, TCGv_reg sv) { DisasCond cond; TCGv_reg tmp; @@ -833,11 +833,19 @@ static DisasCond do_cond(unsigned cf, TCGv_reg res, cond = cond_make_f(); break; case 1: /* = / <> (Z / !Z) */ + if (cond_need_ext(ctx, d)) { + tmp = tcg_temp_new(); + tcg_gen_ext32u_reg(tmp, res); + res = tmp; + } cond = cond_make_0(TCG_COND_EQ, res); break; case 2: /* < / >= (N ^ V / !(N ^ V) */ tmp = tcg_temp_new(); tcg_gen_xor_reg(tmp, res, sv); + if (cond_need_ext(ctx, d)) { + tcg_gen_ext32s_reg(tmp, tmp); + } cond = cond_make_0_tmp(TCG_COND_LT, tmp); break; case 3: /* <= / > (N ^ V) | Z / !((N ^ V) | Z) */ @@ -852,20 +860,35 @@ static DisasCond do_cond(unsigned cf, TCGv_reg res, */ tmp = tcg_temp_new(); tcg_gen_eqv_reg(tmp, res, sv); - tcg_gen_sari_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); - tcg_gen_and_reg(tmp, tmp, res); + if (cond_need_ext(ctx, d)) { + tcg_gen_sextract_reg(tmp, tmp, 31, 1); + tcg_gen_and_reg(tmp, tmp, res); + tcg_gen_ext32u_reg(tmp, tmp); + } else { + tcg_gen_sari_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); + tcg_gen_and_reg(tmp, tmp, res); + } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); break; case 4: /* NUV / UV (!C / C) */ + /* Only bit 0 of cb_msb is ever set. */ cond = cond_make_0(TCG_COND_EQ, cb_msb); break; case 5: /* ZNV / VNZ (!C | Z / C & !Z) */ tmp = tcg_temp_new(); tcg_gen_neg_reg(tmp, cb_msb); tcg_gen_and_reg(tmp, tmp, res); + if (cond_need_ext(ctx, d)) { + tcg_gen_ext32u_reg(tmp, tmp); + } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); break; case 6: /* SV / NSV (V / !V) */ + if (cond_need_ext(ctx, d)) { + tmp = tcg_temp_new(); + tcg_gen_ext32s_reg(tmp, sv); + sv = tmp; + } cond = cond_make_0(TCG_COND_LT, sv); break; case 7: /* OD / EV */ @@ -887,10 +910,11 @@ static DisasCond do_cond(unsigned cf, TCGv_reg res, can use the inputs directly. This can allow other computation to be deleted as unused. */ -static DisasCond do_sub_cond(unsigned cf, TCGv_reg res, +static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, TCGv_reg res, TCGv_reg in1, TCGv_reg in2, TCGv_reg sv) { DisasCond cond; + bool d = false; switch (cf >> 1) { case 1: /* = / <> */ @@ -909,7 +933,7 @@ static DisasCond do_sub_cond(unsigned cf, TCGv_reg res, cond = cond_make(TCG_COND_LEU, in1, in2); break; default: - return do_cond(cf, res, NULL, sv); + return do_cond(ctx, cf, d, res, NULL, sv); } if (cf & 1) { cond.c = tcg_invert_cond(cond.c); @@ -927,8 +951,10 @@ static DisasCond do_sub_cond(unsigned cf, TCGv_reg res, * how cases c={2,3} are treated. */ -static DisasCond do_log_cond(unsigned cf, TCGv_reg res) +static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) { + bool d = false; + switch (cf) { case 0: /* never */ case 9: /* undef, C */ @@ -957,7 +983,7 @@ static DisasCond do_log_cond(unsigned cf, TCGv_reg res) case 14: /* OD */ case 15: /* EV */ - return do_cond(cf, res, NULL, NULL); + return do_cond(ctx, cf, d, res, NULL, NULL); default: g_assert_not_reached(); @@ -966,7 +992,7 @@ static DisasCond do_log_cond(unsigned cf, TCGv_reg res) /* Similar, but for shift/extract/deposit conditions. */ -static DisasCond do_sed_cond(unsigned orig, TCGv_reg res) +static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res) { unsigned c, f; @@ -979,7 +1005,7 @@ static DisasCond do_sed_cond(unsigned orig, TCGv_reg res) } f = (orig & 4) / 4; - return do_log_cond(c * 2 + f, res); + return do_log_cond(ctx, c * 2 + f, res); } /* Similar, but for unit conditions. */ @@ -1151,7 +1177,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, } /* Emit any conditional trap before any writeback. */ - cond = do_cond(cf, dest, cb_cond, sv); + cond = do_cond(ctx, cf, d, dest, cb_cond, sv); if (is_tc) { tmp = tcg_temp_new(); tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); @@ -1241,9 +1267,9 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Compute the condition. We cannot use the special case for borrow. */ if (!is_b) { - cond = do_sub_cond(cf, dest, in1, in2, sv); + cond = do_sub_cond(ctx, cf, dest, in1, in2, sv); } else { - cond = do_cond(cf, dest, get_carry(ctx, d, cb, cb_msb), sv); + cond = do_cond(ctx, cf, d, dest, get_carry(ctx, d, cb, cb_msb), sv); } /* Emit any conditional trap before any writeback. */ @@ -1306,7 +1332,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, } /* Form the condition for the compare. */ - cond = do_sub_cond(cf, dest, in1, in2, sv); + cond = do_sub_cond(ctx, cf, dest, in1, in2, sv); /* Clear. */ tcg_gen_movi_reg(dest, 0); @@ -1330,7 +1356,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (cf) { - ctx->null_cond = do_log_cond(cf, dest); + ctx->null_cond = do_log_cond(ctx, cf, dest); } } @@ -2796,7 +2822,7 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) /* ??? The lshift is supposed to contribute to overflow. */ sv = do_add_sv(ctx, dest, add1, add2); } - ctx->null_cond = do_cond(a->cf, dest, cout, sv); + ctx->null_cond = do_cond(ctx, a->cf, false, dest, cout, sv); } return nullify_end(ctx); @@ -3013,7 +3039,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, sv = do_sub_sv(ctx, dest, in1, in2); } - cond = do_sub_cond(c * 2 + f, dest, in1, in2, sv); + cond = do_sub_cond(ctx, c * 2 + f, dest, in1, in2, sv); return do_cbranch(ctx, disp, n, &cond); } @@ -3057,7 +3083,7 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, sv = do_add_sv(ctx, dest, in1, in2); } - cond = do_cond(c * 2 + f, dest, cb_cond, sv); + cond = do_cond(ctx, c * 2 + f, d, dest, cb_cond, sv); save_gpr(ctx, r, dest); return do_cbranch(ctx, disp, n, &cond); } @@ -3128,7 +3154,7 @@ static bool trans_movb(DisasContext *ctx, arg_movb *a) tcg_gen_mov_reg(dest, cpu_gr[a->r1]); } - cond = do_sed_cond(a->c, dest); + cond = do_sed_cond(ctx, a->c, dest); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3142,7 +3168,7 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a) dest = dest_gpr(ctx, a->r); tcg_gen_movi_reg(dest, a->i); - cond = do_sed_cond(a->c, dest); + cond = do_sed_cond(ctx, a->c, dest); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3180,7 +3206,7 @@ static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3216,7 +3242,7 @@ static bool trans_shrpw_imm(DisasContext *ctx, arg_shrpw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3250,7 +3276,7 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3277,7 +3303,7 @@ static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3314,7 +3340,7 @@ static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3344,7 +3370,7 @@ static bool trans_depw_imm(DisasContext *ctx, arg_depw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, dest); } return nullify_end(ctx); } @@ -3381,7 +3407,7 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (c) { - ctx->null_cond = do_sed_cond(c, dest); + ctx->null_cond = do_sed_cond(ctx, c, dest); } return nullify_end(ctx); } From patchwork Fri Oct 20 20:42:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736294 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501240wrl; Fri, 20 Oct 2023 13:45:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3LYhvBtmfJAfiar1l9dUBcF5SVdwqXfe0EYmMkPucpHdwX4YOwLpLzVbW7sT9PqTMv5lH X-Received: by 2002:a05:6870:c991:b0:1c8:bbd0:2fc9 with SMTP id hi17-20020a056870c99100b001c8bbd02fc9mr3752560oab.49.1697834739973; Fri, 20 Oct 2023 13:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834739; cv=none; d=google.com; s=arc-20160816; b=cUIPCzsRlAN09+EOGzU0QiCR/ZqWZCeRawFOJVgjwLt5codOCJNezGgNszejW7N5RZ 3jpFW8v/p8Ag0ju8iF37uqWuuRQ2FeQ+lFrwtECQNJ6RZi+MJB0csj8RuoNGqb5Tnjyx 9sxsoCc75k1EVKmGgeRh9al8FVRS+kNfHGF4nhItkZboMmRmi45zMjh8ZWWzgjujqrOt e+XW8+l1d2rpNHbDTO29ISxNyF5NnLtVfBE+mNZ2zZr4TVGWiSrboa9Ip6lTBPGUUBc6 rF3EnBb0BVT+r32EWJbRNFfbzYn6sLAvornEeRcW5Uraso1Yud+ueUHXuvVTGUAUP1HZ ogbQ== 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=61l8ExG3pdb1L+cR7hfS5b3i51MeOrIbY/vnXSWadm4=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=T01O6rIuYlxdNvvUVTeiYX/hPdR/DSqk7K5oEXWirS+YAJEiluydCsYIkyDamYzzHI rhTDyYAYOLTpfyi1bdVN6Up14fMekpARWMinIeh4/e+gXP7S/rIq9AMnw9KEHbw+4BVt 1mY7IMKXI7xYFyx5E+CZRCbE1tfryWqhkCPX+oCiFzepmXB4jUQVQAYcHVwLO/X7huYR pz4noSXoNQVdg+DyawOeDUjnIwm7dGGxUOVEU8IIZ9UmHX7vQFpYJVsrWMFbWRuiU3yF efsu86740yef4NPupB/0T+cyy6OPIiNPM3aHE3+e9LKmWpZLC5pVuFaiohBsVuVmPGvx yteA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dCiXlaK2; 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 f7-20020ad45587000000b0066d132b1c94si2029647qvx.32.2023.10.20.13.45.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:45:39 -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=dCiXlaK2; 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 1qtwM3-0007yR-QI; Fri, 20 Oct 2023 16:44:24 -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 1qtwLj-0007l7-6D for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:08 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLd-0008C5-I1 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:02 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6b20a48522fso1169465b3a.1 for ; Fri, 20 Oct 2023 13:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834633; x=1698439433; 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=61l8ExG3pdb1L+cR7hfS5b3i51MeOrIbY/vnXSWadm4=; b=dCiXlaK2kHSljTK/igJI3QQU27804QsS/5MbTT86LN5C7FvSVIJYoHeS4RkX4i3Irm 6rEgfgFKtTrgcLNULyI97/GK5TuBXtgV9wgNW7acObHqJcSs2SkJFRD7X98Pal/3ISkI Ckkiac44HnIjOlGCNMU7td/asBS7zicdwy8DMt5ptu/5y9ykaFaF7EZrtkOZV8Kgq62q 5pPOzc0QVZ8E9wHabjRJ72F6DHd27JHSNUWrPhE1uSivEDeFuKu/urfupTKFxg+H8IAQ 5lHh3hGn0fBAqZVCnUoyRx2khhiAi+70t9qCH+xuMMlPNYB+kEeD6pvrppL+Z6K85laS PsBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834633; x=1698439433; 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=61l8ExG3pdb1L+cR7hfS5b3i51MeOrIbY/vnXSWadm4=; b=THgxj04q5Pmt6OrZpaSeeGXYffnUmf5opypimKVc52MNfTIVemxwD3wtVyhrM+zpYb Qyzxb5Va91FdzeocBJrBXRYiFe4aG9SVrkGFgW9dUTGUdOjlivxPJa6EzQhQnEBnuDwP 3IkbVAPUYCke5lrE3ymriayd/L3fUv+GPKDAkn+1gIMLlGtIhCAxjVsqyptfWgn+LI8W Vnct6zGDq5EYb7nYJc18+pyukVdykVZRwNT6nOBE/WkeUJjA3Ekr9H+gKmGdv6mngiIH 6dlXoolHfVb0hPwxAdzXpsDQVFCTy36zsG8wkBV4RvHSNdFX8ixn6t3bngT4BmBveqIF Zs7w== X-Gm-Message-State: AOJu0Yw1UYkW7zz0OsxKX8NdRAsM1w9W4v/cPPMX+HNzvyx9ir8CL7Lh CXK5tu2GxGT9HhbzSfAyrA4uiEi0TEeL3F69O7k= X-Received: by 2002:a05:6a00:138f:b0:68f:dd50:aef8 with SMTP id t15-20020a056a00138f00b0068fdd50aef8mr3484027pfg.4.1697834633290; Fri, 20 Oct 2023 13:43:53 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 23/65] target/hppa: Pass d to do_sub_cond Date: Fri, 20 Oct 2023 13:42:49 -0700 Message-Id: <20231020204331.139847-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 Hoist the resolution of d up one level above do_sub_cond. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 77 ++++++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index e84311d886..d480bac03d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -446,12 +446,15 @@ static DisasCond cond_make_n(void) }; } -static DisasCond cond_make_0_tmp(TCGCond c, TCGv_reg a0) +static DisasCond cond_make_tmp(TCGCond c, TCGv_reg a0, TCGv_reg a1) { assert (c != TCG_COND_NEVER && c != TCG_COND_ALWAYS); - return (DisasCond){ - .c = c, .a0 = a0, .a1 = tcg_constant_reg(0) - }; + return (DisasCond){ .c = c, .a0 = a0, .a1 = a1 }; +} + +static DisasCond cond_make_0_tmp(TCGCond c, TCGv_reg a0) +{ + return cond_make_tmp(c, a0, tcg_constant_reg(0)); } static DisasCond cond_make_0(TCGCond c, TCGv_reg a0) @@ -463,15 +466,12 @@ static DisasCond cond_make_0(TCGCond c, TCGv_reg a0) static DisasCond cond_make(TCGCond c, TCGv_reg a0, TCGv_reg a1) { - DisasCond r = { .c = c }; + TCGv_reg t0 = tcg_temp_new(); + TCGv_reg t1 = tcg_temp_new(); - assert (c != TCG_COND_NEVER && c != TCG_COND_ALWAYS); - r.a0 = tcg_temp_new(); - tcg_gen_mov_reg(r.a0, a0); - r.a1 = tcg_temp_new(); - tcg_gen_mov_reg(r.a1, a1); - - return r; + tcg_gen_mov_reg(t0, a0); + tcg_gen_mov_reg(t1, a1); + return cond_make_tmp(c, t0, t1); } static void cond_free(DisasCond *cond) @@ -910,36 +910,55 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, can use the inputs directly. This can allow other computation to be deleted as unused. */ -static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, TCGv_reg res, - TCGv_reg in1, TCGv_reg in2, TCGv_reg sv) +static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, + TCGv_reg res, TCGv_reg in1, + TCGv_reg in2, TCGv_reg sv) { - DisasCond cond; - bool d = false; + TCGCond tc; + bool ext_uns; switch (cf >> 1) { case 1: /* = / <> */ - cond = cond_make(TCG_COND_EQ, in1, in2); + tc = TCG_COND_EQ; + ext_uns = true; break; case 2: /* < / >= */ - cond = cond_make(TCG_COND_LT, in1, in2); + tc = TCG_COND_LT; + ext_uns = false; break; case 3: /* <= / > */ - cond = cond_make(TCG_COND_LE, in1, in2); + tc = TCG_COND_LE; + ext_uns = false; break; case 4: /* << / >>= */ - cond = cond_make(TCG_COND_LTU, in1, in2); + tc = TCG_COND_LTU; + ext_uns = true; break; case 5: /* <<= / >> */ - cond = cond_make(TCG_COND_LEU, in1, in2); + tc = TCG_COND_LEU; + ext_uns = true; break; default: return do_cond(ctx, cf, d, res, NULL, sv); } - if (cf & 1) { - cond.c = tcg_invert_cond(cond.c); - } - return cond; + if (cf & 1) { + tc = tcg_invert_cond(tc); + } + if (cond_need_ext(ctx, d)) { + TCGv_reg t1 = tcg_temp_new(); + TCGv_reg t2 = tcg_temp_new(); + + if (ext_uns) { + tcg_gen_ext32u_reg(t1, in1); + tcg_gen_ext32u_reg(t2, in2); + } else { + tcg_gen_ext32s_reg(t1, in1); + tcg_gen_ext32s_reg(t2, in2); + } + return cond_make_tmp(tc, t1, t2); + } + return cond_make(tc, in1, in2); } /* @@ -1267,7 +1286,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Compute the condition. We cannot use the special case for borrow. */ if (!is_b) { - cond = do_sub_cond(ctx, cf, dest, in1, in2, sv); + cond = do_sub_cond(ctx, cf, d, dest, in1, in2, sv); } else { cond = do_cond(ctx, cf, d, dest, get_carry(ctx, d, cb, cb_msb), sv); } @@ -1321,6 +1340,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, { TCGv_reg dest, sv; DisasCond cond; + bool d = false; dest = tcg_temp_new(); tcg_gen_sub_reg(dest, in1, in2); @@ -1332,7 +1352,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, } /* Form the condition for the compare. */ - cond = do_sub_cond(ctx, cf, dest, in1, in2, sv); + cond = do_sub_cond(ctx, cf, d, dest, in1, in2, sv); /* Clear. */ tcg_gen_movi_reg(dest, 0); @@ -3028,6 +3048,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, { TCGv_reg dest, in2, sv; DisasCond cond; + bool d = false; in2 = load_gpr(ctx, r); dest = tcg_temp_new(); @@ -3039,7 +3060,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, sv = do_sub_sv(ctx, dest, in1, in2); } - cond = do_sub_cond(ctx, c * 2 + f, dest, in1, in2, sv); + cond = do_sub_cond(ctx, c * 2 + f, d, dest, in1, in2, sv); return do_cbranch(ctx, disp, n, &cond); } From patchwork Fri Oct 20 20:42:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736313 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502290wrl; Fri, 20 Oct 2023 13:49:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyngeP0YaxTs1QgVAP7+fDixwBX/XofizpArPbxmmVeHznm5Kp2J0b++NIj1unifQzzd3Z X-Received: by 2002:a54:4787:0:b0:3a7:1d15:28fe with SMTP id o7-20020a544787000000b003a71d1528femr2663948oic.56.1697834953943; Fri, 20 Oct 2023 13:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834953; cv=none; d=google.com; s=arc-20160816; b=SkhcEJ0lrFObSSV3A6CKymYUD/BwvI3JdDH31SfhUUwUNDw5Z8xnm6b4ZIsozEGNNT hyXZviTRkjdnHTBwET2Yht2WHOk8qtY/OgYfj1dhGTqu0eDv4zpwEBjKKJifltrDV70w 2aCsMUqjtbfQ9E5N98WFTzuGfA2QqTzfHf6+PPKXq18Xer+WgaQuMWTG5ZtB6FwXx2jW bX7mKNnBEjR4A4i5dzQzu3NK1iV7eEJmwj2jn4B8xf7DwnAhncZ/jdlCqhMMQ4qIu/5G ebYt2BRDszu/kZkWC+qqJ/Ao9VyxrHaH4yUKhCAdnr88GL3L6CAMWoR1JuAAcFobqwOo Pung== 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=Bjm4am++QtRrdDOjyV6ZJHM+umovDVM2bFLkEqCxtAk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=hRQveYJqkMpOlGSPERCb0PSCC0JQn8ljvz4vI3Q+MXH4z5RqawW1/yO4xjfmnuTRmj bFOWYys9DVAnm1EWpBvPaZD9EDgOku1mXUDmL3TbWk1LxcGu4tw5B3fuBW9A1aVtZUjz vjiQ3mjwAd1/2FitFRRH9dodLuOh7+LFeVwma4eqMfn3y/84tpo39jbv3PgeaxGMAahl V++x4oDDltBfb8eVntuCafQ9cVjBc2tZ2a0LnrClBnSOUKpjWnTxKhxfm3Z1BOIIWiLR 0TApkcY860hrg5UliQhx7DgnjI67khlZL5rkQL0MTw8Wcvs8d3FblLT+mooAijHSJ6dc cFog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pzji8I/d"; 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 pg10-20020a0562144a0a00b0065d0f1dd387si2131531qvb.366.2023.10.20.13.49.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:49:13 -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="pzji8I/d"; 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 1qtwM5-0007zb-Sc; Fri, 20 Oct 2023 16:44:25 -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 1qtwLj-0007l6-5n for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:08 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLd-0008CM-7V for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:01 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b26a3163acso1100580b3a.2 for ; Fri, 20 Oct 2023 13:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834634; x=1698439434; 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=Bjm4am++QtRrdDOjyV6ZJHM+umovDVM2bFLkEqCxtAk=; b=pzji8I/dj8/xU9X3fl+0d+zcblcAexYgpsEEEtnrUzLBLR/wQGgJqUQ70gxDhjP9Nu cQLujwi6o8MFyOZ4Mk9nUPGZ8mWOHCpcVRyUyhYCJMzww6LsE3wi458Ya7Tpu0Di4XOQ MG7EZtGDQxD3A5ptqOmTmXB5UdmeP1xwAx5QC2nvvGTRX0DqD3SA1uehRtG1tYFKvndJ 5/xwd2Dy6bb2Fw2ZbX1lAyqHkSiv/RDGC8xEmMUmRaIzZFeO1PVq86wfbd1vtQLsUwh3 8+a5gf+3Y1quAYQi+t19H8ifd0c3aFD+2PYx0voBdHVIwo6rKuzRI8M6p6qOhcVd2w8n urGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834634; x=1698439434; 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=Bjm4am++QtRrdDOjyV6ZJHM+umovDVM2bFLkEqCxtAk=; b=Rccx6pqw6l9KiglkRKbHu1JsxkPICuB9QZhN8ex7h8zBOwv/nsD4DTICu54DHS0bFH NK8ltAWT48zlLuHTjEtaz6jubpYp+A/pg2lXkr3dECw/2vZKDvxdhxXkCqrnpTFu/ANp iBPOhMOJnq/k6KtzC0et/PGQ0n1rmeVTlz2E8wio4iJQIy+NvT1SQJiiBRymtYlPulOx OVyqjs6j44bZo5szbrZEqs7aUYfRX1nevO2BjECZ0rfGfLUma60vXa52eXDup8VQiC5l 3SUIaQAPKowlXPA9wDWht0oHZGXUaoCfrCAn9TZMH6YfSzqhoyckgB3co++wAoEXlw9C m4nw== X-Gm-Message-State: AOJu0Yzfr3Q1XRG04tZf4N1OmWZdF/SeOSxOjcHLVNPEaNs/0vV+MGY6 sQyn4ldS0kdplEYmiwtgfzeb0xm/H3/x+swVFVY= X-Received: by 2002:a05:6a00:15c2:b0:693:3be8:feba with SMTP id o2-20020a056a0015c200b006933be8febamr2895362pfu.19.1697834634035; Fri, 20 Oct 2023 13:43:54 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 24/65] target/hppa: Pass d to do_log_cond Date: Fri, 20 Oct 2023 13:42:50 -0700 Message-Id: <20231020204331.139847-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 Hoist the resolution of d up one level above do_log_cond. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 48 ++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d480bac03d..d629f5f7f8 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -970,9 +970,11 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, * how cases c={2,3} are treated. */ -static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) +static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, + TCGv_reg res) { - bool d = false; + TCGCond tc; + bool ext_uns; switch (cf) { case 0: /* never */ @@ -988,17 +990,29 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) return cond_make_t(); case 2: /* == */ - return cond_make_0(TCG_COND_EQ, res); + tc = TCG_COND_EQ; + ext_uns = true; + break; case 3: /* <> */ - return cond_make_0(TCG_COND_NE, res); + tc = TCG_COND_NE; + ext_uns = true; + break; case 4: /* < */ - return cond_make_0(TCG_COND_LT, res); + tc = TCG_COND_LT; + ext_uns = false; + break; case 5: /* >= */ - return cond_make_0(TCG_COND_GE, res); + tc = TCG_COND_GE; + ext_uns = false; + break; case 6: /* <= */ - return cond_make_0(TCG_COND_LE, res); + tc = TCG_COND_LE; + ext_uns = false; + break; case 7: /* > */ - return cond_make_0(TCG_COND_GT, res); + tc = TCG_COND_GT; + ext_uns = false; + break; case 14: /* OD */ case 15: /* EV */ @@ -1007,6 +1021,18 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) default: g_assert_not_reached(); } + + if (cond_need_ext(ctx, d)) { + TCGv_reg tmp = tcg_temp_new(); + + if (ext_uns) { + tcg_gen_ext32u_reg(tmp, res); + } else { + tcg_gen_ext32s_reg(tmp, res); + } + return cond_make_0_tmp(tc, tmp); + } + return cond_make_0(tc, res); } /* Similar, but for shift/extract/deposit conditions. */ @@ -1014,6 +1040,7 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, TCGv_reg res) static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res) { unsigned c, f; + bool d = false; /* Convert the compressed condition codes to standard. 0-2 are the same as logicals (nv,<,<=), while 3 is OD. @@ -1024,7 +1051,7 @@ static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res) } f = (orig & 4) / 4; - return do_log_cond(ctx, c * 2 + f, res); + return do_log_cond(ctx, c * 2 + f, d, res); } /* Similar, but for unit conditions. */ @@ -1368,6 +1395,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg dest = dest_gpr(ctx, rt); + bool d = false; /* Perform the operation, and writeback. */ fn(dest, in1, in2); @@ -1376,7 +1404,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (cf) { - ctx->null_cond = do_log_cond(ctx, cf, dest); + ctx->null_cond = do_log_cond(ctx, cf, d, dest); } } From patchwork Fri Oct 20 20:42:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736328 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502815wrl; Fri, 20 Oct 2023 13:51:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAyUWrKJS9HU3u8gMKgyEvHPdVpNJl9bQ6iiT9eeSmMPwI7COr4s5gd73C1iCTuwcHcFmZ X-Received: by 2002:a05:622a:1a0a:b0:419:5775:7d6a with SMTP id f10-20020a05622a1a0a00b0041957757d6amr3371281qtb.16.1697835075504; Fri, 20 Oct 2023 13:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835075; cv=none; d=google.com; s=arc-20160816; b=LWVFrJGw+itpBoSQFAYd8IO8CSRvwfUY0VZIkSoj4kLpc1dMuxJTXEbtBfM2ZdQJAm kifl3buVjGL/q92LqUeXvGj/SyBEYE3ytpZnWlNXAYpGoXQnvpDcAFVUUa0uRVspuuXU yyyHNXXeQPkuxdfLa9RVl8/Rg0UoCCUmCeZW7t2CEeuDe9l7W4wgs2jzOLkQRvPbHMf7 bieh+M83M3bzCZ1KWxSetJeaE+aC989B7qzpj4fU/tkxUW/IlTT8OJ8E2s4ojAuQyovO Fu4C0pZhObNWASUR1YrgdS3ie/z1ei0K+lxm9ItJGEmcXuf6z9ua5Jy6laInV1oeNVdz G07g== 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=BBKuip3A0RhkTWc5ebdaF2DgmzVxIGNwRkilYwMnVKc=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=vUpJwwUYiE7l2yA+j72/Yo215wsVOl64ZKuXFijuwuQOLfFXxNiW7UiU6HDryJm1Bf 30qm2qrr3CDGb5DKEg0qOLtGuF/6ZnXE6tf7SGbIYHv0atZXl60DbiKBAKU1H/3rttaB aL/ss9JUFcYI9R5Pfie63TUEsIUqO+Q8SSoOmRDH8Nl6LFxYtTQ1TZ7SYFltX9Nc4m8g WxVuTeFwYo508bfosHVDX3n1xk4QbGfqCUS6pE/B99DBXwCeh1mbK5DKmzKsauX15xZw 7D+HQKH8QFB8j2t5+ubiqSt1au9bUrgRuF+jHLctOYzUDVXnc1FCZTWRNji6+AjirUs6 TLSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SkjZHAep; 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 w3-20020a05622a134300b004196dab68a4si1963765qtk.656.2023.10.20.13.51.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:15 -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=SkjZHAep; 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 1qtwLv-0007tt-KA; Fri, 20 Oct 2023 16:44:15 -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 1qtwLj-0007l5-4u for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:08 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLd-0008CS-7F for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:01 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6b6f4c118b7so1179653b3a.0 for ; Fri, 20 Oct 2023 13:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834635; x=1698439435; 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=BBKuip3A0RhkTWc5ebdaF2DgmzVxIGNwRkilYwMnVKc=; b=SkjZHAepIfLdW5H34mCJtRoeu6DC08sS+XTsnGgD0laB6J4BhwQEOTGux1b+qrK+Od 4+5JZFiTl/3clzl731s+5tdoBB+G2EfVy15KTsDUbaG6cu5/iqEB1LWr1i4FhPht34bm +8kIqxAPAxnCxJE9BbWiI+oznXYv0BGtlWKX5bwUTr5d95yhQqyOm3UXETl6E8O4gdiY nNqR1qIOiwNfpPQ+JkzIHFGBm5oF9HGpiwK5SlXzxCz3ZVi74n+8Pi33NKB1o6MgCvt7 oZhzgp+UwLJskfas8TpU8KvuuufzqSSS6hWH4aG7pGNvxIVmk6c6DVOQgvlBGrd5xZ+E yQkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834635; x=1698439435; 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=BBKuip3A0RhkTWc5ebdaF2DgmzVxIGNwRkilYwMnVKc=; b=PfdPDpaNzbzZAtqX7JKgN55sfmuruVA/jGVTqy/X5scLjkzjNjxaishi7bDeFv8RLw BcpEGbvMrkj0YULN+t966LMHw8fwF3SkvT1cKg/FQkZDpxmkyOO19HEaQPiymn62vCLc /yUyyaNSyY1JVFfZrA+MD8pzfDd+xOUuCaKK08WyZGD9GbIfec5hzdfIhkrptCoIMX/x fxcNseVZbPM7lGO8G/l02whSBzX8ixjQ//PncQumt/Hknh+irYAp7I5TaJQwqA+wh0/I w45kyTEKpKyZpn9jp1eK3QYbRSJz78lSjCP5DNKpaLz0gaD1Qm+O0BwCYYA3D5XQFybG crAA== X-Gm-Message-State: AOJu0YyYmnKys8FAXgcjt7mj8XGloV1v1MLUzXUM7ib1CMulYcvTZ8o4 mDLqsr4+YN5jaH8brrnnbkHAIJgYZuBI+w87+8w= X-Received: by 2002:a05:6a20:bb1b:b0:17b:7dda:c0fc with SMTP id fc27-20020a056a20bb1b00b0017b7ddac0fcmr2655742pzb.8.1697834634889; Fri, 20 Oct 2023 13:43:54 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 25/65] target/hppa: Pass d to do_sed_cond Date: Fri, 20 Oct 2023 13:42:51 -0700 Message-Id: <20231020204331.139847-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 Hoist the resolution of d up one level above do_sed_cond. The MOVB comparison and the existing shift/extract/deposit are all 32-bit. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d629f5f7f8..9995749237 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1037,10 +1037,10 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, /* Similar, but for shift/extract/deposit conditions. */ -static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res) +static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d, + TCGv_reg res) { unsigned c, f; - bool d = false; /* Convert the compressed condition codes to standard. 0-2 are the same as logicals (nv,<,<=), while 3 is OD. @@ -3203,7 +3203,8 @@ static bool trans_movb(DisasContext *ctx, arg_movb *a) tcg_gen_mov_reg(dest, cpu_gr[a->r1]); } - cond = do_sed_cond(ctx, a->c, dest); + /* All MOVB conditions are 32-bit. */ + cond = do_sed_cond(ctx, a->c, false, dest); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3217,7 +3218,8 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a) dest = dest_gpr(ctx, a->r); tcg_gen_movi_reg(dest, a->i); - cond = do_sed_cond(ctx, a->c, dest); + /* All MOVBI conditions are 32-bit. */ + cond = do_sed_cond(ctx, a->c, false, dest); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3255,7 +3257,7 @@ static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3291,7 +3293,7 @@ static bool trans_shrpw_imm(DisasContext *ctx, arg_shrpw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3325,7 +3327,7 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3352,7 +3354,7 @@ static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3389,7 +3391,7 @@ static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3419,7 +3421,7 @@ static bool trans_depw_imm(DisasContext *ctx, arg_depw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); } return nullify_end(ctx); } @@ -3456,7 +3458,7 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (c) { - ctx->null_cond = do_sed_cond(ctx, c, dest); + ctx->null_cond = do_sed_cond(ctx, c, false, dest); } return nullify_end(ctx); } From patchwork Fri Oct 20 20:42:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736308 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502180wrl; Fri, 20 Oct 2023 13:48:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7xZU1n+R3QdCrGZJtsvWHXtjqVMPC1DVUr5AJSHPieI+S7ikrbRZYfmvC52BCu0KT7zv9 X-Received: by 2002:a05:620a:40d2:b0:775:99dd:431b with SMTP id g18-20020a05620a40d200b0077599dd431bmr3104393qko.58.1697834927837; Fri, 20 Oct 2023 13:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834927; cv=none; d=google.com; s=arc-20160816; b=Ws2p3MCr/0+pFCSQwtkt7wTjylrK9VqS3JxcG9vbFRF/o0VAfcWZfwE6vF/sdtaLuv PduQLTDJzBXJUJeTWQ9Pb5ux0FpOszLheRqaDLzKVnDnEn6z4MErKPqTjq+IwswuZLeS ZsQFXqe64SQGY3QzXqlW1DgbrYmANILnWbxMCPa5h7p+JUkoxkrrNur9C+6LGlS3aUiM jddsyxRdeJ0NBrcAby/RNc1l+B+KrTfVlJJLvMfxdpOXcyI4eCl3c+yrRNkTIi0F3d3B n2XNL3u4QaTc8t4e36DZOErRQext1bxMn8Ca5QA2VihMcrNXmPlH1OLu4Sphx/Qdcyot kBWg== 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=z2Fl5YhgRkzSF9REjLtMOkcrzmKFDkU8I1AFTwJdP2A=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Vu2VyBrKsfqGq4iT/NfGX/CVVXoKlw73nNfU3RI3u3KrT7B2oDLmmef6H9c98Sw5An +a2nD09DJwHHshpGeuuhjkk0IPR6aaaKYfS18U/d0ZZx4jgYDcEVh1L9K8PwoQvTsz4X zXIJ8VbPkE4nnno4lKw1LkzjVbYfp17njHfEKSiFq2/ILVjhPNu7my5BcVgvuhtl/L1W xSmW+PJthRKpV6RYh59ioicP8jK3Tv0CEo46Iafi7gUAlITs3aaUxLQ/92eEsXc1NwxJ gwH3MDQUw5a4wPLyfKGyFVw9vNkbRKE50TzAtWsQI7zWpj7xCfnqLHoTxcuanF0cP39R 9dMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vcvQZwCJ; 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 x12-20020a05620a098c00b007771d46fd50si1872550qkx.111.2023.10.20.13.48.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:48:47 -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=vcvQZwCJ; 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 1qtwM3-0007yO-6Y; Fri, 20 Oct 2023 16:44:23 -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 1qtwLk-0007lI-3X for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:08 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLd-0008Dn-ID for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:03 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b89ab5ddb7so1225089b3a.0 for ; Fri, 20 Oct 2023 13:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834636; x=1698439436; 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=z2Fl5YhgRkzSF9REjLtMOkcrzmKFDkU8I1AFTwJdP2A=; b=vcvQZwCJ2UXqZUx/rEdiLvl5rQtfm+5CEraMApVzNpOE3Y4ZGaxu2ucRPjlA3BaZT6 V3VJphOYcNisLP39aeFW/XPDuDSFOmkdNOMdo/lKODdRnnmckX4dTttKXA2C/7cBYood 7gX6Do23JLw5ctE8XExQDIk38MGuU5WaQpiuM1hYVXoU4iErtArEGs0KXZmKq9CyvYJM +VoEg4skgOcxTZyCxAhUGDY/pRFisqGVzbeKFtwKU00vRxQZ4EgxyeXv1zbpdo2nH7EE zARWqw2LeeKMl1IipgpEJyhUvFaG7FT/kQicVELEHtDmWfNOUkE5viPVzb83AgAScsUO +2vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834636; x=1698439436; 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=z2Fl5YhgRkzSF9REjLtMOkcrzmKFDkU8I1AFTwJdP2A=; b=nkzLefBNn8jzaAqwMXfRluMHPTSxB3I/Z/trRvALiH0jYQuJDXYrwswQJFLBmK7t91 QdfVd2H4IkU38VGN/E32vYPMQo8ajduyTFuTsuMwCBRPc/NeBBpeHHVfSPsB+W6/5dfC S+g9JEQvppJ8zDvhubz42PdfkUM+QXZ/pjHFFljQ9jjIMfSYZdjWTtc7hPzYRktaYZJt /fqUmWUjMCn+PFefWi+HJqOFT83Sn9CwBWf62olrJIR6PcfOY0xF/4Cpu/ruxflWLWoe GfSCatWMvQMILwYGisXS7eAiomwHEC4MTh3VYu98chV40W+Kf/GDn+LmWo2YMHl8gxYs uecA== X-Gm-Message-State: AOJu0Yzamdm0JV4d/TS8FeXrfjrgPWhlrIo1Ny19UOnVp0Jw5CsA6yHa 869J4KD/KBqQtxqhaQYA+Diy/n6T97n0HE4/ooE= X-Received: by 2002:a05:6a00:10c4:b0:6b5:608d:64f6 with SMTP id d4-20020a056a0010c400b006b5608d64f6mr3132724pfu.20.1697834636206; Fri, 20 Oct 2023 13:43:56 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 26/65] target/hppa: Pass d to do_unit_cond Date: Fri, 20 Oct 2023 13:42:52 -0700 Message-Id: <20231020204331.139847-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 Hoist the resolution of d up one level above do_unit_cond. All computations are logical, and are simplified by using a mask of the correct width, after which the result may be compared with zero. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 9995749237..be1763cb45 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1056,11 +1056,12 @@ static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d, /* Similar, but for unit conditions. */ -static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, +static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, TCGv_reg in1, TCGv_reg in2) { DisasCond cond; TCGv_reg tmp, cb = NULL; + target_ureg d_repl = d ? 0x0000000100000001ull : 1; if (cf & 8) { /* Since we want to test lots of carry-out bits all at once, do not @@ -1087,32 +1088,32 @@ static DisasCond do_unit_cond(unsigned cf, TCGv_reg res, * https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord */ tmp = tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, 0x01010101u); + tcg_gen_subi_reg(tmp, res, d_repl * 0x01010101u); tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, 0x80808080u); + tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, tmp); break; case 3: /* SHZ / NHZ */ tmp = tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, 0x00010001u); + tcg_gen_subi_reg(tmp, res, d_repl * 0x00010001u); tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, 0x80008000u); + tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80008000u); cond = cond_make_0(TCG_COND_NE, tmp); break; case 4: /* SDC / NDC */ - tcg_gen_andi_reg(cb, cb, 0x88888888u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x88888888u); cond = cond_make_0(TCG_COND_NE, cb); break; case 6: /* SBC / NBC */ - tcg_gen_andi_reg(cb, cb, 0x80808080u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, cb); break; case 7: /* SHC / NHC */ - tcg_gen_andi_reg(cb, cb, 0x80008000u); + tcg_gen_andi_reg(cb, cb, d_repl * 0x80008000u); cond = cond_make_0(TCG_COND_NE, cb); break; @@ -1428,6 +1429,7 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, { TCGv_reg dest; DisasCond cond; + bool d = false; if (cf == 0) { dest = dest_gpr(ctx, rt); @@ -1438,7 +1440,7 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, dest = tcg_temp_new(); fn(dest, in1, in2); - cond = do_unit_cond(cf, dest, in1, in2); + cond = do_unit_cond(cf, d, dest, in1, in2); if (is_tc) { TCGv_reg tmp = tcg_temp_new(); From patchwork Fri Oct 20 20:42:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736293 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501153wrl; Fri, 20 Oct 2023 13:45:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFslIQvaOfnAXfJnjU907OW1cn9IpF+X9dskOw7MKTFRVsDG8dNaBwOX/5FQBeCrFBrxE3N X-Received: by 2002:ac8:5bcf:0:b0:41c:b99b:4d75 with SMTP id b15-20020ac85bcf000000b0041cb99b4d75mr2763720qtb.11.1697834724202; Fri, 20 Oct 2023 13:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834724; cv=none; d=google.com; s=arc-20160816; b=eZ2LLALjHYMylLi0QHk52RCZjdW7Ez6LSdkySD8izKX0lXMTr9J/VrS3oKZ2PLLV9w qqqXFDlQfWc7Awnb5bZf7swTidEp4oXRNxIJLYDCAqah6/zru1ZO819zi0LGu9MtosOR xty1scseV9/fDPEeCrPYahZ+C5eJtUZeoDY0MFSKrRZKrQAobQn7MRyXiWzOYGacjQr9 EkfjvPflSES4DZ620/4GitvlRKndC3NE5uMCnlbyYfNQfThSj9mi5ojwbusu85GwVafB 6nNSvgq9TR8Ot80RdIxhUZN1PLI8wImRDQpZH16ev84Y4qcRsPEXei9CUjdAk2BrC5lT OLvA== 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=xtkaJF9+gMYoqpzUR8ATyW8aKIy9V4St1iGFcMEqLNY=; fh=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=Ba91CzjSlPV30oh0SdRp94IzyQCDUfkZrEXEB2zYWELLEg8haanxYSNQBmOOIhf0cv eg549jV/cN2Xtdp6YyHvHJX+ZYyyHzkQoE6UpHurkHikGIGbeOA+nYovvTeVblVxjKVD 3xsvegu3lxKhlgZJNdWg8/l6bDWUtSjyTWaw/jm83RitPjph06eP4mmr6+tdCkK52MOQ oh+9kclwmHKWK/jYTIruXstP77JI2l6I8MKbImpaLYE97XJz3K/Ua4nrVjX6MkefsMlM 3CWLtYYKgzvGwEoJRPOednDh9gx9oELQ1ON2KKHlyEkV7rXd05byt3SO/VoQPiYHyRlK vCpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q1kQJfKi; 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 s13-20020a05622a178d00b0040fd5df3824si1980602qtk.36.2023.10.20.13.45.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:45:24 -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=Q1kQJfKi; 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 1qtwLt-0007pW-C2; Fri, 20 Oct 2023 16:44:14 -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 1qtwLl-0007lt-8N for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLg-0008EJ-3G for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:04 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6ba172c5f3dso1169952b3a.0 for ; Fri, 20 Oct 2023 13:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834637; x=1698439437; 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=xtkaJF9+gMYoqpzUR8ATyW8aKIy9V4St1iGFcMEqLNY=; b=Q1kQJfKi0tLI6b2j2sfX3Ct8L/VNVY4Leijjc9HzBwts34D7JovNpFb/F9PNb9Imxd sbYN1kUL81zZRKscpn3mmWHdSoAACULSeZzwsqedrKLeizHhnbBXit5u1VxwFB4yaVSO nqOwbnqxZfpsmSW6UnZ1ydxt/kC0yFPpEQXTp78+ZgyVpNb5WsBj+d1zZF3oa3NiaL7U FcxhrBadfuGHAsLCsokyQFjgAt3zxD2X5gzNH82U10ZEH0LMoNGD59EVN/JhujWL5igX SdNjQpMzIQYF2Zfy4wi2fRFkyhJfZsxBAYWn2/CxHtrNRkVMGwG/UPoCx40hhfQ8RjOH MS8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834637; x=1698439437; 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=xtkaJF9+gMYoqpzUR8ATyW8aKIy9V4St1iGFcMEqLNY=; b=ad9zRFLH+8L5YdEBz9lkt2mrg7zOT3vFlpCbnggG0Ev+9JgY5Uy//egrJURsGenMcO cTuoYTcX37IHbq+bBjf+huveKfFNgQySGxeXyEqH0P+p3vN0+PeKrQJIV8JAWuwaNsiR zmW0CkdyNO4AYyRczrdcHiSY5GvVJgI5AY7sJCPyJw0ebsv72gt2wT0DUIkCOjXAsY88 +IFI8vyKZkNyoHKp4bEtkY8tUZeLm7X16PDiijr5WyeMIGaU5lEeX4HGXTLVzXGhVdTU ExlHI4p5AlDJaqSbTXs+ONZSnxUEr/DVbzDTWaQGg8uyik/lSN/4w9/10DFht8kBASfj GCuA== X-Gm-Message-State: AOJu0YwjVUcl5DeUAi5MnktahASDo/lb4EyD7C0kxm5Ijs5hRQ7+TJP7 Vrelwwl+prhB5a7Q/ftC0FajEVyY3i/M70gI1WA= X-Received: by 2002:a05:6a21:47c6:b0:174:f06:34dc with SMTP id as6-20020a056a2147c600b001740f0634dcmr2418905pzc.28.1697834637418; Fri, 20 Oct 2023 13:43:57 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 27/65] linux-user/hppa: Fixes for TARGET_ABI32 Date: Fri, 20 Oct 2023 13:42:53 -0700 Message-Id: <20231020204331.139847-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Avoid target_ulong and use abi_* types. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/hppa/signal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/hppa/signal.c b/linux-user/hppa/signal.c index ec5f5412d1..4400ce4df4 100644 --- a/linux-user/hppa/signal.c +++ b/linux-user/hppa/signal.c @@ -72,7 +72,7 @@ static void setup_sigcontext(struct target_sigcontext *sc, CPUArchState *env) static void restore_sigcontext(CPUArchState *env, struct target_sigcontext *sc) { - target_ulong psw; + abi_ulong psw; int i; __get_user(psw, &sc->sc_gr[0]); @@ -146,10 +146,10 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, haddr = ka->_sa_handler; if (haddr & 2) { /* Function descriptor. */ - target_ulong *fdesc, dest; + abi_ptr *fdesc, dest; haddr &= -4; - fdesc = lock_user(VERIFY_READ, haddr, 2 * sizeof(target_ulong), 1); + fdesc = lock_user(VERIFY_READ, haddr, 2 * sizeof(abi_ptr), 1); if (!fdesc) { goto give_sigsegv; } From patchwork Fri Oct 20 20:42:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736295 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501259wrl; Fri, 20 Oct 2023 13:45:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtNRiwP8gk/eAM7INz/j0/Ks2FFk2wY1wOSqA4X0c/AlIZKvtupL3QjBfB7nCKhqKrl/dw X-Received: by 2002:a05:620a:2a14:b0:775:6726:7e77 with SMTP id o20-20020a05620a2a1400b0077567267e77mr3507621qkp.10.1697834744975; Fri, 20 Oct 2023 13:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834744; cv=none; d=google.com; s=arc-20160816; b=ciFUREPHTkX9ZNFCmiTRZZLQHc5BfJ+ZKDl2j4yFdbsIXqNaOa0W5HxZkuUBAdxnuS 6G+usy/RSwvZKObkxt3HN4VBQXE3Jd/DkQOzEBfZIwqw2tRE91vSVaFHLua2XNHvq1y/ tuY9MKK2uvmTp0q0HU4VBAQC5BJFPRqqJ38loTX0Ov/km3OCJqMYhaTBk8XRM1NvI/gY wkoFIAE17TUgKSkVBX58hqRdOJIRWG68YV/n6v9dEIDel620OlF2HLzZgcr9kauh3Fr5 dDr5uBLGQ0JSeibApiJZpB0KeKd7zOGB2n3v3W9fW2ZNdHmNe+lUWKwwTKHARlobsw2m jCBg== 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=fDB1iCB7dFrTdi+sskzC1+DL914HNFrtvGBOgbigGUk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ptzDFDf0YQSOR9/hbW5KuCHwy3SAdl6SHmhzsblHom3eBe1wFVF2p6xuMgWnTh/3HC IbEkF/SrNnYwRfb+uL48awO3olvzf/vvK4MzFMP1JgU5FO82+Pc2RWW+aNXhvTVlcfn4 u8SedMcAj0du7srPN5RmbOCMJKenWJV2EQp9sK6fuk9wTtgt4ZLC38rzN8Ak/xg1Nme/ 8OcsQrFRsUCriVNjVCFAXc8KL8QEEfOO/Iunh2PamPptkisVZyqSc0dWkKZjcUg+/yCB Qxy22lkMtElxrKbvqXp0eJ6PAOKf4coW42KAEhzNz0jnGtpv7RWwmcEA0TGPcgIoE5bM KEVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TpMVXKfG; 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 j6-20020a05620a288600b0077435da759esi1888654qkp.595.2023.10.20.13.45.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:45:44 -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=TpMVXKfG; 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 1qtwLz-0007wL-TU; Fri, 20 Oct 2023 16:44:19 -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 1qtwLl-0007lu-8a for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLh-0008EV-8j for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:04 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b497c8575aso1218027b3a.1 for ; Fri, 20 Oct 2023 13:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834638; x=1698439438; 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=fDB1iCB7dFrTdi+sskzC1+DL914HNFrtvGBOgbigGUk=; b=TpMVXKfGaKEaDH6VFA+Vv4ks6+LaEGg3C2JeHcCwJPsbo/0JP0/YvZOg3zXvf0MVG4 DPyH6tssDXF5B9BOBNL8MmQnoemL9ilgZLN2tMookuisAxrc6qay7/+gZWcRZZEpJo1p 9VKfwXScwTjUxsmRreu16jC4Ki+EH+HHGdyqEyBk9B6thWPGUITclaXXPhV6ZdYkAM2y zKr03RAT7UK7TiP1VLywFohThBgGnn7SLGyQD+I0ctqwDYXZosDVp9wgxWN8ypwp0dtr fQL5/k2XJxCHAaYBs9Sto1iGyaE+m4MGFKG1F4m9eaUXnPUL3JJGnvpQ3tNhnPXPMR9o XbVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834638; x=1698439438; 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=fDB1iCB7dFrTdi+sskzC1+DL914HNFrtvGBOgbigGUk=; b=D0oXCps+ml1rMhlsPvAl7M2z1U1jGOjNyUcI3rqHbX6Sqj25EsCNfrEPQjGeMkl3VO it9x7Xp985iSdDl2YsPN6XtJE6yooroJgoy6zqqTxyt3Bf3e9CbTXu1OS2/WT12yQNnb d9IJMGiJgAegHFK+6NLr9uV7kFFjJaUazHKJipsQAc8AaH/DbdfCug4trXD+RSFAs+G1 uPknCZ0b0UW4mz8iH6zUYGK00UENnOjIlTGo3+tP5MGsJF+wOw14Vk2hB9yE8v4hnNEA peAivPw1rvDye/yF96LR1NWTaMaVFuj8h/K1cXPES1BkWG6USbZAveXgUt7hAb9WNao3 E82Q== X-Gm-Message-State: AOJu0YwXvLu5eAtmynHtTQ6CkvrUKaf2VSnDxAZ1MKVPIzp7WMEAP5MU QfCkb6w8eWFW1KZCJrLkKASbSW5S+aasdGzHb5Q= X-Received: by 2002:a05:6a00:24c6:b0:690:1c1b:aefd with SMTP id d6-20020a056a0024c600b006901c1baefdmr3062144pfv.5.1697834638209; Fri, 20 Oct 2023 13:43:58 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 28/65] target/hppa: Drop attempted gdbstub support for hppa64 Date: Fri, 20 Oct 2023 13:42:54 -0700 Message-Id: <20231020204331.139847-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 There is no support for hppa64 in gdb. Any attempt to provide the data for the larger hppa64 registers results in an error from gdb. Mask CR_SAR writes to the width of the register: 5 or 6 bits. Signed-off-by: Richard Henderson --- target/hppa/gdbstub.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/target/hppa/gdbstub.c b/target/hppa/gdbstub.c index 48a514384f..4a965b38d7 100644 --- a/target/hppa/gdbstub.c +++ b/target/hppa/gdbstub.c @@ -21,11 +21,16 @@ #include "cpu.h" #include "gdbstub/helpers.h" +/* + * GDB 15 only supports PA1.0 via the remote protocol, and ignores + * any provided xml. Which means that any attempt to provide more + * data results in "Remote 'g' packet reply is too long". + */ + int hppa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) { - HPPACPU *cpu = HPPA_CPU(cs); - CPUHPPAState *env = &cpu->env; - target_ureg val; + CPUHPPAState *env = cpu_env(cs); + uint32_t val; switch (n) { case 0: @@ -139,24 +144,13 @@ int hppa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) break; } - if (TARGET_REGISTER_BITS == 64) { - return gdb_get_reg64(mem_buf, val); - } else { - return gdb_get_reg32(mem_buf, val); - } + return gdb_get_reg32(mem_buf, val); } int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) { - HPPACPU *cpu = HPPA_CPU(cs); - CPUHPPAState *env = &cpu->env; - target_ureg val; - - if (TARGET_REGISTER_BITS == 64) { - val = ldq_p(mem_buf); - } else { - val = ldl_p(mem_buf); - } + CPUHPPAState *env = cpu_env(cs); + uint32_t val = ldl_p(mem_buf); switch (n) { case 0: @@ -166,7 +160,7 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->gr[n] = val; break; case 32: - env->cr[CR_SAR] = val; + env->cr[CR_SAR] = val & (hppa_is_pa20(env) ? 63 : 31); break; case 33: env->iaoq_f = val; @@ -278,5 +272,5 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) } break; } - return sizeof(target_ureg); + return 4; } From patchwork Fri Oct 20 20:42:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736335 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502967wrl; Fri, 20 Oct 2023 13:51:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqX1sHoIJ8wyWZFM5N8YaNSd4lFwDQIGxyLRLtP8NavbwU/zUA0AbnOGmAfO06oavwsNOM X-Received: by 2002:ac8:5f81:0:b0:418:1194:42f3 with SMTP id j1-20020ac85f81000000b00418119442f3mr3530062qta.56.1697835110204; Fri, 20 Oct 2023 13:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835110; cv=none; d=google.com; s=arc-20160816; b=y4ddvCjbdvs/wPhQh+ltPXhzrJ9JJbtmDX7k9r2SCLRTYWMK9PpCUeSU+XKMLx4LtH hX6sfVKlGJFKcs4Eb7wbpG+dLaz43RaO870Vo8T0pvG59kfJXx+PDAicqsmGnLLMVy5y 1X0SlISbPNugSIu7cW0EUYYVsedbVvMRFyclP+t2mueJED7NEW0x8UKPSmXPYajOtZI7 vxPLbY+Fb+87OrSL7Tsf1/VFyZUUfc2fScg41VMR5SR19934yA/1xZJW+yIsA5wu8zHT tASiimNB/DOBJMkAm5yXUmorKgldTyhfS4a9ZKi0K2ZpVaW28FBzFEUMeFqDzHNrHnJ9 JOKQ== 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=mLJZOZT+lQfb7f2jxY8G9POC0Jl6++4YjRa95Z5whBs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=qrvM8HlFxxdvQZWR2u08+liHCkd2nVllC73aBG2kpAXd2B+b46Jz2fjXH3jgA2OfJN L+h7KXcHTuOEyBlrAJViCWvAiL5eG2OiXUliysosUsjoPd/OoPBTF2bWfLe6kZio+N0v 3pX+FeIfqwPnla+iOhJscFulkHRz+0geo4dUeYnOtY3sDjNZ7zaA9UxC1HjhWSIqyLfE cveZre9j93U4Dize0jZmgE00FxbJKthNujZ1r6m5Yh4czb+GgqZnRxdMTE+Zp1AnmGOm 9exlXSaa+/Tm1JomacRDAVTS4CRpet6royg/s9EkMPZ2t+VmblnARmLdCYowQ5tmZhWc HwdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KEmwcthD; 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 c19-20020a05622a025300b0041978576d48si1916199qtx.409.2023.10.20.13.51.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:50 -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=KEmwcthD; 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 1qtwLt-0007rE-T8; Fri, 20 Oct 2023 16:44:13 -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 1qtwLl-0007lv-9M for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLh-0008Ea-92 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:04 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6b5cac99cfdso1154679b3a.2 for ; Fri, 20 Oct 2023 13:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834639; x=1698439439; 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=mLJZOZT+lQfb7f2jxY8G9POC0Jl6++4YjRa95Z5whBs=; b=KEmwcthD0ITAkDvHlOVkgAITZWT2k6uUCKsn5oIA5QBzGR4Z8oKycd+y3lo3ge9ptF HYXOuAW0IuwhEhkRCstIxOjsI92vz83Zf5lQQoKLzfBm2QmbnO4dfRma/iTYmo8Hw5jm AzaXWhkx6sPsaGM/AuokX3NIhS5Fo3BEo/I7vbParkzH/+HDJk0pbD77PydiRKmDGoQD GVthDp/ITnhzptsKybxFsOVtyi6Gj+7MavTlNy+k2sCisZr7Ka03HlFaN1xq7vnO/SHU iY6w0irGT8Wm8kcQfFpD+9XzlCP3BcyzZrejmwQQc6vmJScI/FgSkGzw9xhlFoJjduy2 exPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834639; x=1698439439; 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=mLJZOZT+lQfb7f2jxY8G9POC0Jl6++4YjRa95Z5whBs=; b=MR6TUUDcLHSJpymoBJtcvW4CJm87Qd6ZHLHHi6nOJXNP55nw01tgNEsDdiz/b6Tjbo OERlhFBmNQxbVv0UYI83Z/WQDS8SvpTggFTWyXM4TKeZi1WKdt4zFkrlr3yTboKbJEIf IwObaBIcLxWuXX/d9PoNKzT2ZGOjLEcaA/trjoKx7KBgSh14DFde2z296ZEDF2nGLouR KeLz2CvKhBz90SfLMDe3YCVxGF5Lebgvbw+jRLgAiC1xhwDp7bKs9lvF9XlJ1rWzRY8R rtQw1Z5VM6CF2tO+7GuWk/XLVue/SmvclXVATMfFItmZw4r3jV7W7DF8J99KsgSbjwSu v5GA== X-Gm-Message-State: AOJu0Yxml19zMRjcoWsWBi2SREvJ3sSiuV70BSEDMZZK+ye0JH6vg2hI 3NIkvxOV/QQHGHCLryhrAXd1v67gpC+VC1+X/jA= X-Received: by 2002:a05:6a20:258b:b0:15e:bb88:b771 with SMTP id k11-20020a056a20258b00b0015ebb88b771mr2486228pzd.37.1697834639434; Fri, 20 Oct 2023 13:43:59 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 29/65] target/hppa: Remove TARGET_HPPA64 Date: Fri, 20 Oct 2023 13:42:55 -0700 Message-Id: <20231020204331.139847-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 Allow both user-only and system mode to run pa2.0 cpus. Avoid creating a separate qemu-system-hppa64 binary; force the qemu-hppa binary to use TARGET_ABI32. Signed-off-by: Richard Henderson --- configs/targets/hppa-linux-user.mak | 1 + target/hppa/cpu-param.h | 23 +++++++---------------- target/hppa/cpu.h | 9 --------- target/hppa/cpu.c | 3 --- target/hppa/translate.c | 2 -- 5 files changed, 8 insertions(+), 30 deletions(-) diff --git a/configs/targets/hppa-linux-user.mak b/configs/targets/hppa-linux-user.mak index 361ea39d71..8e0a80492f 100644 --- a/configs/targets/hppa-linux-user.mak +++ b/configs/targets/hppa-linux-user.mak @@ -1,4 +1,5 @@ TARGET_ARCH=hppa +TARGET_ABI32=y TARGET_SYSTBL_ABI=common,32 TARGET_SYSTBL=syscall.tbl TARGET_BIG_ENDIAN=y diff --git a/target/hppa/cpu-param.h b/target/hppa/cpu-param.h index c2791ae5f2..2fb8e7924b 100644 --- a/target/hppa/cpu-param.h +++ b/target/hppa/cpu-param.h @@ -8,26 +8,17 @@ #ifndef HPPA_CPU_PARAM_H #define HPPA_CPU_PARAM_H -#ifdef TARGET_HPPA64 -# define TARGET_LONG_BITS 64 -# define TARGET_REGISTER_BITS 64 -# define TARGET_VIRT_ADDR_SPACE_BITS 64 -# define TARGET_PHYS_ADDR_SPACE_BITS 64 -#elif defined(CONFIG_USER_ONLY) -# define TARGET_LONG_BITS 32 -# define TARGET_REGISTER_BITS 32 +#define TARGET_LONG_BITS 64 +#define TARGET_REGISTER_BITS 64 + +#if defined(CONFIG_USER_ONLY) && defined(TARGET_ABI32) +# define TARGET_PHYS_ADDR_SPACE_BITS 32 # define TARGET_VIRT_ADDR_SPACE_BITS 32 -# define TARGET_PHYS_ADDR_SPACE_BITS 32 #else -/* - * In order to form the GVA from space:offset, - * we need a 64-bit virtual address space. - */ -# define TARGET_LONG_BITS 64 -# define TARGET_REGISTER_BITS 32 +# define TARGET_PHYS_ADDR_SPACE_BITS 64 # define TARGET_VIRT_ADDR_SPACE_BITS 64 -# define TARGET_PHYS_ADDR_SPACE_BITS 32 #endif + #define TARGET_PAGE_BITS 12 #endif diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 2182437882..8320f82464 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -107,11 +107,7 @@ #define PSW_T 0x01000000 #define PSW_S 0x02000000 #define PSW_E 0x04000000 -#ifdef TARGET_HPPA64 #define PSW_W 0x08000000 /* PA2.0 only */ -#else -#define PSW_W 0 -#endif #define PSW_Z 0x40000000 /* PA1.x only */ #define PSW_Y 0x80000000 /* PA1.x only */ @@ -124,13 +120,8 @@ #define PSW_SM_P PSW_P #define PSW_SM_Q PSW_Q /* Enable Interrupt State Collection */ #define PSW_SM_R PSW_R /* Enable Recover Counter Trap */ -#ifdef TARGET_HPPA64 #define PSW_SM_E 0x100 #define PSW_SM_W 0x200 /* PA2.0 only : Enable Wide Mode */ -#else -#define PSW_SM_E 0 -#define PSW_SM_W 0 -#endif #define CR_RC 0 #define CR_PID1 8 diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 81d51e98b6..36875a6a1a 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -253,13 +253,10 @@ static const TypeInfo hppa_cpu_type_infos[] = { .class_size = sizeof(HPPACPUClass), .class_init = hppa_cpu_class_init, }, -#ifdef TARGET_HPPA64 { .name = TYPE_HPPA64_CPU, .parent = TYPE_HPPA_CPU, - .instance_init = hppa64_cpu_initfn, }, -#endif }; DEFINE_TYPES(hppa_cpu_type_infos) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index be1763cb45..450f64bac3 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2156,7 +2156,6 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) switch (ctl) { case CR_SAR: -#ifdef TARGET_HPPA64 if (a->e == 0) { /* MFSAR without ,W masks low 5 bits. */ tmp = dest_gpr(ctx, rt); @@ -2164,7 +2163,6 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) save_gpr(ctx, rt, tmp); goto done; } -#endif save_gpr(ctx, rt, cpu_sar); goto done; case CR_IT: /* Interval Timer */ From patchwork Fri Oct 20 20:42:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736325 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502775wrl; Fri, 20 Oct 2023 13:51:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXEqbBxUTGgjQ60ftSmPpi/Eb3ILatVmxW2FYJIHJgNlXEcwn243xntuG6JabD06ocMm5w X-Received: by 2002:a05:620a:4089:b0:76c:992e:1b2f with SMTP id f9-20020a05620a408900b0076c992e1b2fmr3047944qko.13.1697835063533; Fri, 20 Oct 2023 13:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835063; cv=none; d=google.com; s=arc-20160816; b=mHgmoWyn0E0r8AK/RoXL+Y49NXnkg9lIBoc7HyPg0uHF6sRUV0ojGUCC/02Culn2P4 irIeU8K6EC+C3sn7/wnEdLE6eR7OaFpdeOs3nZUQ6MwH6GlRVNupHV/shSFwxReFWZfy trd+ImNyOPC9YALGjr/itnA2xrygF3KLx4xIz6pzR7jOaDiVWJwdLgsvP2JzNDSAmh4I onPuGaOEEWkW7U3bJ9EWlLHbJ6KUvqk8J6fHq1k3TPcdMqG0nYaYPOrW8LEXtt0Wy1MS 0N7Mzm11vKZzNLtniCeVhuPesLDWBzKqWvDyClP7Xxj1GF4VkwWjTPpNJph68nH/vu0p UhJQ== 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=rGnZN4tQSt5rJQs9WbrfWk7f+59QeCqPHohQlMJykxU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=aMhEu7G4bx8reaUsXEaJSF2OjBsolWkFo8nPAqpynVVbp/LOmISz3mXxjwxoO3ICv6 3t6byod316OIF+dl8zBwuT1vz4GYUpC+gsG5bo/pnqJ6I9FrcCQLRnFssVSAAyg/C+5i dnzsIhXmExJ9gdSDUADhXIvy7tup+D/puWQYN/dOfQ3pripR9TKP2x+EDWgKB40Is6wI 2Ij5XaDH1O1+bk7/Al1tUioDlSYmYOgza/lEhGK36SR8KZW2HvmjfeIGtrrN1Cho8r1V TbKtLm2Do+9DBHjrZ0LC/1YpjOKbgM0Qyy5+2PEcJjwmMT5gnBu3IL+3E7lkuUU7jQ53 7ehg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=axrgHr8g; 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 m7-20020a05620a24c700b00777279e49cbsi502503qkn.165.2023.10.20.13.51.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:03 -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=axrgHr8g; 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 1qtwLv-0007u1-Ri; Fri, 20 Oct 2023 16:44:15 -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 1qtwLl-0007ls-7n for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLi-0008Em-Si for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:04 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6ba172c5f3dso1169986b3a.0 for ; Fri, 20 Oct 2023 13:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834640; x=1698439440; 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=rGnZN4tQSt5rJQs9WbrfWk7f+59QeCqPHohQlMJykxU=; b=axrgHr8gYmjRXdk+WcT/R7ypVGU+dPXHhabWcQtdZuxNzwMHgQunNRV6qoDO1sV1Fn +f5Nla7kcwk2U6nM4Ho5vdUNzhUMGj/x9Yj7WM03WgTzTuLDLDJ56TfZhwor608JIOkr QBkn7poLZY5346L3ouPr7QhJI+z6oZbT+0vsu4cBIqZwEdNdu0hzySPYl1fK9WAlxgXX 7Mm40wWC2PxEL8UQJfDlGQfur3X74bx/Jz5QYyC/2asjk35BrTlSsgAvkWQdg82l0ZKP s+XZFS9CdKCHoih6Q1ZeaHvuu854Npklj8lrR/mQdy5e6YEEyZO2osFVdWz/kLzJMNsL EEvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834640; x=1698439440; 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=rGnZN4tQSt5rJQs9WbrfWk7f+59QeCqPHohQlMJykxU=; b=vmkcvxmJm2Z9IRQTFAb6djSiIIFcHRMsNj34lvJicJOcVWF7I3J4IYXo74a9KPBWNk q+T01yjGGNNPFbJucnHephZ1caqQN/ykctBcz8QHnUXgRRZrfhxanZisi2dpPFf9POYn F3twJ4v/4iRhnkZPBpb+Ri+7VCiKtqEvOCTqeph7EzEfc3mI9yHysD29FhrswGQSvpW7 V7inrkSf0FuhEP6KP7SalQFYX5eTPMzI9YIODoyNVZqjaVCZzn56EEYr06xiadypeyN9 WfM8el2QvXb/+oTqwAKtJ1kpzPaLsegkau8EpqmOuFDYMEj6UhVDzHb5K26TFMFnnv8f AyjA== X-Gm-Message-State: AOJu0Yzf/rokuDdPAibGQe6gdy2z+6E8RnEnVGv+jlgYfjlCktOwwqG2 jMlaiarIEXMfbbyQ7NLVhK/w5Us213ODzSfx98A= X-Received: by 2002:a05:6a21:71c7:b0:16b:f71d:1b82 with SMTP id ay7-20020a056a2171c700b0016bf71d1b82mr2914608pzc.34.1697834640653; Fri, 20 Oct 2023 13:44:00 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 30/65] target/hppa: Decode d for logical instructions Date: Fri, 20 Oct 2023 13:42:56 -0700 Message-Id: <20231020204331.139847-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 10 ++++++---- target/hppa/translate.c | 15 +++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index aebe03ccfd..26ca9f1063 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -61,6 +61,7 @@ &rr_cf t r cf &rrr_cf t r1 r2 cf +&rrr_cf_d t r1 r2 cf d &rrr_cf_sh t r1 r2 cf sh &rri_cf t r i cf @@ -73,6 +74,7 @@ @rr_cf ...... r:5 ..... cf:4 ....... t:5 &rr_cf @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf +@rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d @rrr_cf_sh ...... r2:5 r1:5 cf:4 .... sh:2 . t:5 &rrr_cf_sh @rrr_cf_sh0 ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf_sh sh=0 @rri_cf ...... r:5 t:5 cf:4 . ........... &rri_cf i=%lowsign_11 @@ -150,10 +152,10 @@ lci 000001 ----- ----- -- 01001100 0 t:5 # Arith/Log #### -andcm 000010 ..... ..... .... 000000 - ..... @rrr_cf -and 000010 ..... ..... .... 001000 - ..... @rrr_cf -or 000010 ..... ..... .... 001001 - ..... @rrr_cf -xor 000010 ..... ..... .... 001010 0 ..... @rrr_cf +andcm 000010 ..... ..... .... 000000 . ..... @rrr_cf_d +and 000010 ..... ..... .... 001000 . ..... @rrr_cf_d +or 000010 ..... ..... .... 001001 . ..... @rrr_cf_d +xor 000010 ..... ..... .... 001010 . ..... @rrr_cf_d uxor 000010 ..... ..... .... 001110 0 ..... @rrr_cf ds 000010 ..... ..... .... 010001 0 ..... @rrr_cf cmpclr 000010 ..... ..... .... 100010 0 ..... @rrr_cf diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 450f64bac3..733d5fe067 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1392,11 +1392,10 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, } static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, + TCGv_reg in2, unsigned cf, bool d, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg dest = dest_gpr(ctx, rt); - bool d = false; /* Perform the operation, and writeback. */ fn(dest, in1, in2); @@ -1409,7 +1408,7 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, } } -static bool do_log_reg(DisasContext *ctx, arg_rrr_cf *a, +static bool do_log_reg(DisasContext *ctx, arg_rrr_cf_d *a, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg tcg_r1, tcg_r2; @@ -1419,7 +1418,7 @@ static bool do_log_reg(DisasContext *ctx, arg_rrr_cf *a, } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_log(ctx, a->t, tcg_r1, tcg_r2, a->cf, fn); + do_log(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d, fn); return nullify_end(ctx); } @@ -2672,17 +2671,17 @@ static bool trans_sub_b_tsv(DisasContext *ctx, arg_rrr_cf *a) return do_sub_reg(ctx, a, true, true, false); } -static bool trans_andcm(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_andcm(DisasContext *ctx, arg_rrr_cf_d *a) { return do_log_reg(ctx, a, tcg_gen_andc_reg); } -static bool trans_and(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_and(DisasContext *ctx, arg_rrr_cf_d *a) { return do_log_reg(ctx, a, tcg_gen_and_reg); } -static bool trans_or(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_or(DisasContext *ctx, arg_rrr_cf_d *a) { if (a->cf == 0) { unsigned r2 = a->r2; @@ -2734,7 +2733,7 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf *a) return do_log_reg(ctx, a, tcg_gen_or_reg); } -static bool trans_xor(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_xor(DisasContext *ctx, arg_rrr_cf_d *a) { return do_log_reg(ctx, a, tcg_gen_xor_reg); } From patchwork Fri Oct 20 20:42:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736311 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502238wrl; Fri, 20 Oct 2023 13:49:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDMNdr0MenR+tBbP6f3Go4PiblVW0/QmO66Ur4ipMmnxF+CDRO1yFEAskcc3SQLIcT56mz X-Received: by 2002:a05:6122:1d05:b0:495:be1c:5be9 with SMTP id gc5-20020a0561221d0500b00495be1c5be9mr3249352vkb.1.1697834941066; Fri, 20 Oct 2023 13:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834941; cv=none; d=google.com; s=arc-20160816; b=a7RDivCCPx80tE1Zldr31ylV1ViaEjRG1XJ3c6r4eO+fqgInUMUQxVxEnqgDFfsfd/ wkjF/Pk48iJmg/YvEgRswuRukcJipe6osyH6GbUgkFxKdmz+gwe2JJJQd336g+W/t1eV k6P+aOjjuRuwSBC7VmEaRk5DTpnxhuW3YiPZof9Y5Mb1ysj06eLpU5mVdj27+xoH3ieU wc2LQ43hVC7F9OmFe8dmpTCLO7CVej7pA8D2/u2mxVnylU8zCMMmU6nvlwnwk1ddsydp IEz7Qm+xVFydd6UZ744zjs5WwSrpJclRl5EK6rtjiRrpa4S8cmuWeo4RWL9jGRDVGjI6 iVFA== 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=QKFMd4rGDJ5KFBAIYPVixPgZKO9WwO4i/DkwJMR9nTM=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=H00wy3mWKWzQmpTTLT6WKVVmbL5pEkEt0krU55Lsla71Hed/7qF09UC6OOb43FNo33 PS8hfZENU26Drj+M/DlK9PQd/Ng5m603pwOHzwF/BrLWx+z6hRzVEpwlPD+F+61zCKK+ flIKtAUmqA9zuIsAI/7fhz2d2ovRQ2ouUjcdfKBvJw5pnSPHVfsevDvb/LqOkdXd0n13 NkwLFA78aNAzi39nq4aV0J6TCBzcGW4xUdgTjcTTpqHSwM9Stz4B1sXPl+qJ72BNZYUf MST/7kjS7KKwkgwNF3lFw4mH8F9cVq0w5wBtmiQnDcsNyLvR7UaQhmdrAYr9fFHAx9jk GRjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=onOh0mKA; 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 t18-20020ac85892000000b0041cc795c5e3si1919625qta.759.2023.10.20.13.49.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:49:01 -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=onOh0mKA; 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 1qtwLv-0007rx-4o; Fri, 20 Oct 2023 16:44:15 -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 1qtwLl-0007lw-9Q for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLi-0008Ez-Sf for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:05 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6b497c8575aso1218062b3a.1 for ; Fri, 20 Oct 2023 13:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834641; x=1698439441; 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=QKFMd4rGDJ5KFBAIYPVixPgZKO9WwO4i/DkwJMR9nTM=; b=onOh0mKAuYhdukrLv+KEEq2irSEzCww8OnRHMFlf4DD0yJzZv+NCPaFdD5ktzQtOsm AIAQ62vKTbvqcqWeqdGi/yzj5ZPAUFYnUlbeAmXvOeYxIGggFWKyprVspheEX/p1qGQa g1mwJCfo/R1YmHbMYIbYhtqV/6JGKb4Cd/tsNxSzNYsTpHKxAEYMs7phgq54jtfxdV0F Gq1dYmBf0q5Omrf0735W1DXhTshakS/600aI8Xe6HAhliZLF6G6f11O18oUZnpKH5y8r sKbse7HnRE5MKqsoLse+wYJMQGEo7o2fSoNLzf/BNGBpbXIrzx4uhstxWykHtnd+ymAj uAww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834641; x=1698439441; 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=QKFMd4rGDJ5KFBAIYPVixPgZKO9WwO4i/DkwJMR9nTM=; b=EffRgtYNMnYiaKg4JfWOKKfUl3qn26luvNgMFD3GggBEOKQfKYEX+cXylhI3EE4ZRJ 0ZFq7d9ActMK5KUKL9RIOLB6PJioyk29JuENTPTBJ8tGQDJimkrQgIpE0uOrruQg0RLc +SpLXC5/vq+GiuV1IbBPWUkIxHGS6SOf/sIm8EAUhPfpPgLNcYYYtW9Nj5d4fh69r5Pv oUrWegsA2JAIyj2uMoQCT7JLmMA6OXuAVxuSCAh7PRlWMT6W2EiRK1FgTf3rLLL3Sb+F +LEYEZkOp5Z8E14a/bIcHyDe6iyFPvlSdN5r7brRuk3iGvVEfGcD9S2Eyf0uk6KdUxGc BB8Q== X-Gm-Message-State: AOJu0YzPeqr+6WR9D6dAgLN7Jx0zHCNZUO1pPseHnU40RmedVE18mt7f 4tM5vhHD7p8VAAp+SFvV6KPglyeyOH4a5yUmq2w= X-Received: by 2002:a05:6a20:a215:b0:17b:e1a2:d0d0 with SMTP id u21-20020a056a20a21500b0017be1a2d0d0mr2401289pzk.33.1697834641408; Fri, 20 Oct 2023 13:44:01 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 31/65] target/hppa: Decode d for unit instructions Date: Fri, 20 Oct 2023 13:42:57 -0700 Message-Id: <20231020204331.139847-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 14 +++++++------- target/hppa/translate.c | 25 ++++++++++++------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 26ca9f1063..03b1a11cac 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -59,7 +59,7 @@ # All insns that need to form a virtual address should use this set. &ldst t b x disp sp m scale size -&rr_cf t r cf +&rr_cf_d t r cf d &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d &rrr_cf_sh t r1 r2 cf sh @@ -72,7 +72,7 @@ # Format definitions #### -@rr_cf ...... r:5 ..... cf:4 ....... t:5 &rr_cf +@rr_cf_d ...... r:5 ..... cf:4 ...... d:1 t:5 &rr_cf_d @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf @rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d @rrr_cf_sh ...... r2:5 r1:5 cf:4 .... sh:2 . t:5 &rrr_cf_sh @@ -156,13 +156,13 @@ andcm 000010 ..... ..... .... 000000 . ..... @rrr_cf_d and 000010 ..... ..... .... 001000 . ..... @rrr_cf_d or 000010 ..... ..... .... 001001 . ..... @rrr_cf_d xor 000010 ..... ..... .... 001010 . ..... @rrr_cf_d -uxor 000010 ..... ..... .... 001110 0 ..... @rrr_cf +uxor 000010 ..... ..... .... 001110 . ..... @rrr_cf_d ds 000010 ..... ..... .... 010001 0 ..... @rrr_cf cmpclr 000010 ..... ..... .... 100010 0 ..... @rrr_cf -uaddcm 000010 ..... ..... .... 100110 0 ..... @rrr_cf -uaddcm_tc 000010 ..... ..... .... 100111 0 ..... @rrr_cf -dcor 000010 ..... 00000 .... 101110 0 ..... @rr_cf -dcor_i 000010 ..... 00000 .... 101111 0 ..... @rr_cf +uaddcm 000010 ..... ..... .... 100110 . ..... @rrr_cf_d +uaddcm_tc 000010 ..... ..... .... 100111 . ..... @rrr_cf_d +dcor 000010 ..... 00000 .... 101110 . ..... @rr_cf_d +dcor_i 000010 ..... 00000 .... 101111 . ..... @rr_cf_d add 000010 ..... ..... .... 0110.. - ..... @rrr_cf_sh add_l 000010 ..... ..... .... 1010.. 0 ..... @rrr_cf_sh diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 733d5fe067..c08156772a 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1423,12 +1423,11 @@ static bool do_log_reg(DisasContext *ctx, arg_rrr_cf_d *a, } static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, bool is_tc, + TCGv_reg in2, unsigned cf, bool d, bool is_tc, void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) { TCGv_reg dest; DisasCond cond; - bool d = false; if (cf == 0) { dest = dest_gpr(ctx, rt); @@ -2751,7 +2750,7 @@ static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf *a) return nullify_end(ctx); } -static bool trans_uxor(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_uxor(DisasContext *ctx, arg_rrr_cf_d *a) { TCGv_reg tcg_r1, tcg_r2; @@ -2760,11 +2759,11 @@ static bool trans_uxor(DisasContext *ctx, arg_rrr_cf *a) } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_unit(ctx, a->t, tcg_r1, tcg_r2, a->cf, false, tcg_gen_xor_reg); + do_unit(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d, false, tcg_gen_xor_reg); return nullify_end(ctx); } -static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf *a, bool is_tc) +static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tc) { TCGv_reg tcg_r1, tcg_r2, tmp; @@ -2775,21 +2774,21 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf *a, bool is_tc) tcg_r2 = load_gpr(ctx, a->r2); tmp = tcg_temp_new(); tcg_gen_not_reg(tmp, tcg_r2); - do_unit(ctx, a->t, tcg_r1, tmp, a->cf, is_tc, tcg_gen_add_reg); + do_unit(ctx, a->t, tcg_r1, tmp, a->cf, a->d, is_tc, tcg_gen_add_reg); return nullify_end(ctx); } -static bool trans_uaddcm(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a) { return do_uaddcm(ctx, a, false); } -static bool trans_uaddcm_tc(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_uaddcm_tc(DisasContext *ctx, arg_rrr_cf_d *a) { return do_uaddcm(ctx, a, true); } -static bool do_dcor(DisasContext *ctx, arg_rr_cf *a, bool is_i) +static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) { TCGv_reg tmp; @@ -2800,19 +2799,19 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf *a, bool is_i) if (!is_i) { tcg_gen_not_reg(tmp, tmp); } - tcg_gen_andi_reg(tmp, tmp, 0x11111111); + tcg_gen_andi_reg(tmp, tmp, (target_ureg)0x1111111111111111ull); tcg_gen_muli_reg(tmp, tmp, 6); - do_unit(ctx, a->t, load_gpr(ctx, a->r), tmp, a->cf, false, + do_unit(ctx, a->t, load_gpr(ctx, a->r), tmp, a->cf, a->d, false, is_i ? tcg_gen_add_reg : tcg_gen_sub_reg); return nullify_end(ctx); } -static bool trans_dcor(DisasContext *ctx, arg_rr_cf *a) +static bool trans_dcor(DisasContext *ctx, arg_rr_cf_d *a) { return do_dcor(ctx, a, false); } -static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf *a) +static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf_d *a) { return do_dcor(ctx, a, true); } From patchwork Fri Oct 20 20:42:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736304 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502018wrl; Fri, 20 Oct 2023 13:48:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt5QFRpeMgafL67CQdYHUHFqGCklpEbYgvAIncw33vTmUnceykn+PdwA/NuxPqX/ky6o0i X-Received: by 2002:a05:620a:9445:b0:76f:fe8:7ffd with SMTP id sm5-20020a05620a944500b0076f0fe87ffdmr2339379qkn.69.1697834895873; Fri, 20 Oct 2023 13:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834895; cv=none; d=google.com; s=arc-20160816; b=BTMqRpDI/zoGcjxALYNpcnr3DLIiYnKNw0OMnl6T7YlXDgCbhjFf9sxOM/W3kDmQvP UHKCiYpWpSBPyFoCIpkG95PGE43hzNyNh4qqEZc+sQYBiLZzRQgGD2WSBRKxMp2qshH1 4UlLR/JCVuXNs9ppiEoQGW8ob0atUqV/G7F7pL37+yhcv2IRNuqE/D/bfJMw6CwEymzh +44zH6Hz6BJJFu5FSYBeQiLMNILFYZOQWN5HtAXfld9LcdcYQ2qdF0n5Xv0KKv6wSlV8 XzjNNpWg7N2CFIdawKG22e/7ppCER/Fa/5jzyhBc3E2GRcCpVX64fiaszcH5RNNY7nKX BRdw== 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=RtqIFNm6JjPbDP1RVyPhidWGrmrDl/GX/xTGUiTer8g=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Z4lYx4yO1VAGPe18kW2JSjXxCKCBPwXIJTv0ntyEw+ksAgcLX8mgrCNeMzbZ904vxZ 3JWtlEfBDchhUo4g5BCLUpnWar8xS12m5OcKpRTuskfkQqSbGplKMRJWtgTLAK0REW4N tiMTHlbBTwjkYcsqH4J4TT+4nIFDH0eO4mJH/ANnDALBai58dU6N64m4kxHOm+N9eOi8 2O59Qhu0oKvLKEhz+TPTrbLd2XwzVgCOF200bhU2SAhwtExiJp2lsc/yIUmyHyyp+pIp lhAB9iwrd/t4lHz4Z+4eY/eLSv1wuOr5rouLma/OsncaMSrydJunoJfK0DZNIRlkcJvF Kthg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uA58pNXW; 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 3-20020a05620a048300b0077567358e2esi1823382qkr.561.2023.10.20.13.48.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:48:15 -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=uA58pNXW; 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 1qtwLw-0007um-An; Fri, 20 Oct 2023 16:44:16 -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 1qtwLm-0007m3-Sv for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLj-0008F4-Rp for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:06 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b20577ef7bso1113630b3a.3 for ; Fri, 20 Oct 2023 13:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834642; x=1698439442; 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=RtqIFNm6JjPbDP1RVyPhidWGrmrDl/GX/xTGUiTer8g=; b=uA58pNXWtD02Ng/+CnCHNGa8nkqbSOGJ0JssvAKCOulAfv/KIvtlmkBskGdudbTNj8 Y6GJvtGUUAwbYcTs7QTHZihMghEIhVEQE/oAjdPPrvB/Qwvht3xcsJHLs/3BfXRAllnP vtPiAuz+PD51XvnSdP+1Gsu/rj6BAfV//xBi0lpdHUHhcO/To3lQXvrJu2e/duQwm8mG NcewO0O7jjI4yExvQz7GLgLq6rYFku7ZvDhMaVbNe6NAaI665rg++UxuBvAZoLGQuF6X xPJ6bNSCRbyAS0qEpM9FsRgHaBxqQeludsp++OBLgIgC1CohlaxGmSBvuYzyHXh9IClx YNMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834642; x=1698439442; 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=RtqIFNm6JjPbDP1RVyPhidWGrmrDl/GX/xTGUiTer8g=; b=eTC3Ok0Akb++m3NEZnQkr+wCe39Hj69HTH/bnBHXQcjgrAObPlbF2HW0bDgOEKZi6P EwnaWdKU3vL6TyjWKeLcCqO6nVzHCpmekXT44dEQ9QzhkxNQZeszwu1JPWG+7K4l64Yv LTp5FNjFHwHfC0VPJNnkABNvAeQHecX+sL2BQQyyWJYDgcRznfBrJVZBoFAV8YQj7kf3 MRw9eORPlrPWATVZ6T3xealJ2dL2D2InaC9Iv3r4I8jzhOCYy3wdg6gLqWvjq7UlJn3l 6qzneGs+g2KmgPZeBxN6QVODPlZCu5eoN66ibD4oOPZrZjJe+cdhS9cAoehmtFqR3zHv t9hg== X-Gm-Message-State: AOJu0YwVaohVv/psKVN9KYj3vwb3IUd2bcuc+L3xb569SR4gr5mlqB+S Iu2cvvMiZMY0lUu+FqA8/E1viNOGKqkWqr4LKTk= X-Received: by 2002:a05:6a21:4982:b0:16b:80f2:f30c with SMTP id ax2-20020a056a21498200b0016b80f2f30cmr2655887pzc.26.1697834642154; Fri, 20 Oct 2023 13:44:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 32/65] target/hppa: Decode d for cmpclr instructions Date: Fri, 20 Oct 2023 13:42:58 -0700 Message-Id: <20231020204331.139847-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 6 ++++-- target/hppa/translate.c | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 03b1a11cac..d4a03b0299 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -64,6 +64,7 @@ &rrr_cf_d t r1 r2 cf d &rrr_cf_sh t r1 r2 cf sh &rri_cf t r i cf +&rri_cf_d t r i cf d &rrb_c_f disp n c f r1 r2 &rib_c_f disp n c f r i @@ -78,6 +79,7 @@ @rrr_cf_sh ...... r2:5 r1:5 cf:4 .... sh:2 . t:5 &rrr_cf_sh @rrr_cf_sh0 ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf_sh sh=0 @rri_cf ...... r:5 t:5 cf:4 . ........... &rri_cf i=%lowsign_11 +@rri_cf_d ...... r:5 t:5 cf:4 d:1 ........... &rri_cf_d i=%lowsign_11 @rrb_cf ...... r2:5 r1:5 c:3 ........... n:1 . \ &rrb_c_f disp=%assemble_12 @@ -158,7 +160,7 @@ or 000010 ..... ..... .... 001001 . ..... @rrr_cf_d xor 000010 ..... ..... .... 001010 . ..... @rrr_cf_d uxor 000010 ..... ..... .... 001110 . ..... @rrr_cf_d ds 000010 ..... ..... .... 010001 0 ..... @rrr_cf -cmpclr 000010 ..... ..... .... 100010 0 ..... @rrr_cf +cmpclr 000010 ..... ..... .... 100010 . ..... @rrr_cf_d uaddcm 000010 ..... ..... .... 100110 . ..... @rrr_cf_d uaddcm_tc 000010 ..... ..... .... 100111 . ..... @rrr_cf_d dcor 000010 ..... 00000 .... 101110 . ..... @rr_cf_d @@ -189,7 +191,7 @@ addi_tc_tsv 101100 ..... ..... .... 1 ........... @rri_cf subi 100101 ..... ..... .... 0 ........... @rri_cf subi_tsv 100101 ..... ..... .... 1 ........... @rri_cf -cmpiclr 100100 ..... ..... .... 0 ........... @rri_cf +cmpiclr 100100 ..... ..... .... . ........... @rri_cf_d #### # Index Mem diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c08156772a..4bc00d5bc6 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1364,11 +1364,10 @@ static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) } static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf) + TCGv_reg in2, unsigned cf, bool d) { TCGv_reg dest, sv; DisasCond cond; - bool d = false; dest = tcg_temp_new(); tcg_gen_sub_reg(dest, in1, in2); @@ -2737,7 +2736,7 @@ static bool trans_xor(DisasContext *ctx, arg_rrr_cf_d *a) return do_log_reg(ctx, a, tcg_gen_xor_reg); } -static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf_d *a) { TCGv_reg tcg_r1, tcg_r2; @@ -2746,7 +2745,7 @@ static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf *a) } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_cmpclr(ctx, a->t, tcg_r1, tcg_r2, a->cf); + do_cmpclr(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d); return nullify_end(ctx); } @@ -2904,7 +2903,7 @@ static bool trans_subi_tsv(DisasContext *ctx, arg_rri_cf *a) return do_sub_imm(ctx, a, true); } -static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf *a) +static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf_d *a) { TCGv_reg tcg_im, tcg_r2; @@ -2914,7 +2913,7 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf *a) tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); - do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf); + do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf, a->d); return nullify_end(ctx); } From patchwork Fri Oct 20 20:42:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736301 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501469wrl; Fri, 20 Oct 2023 13:46:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkH6EAAQOrEKxOTUUyZwBZWR1OTIjjcqreh2Mk82yCA8jCgRQm7aC6VqnRChknvyQ5kuZF X-Received: by 2002:ac8:5c91:0:b0:41c:70b2:32f9 with SMTP id r17-20020ac85c91000000b0041c70b232f9mr3268190qta.41.1697834792045; Fri, 20 Oct 2023 13:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834792; cv=none; d=google.com; s=arc-20160816; b=nMd4F1Wf6+YdAUsL26DWEf6e5d8gBy8LZmRYkuaWXf/PtQhibgVn5nQ5xoSSYGbkeu /NaQWzZkgvug+3Eab2S4HZffQ+HZGoV+SVF/oVVlNEbQbmlI6vwPdbsqqZHnH31lYOk1 HjiyGW5lxHaL4YH+fA9EAATd0Ox/ra2WQg3rnO1ZFTm9pc/Vb71wuNJXV+ESs5cRs9cg a+lsIoIsMaQM2moij40MSFuzM8Ck+2sDkEgTpHiHLrPjuwTp8EKoaJNf2Cn4Hd+dXfkv /tPqgSR97fYrtmDJjEWV+JD4SdTwtp5VrELKA5fd2AO8gBRLKcJWirOgxuBog9ZDner2 QrsA== 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=2JeCdTjUFelZDtYJkxk4+JkCKgCFCsm7hIEgLkt2x0I=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=1HHH5/46aq6cGbwppN9N/iOhr9VNfrhXUwLjIp3URfTCPfiofJd2RBOYQYR5/cd+Af NJCfkXUP1WOK5c//L0SJKvPgf6m870hG0Llx7zkzzRJAAc61Llf8pCQ8W85NCZUKgLpi 61woz8cAa+m5ujxSOO3JNok7AdPg5meAfU30c3BSo6j1heFnwhSlKXVlxA/bECJQcWxK lyqCZ2L7QGLiyWTQnHT3+BmXD6m+TVgqxGyFwdyz6EmcS0W1gaRz6pgCAraVNTVcH4Hq jtc8WH8QkwmHGwczoQPzOK14z1cTPCU6m2xCwup/ykyV/zRSC1c6UonTYPN7xqCrzLdF 8j+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wmf2dmzC; 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 u37-20020a05622a19a500b0041986eba0c3si1902863qtc.350.2023.10.20.13.46.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:46:32 -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=Wmf2dmzC; 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 1qtwM0-0007xK-RN; Fri, 20 Oct 2023 16:44:20 -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 1qtwLm-0007m2-Se for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLk-0008FZ-Ok for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:06 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b1e46ca282so1210381b3a.2 for ; Fri, 20 Oct 2023 13:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834643; x=1698439443; 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=2JeCdTjUFelZDtYJkxk4+JkCKgCFCsm7hIEgLkt2x0I=; b=Wmf2dmzCT8m0ijvJTFsuyYL/RsbpcIS2qkQEX+xQsz0Q9pLM987Imtu9Tdb8ZtRZeh QUxvVpTGagoMTdmaxhb6Pmv4DLxWrcrP+vuJkzFZw05ZKWfHwquyy8nlsD6DOUJZD7w+ 2tMNNEdn4+B29c6rAtru6c7+MlS1QOACSxoH3hUe4dc1RfZS6Fk2WJl6M0McJyS8mFFv TXMWmdFvWmH2McDfcYiZh5O4DrsjIbcquKQ7lzXBogN9OjzLmEAUTDBakYJAkLdIwien LJX8I5ahYPV9eBXJdYu/seCqGwhff3PILAJE5+zMDRutngqn+gChzyXJt0AofSwNR6r8 3sMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834643; x=1698439443; 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=2JeCdTjUFelZDtYJkxk4+JkCKgCFCsm7hIEgLkt2x0I=; b=iGPGtcMsCaQooQW2ZavAfA17B3wcKNoPHKZQXNIRF/YIJL+zAHTyT4rYc2e4aoQnBo e2bKEicOd67uv+TjoVK9jPeU1TMaaqVx6JAAQPnzucPqfjgWRr5zdQ/bpMOAubudJZpX nchXuwbcfVmyxFak9HJBLeJ8KS9LVCGtCiWdI6FqHOXV9tv3gfYZ0b4CBQJgUW2UDdy8 5tG0MTckyG8D/7yiKEtRzIAZQzX2V6J8+xNNLVC9lKAtzgonFOhOQToWtgYkmpUsDZ3h N9kqoVd/+YVN4wfzo1e57HXQFGZ9xekod1bW5piIe+FJVaafloXwoDFwW8jk62IzTWQl C5HQ== X-Gm-Message-State: AOJu0YzTu8BrBnvKZLnhdhYmYrSDDMgbxHzIaT5ErHKOz/BllwgyVYfi uSzfN73wC7huH3XKUgGv/e932z0mveDvF/vfFEE= X-Received: by 2002:a05:6a20:1453:b0:17b:2e82:d4ba with SMTP id a19-20020a056a20145300b0017b2e82d4bamr2870142pzi.3.1697834642963; Fri, 20 Oct 2023 13:44:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 33/65] target/hppa: Decode d for add instructions Date: Fri, 20 Oct 2023 13:42:59 -0700 Message-Id: <20231020204331.139847-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 16 ++++++++-------- target/hppa/translate.c | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index d4a03b0299..0f29869949 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -62,7 +62,7 @@ &rr_cf_d t r cf d &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d -&rrr_cf_sh t r1 r2 cf sh +&rrr_cf_d_sh t r1 r2 cf d sh &rri_cf t r i cf &rri_cf_d t r i cf d @@ -76,8 +76,8 @@ @rr_cf_d ...... r:5 ..... cf:4 ...... d:1 t:5 &rr_cf_d @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf @rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d -@rrr_cf_sh ...... r2:5 r1:5 cf:4 .... sh:2 . t:5 &rrr_cf_sh -@rrr_cf_sh0 ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf_sh sh=0 +@rrr_cf_d_sh ...... r2:5 r1:5 cf:4 .... sh:2 d:1 t:5 &rrr_cf_d_sh +@rrr_cf_d_sh0 ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d_sh sh=0 @rri_cf ...... r:5 t:5 cf:4 . ........... &rri_cf i=%lowsign_11 @rri_cf_d ...... r:5 t:5 cf:4 d:1 ........... &rri_cf_d i=%lowsign_11 @@ -166,11 +166,11 @@ uaddcm_tc 000010 ..... ..... .... 100111 . ..... @rrr_cf_d dcor 000010 ..... 00000 .... 101110 . ..... @rr_cf_d dcor_i 000010 ..... 00000 .... 101111 . ..... @rr_cf_d -add 000010 ..... ..... .... 0110.. - ..... @rrr_cf_sh -add_l 000010 ..... ..... .... 1010.. 0 ..... @rrr_cf_sh -add_tsv 000010 ..... ..... .... 1110.. 0 ..... @rrr_cf_sh -add_c 000010 ..... ..... .... 011100 0 ..... @rrr_cf_sh0 -add_c_tsv 000010 ..... ..... .... 111100 0 ..... @rrr_cf_sh0 +add 000010 ..... ..... .... 0110.. . ..... @rrr_cf_d_sh +add_l 000010 ..... ..... .... 1010.. . ..... @rrr_cf_d_sh +add_tsv 000010 ..... ..... .... 1110.. . ..... @rrr_cf_d_sh +add_c 000010 ..... ..... .... 011100 . ..... @rrr_cf_d_sh0 +add_c_tsv 000010 ..... ..... .... 111100 . ..... @rrr_cf_d_sh0 sub 000010 ..... ..... .... 010000 - ..... @rrr_cf sub_tsv 000010 ..... ..... .... 110000 0 ..... @rrr_cf diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4bc00d5bc6..50be7df76c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1173,12 +1173,11 @@ static TCGv_reg do_sub_sv(DisasContext *ctx, TCGv_reg res, static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, TCGv_reg in2, unsigned shift, bool is_l, - bool is_tsv, bool is_tc, bool is_c, unsigned cf) + bool is_tsv, bool is_tc, bool is_c, unsigned cf, bool d) { TCGv_reg dest, cb, cb_msb, cb_cond, sv, tmp; unsigned c = cf >> 1; DisasCond cond; - bool d = false; dest = tcg_temp_new(); cb = NULL; @@ -1243,7 +1242,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, ctx->null_cond = cond; } -static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_sh *a, +static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_d_sh *a, bool is_l, bool is_tsv, bool is_tc, bool is_c) { TCGv_reg tcg_r1, tcg_r2; @@ -1253,7 +1252,8 @@ static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_sh *a, } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_add(ctx, a->t, tcg_r1, tcg_r2, a->sh, is_l, is_tsv, is_tc, is_c, a->cf); + do_add(ctx, a->t, tcg_r1, tcg_r2, a->sh, is_l, + is_tsv, is_tc, is_c, a->cf, a->d); return nullify_end(ctx); } @@ -1267,7 +1267,8 @@ static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, } tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); - do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf); + /* All ADDI conditions are 32-bit. */ + do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf, false); return nullify_end(ctx); } @@ -2614,27 +2615,27 @@ static bool trans_lci(DisasContext *ctx, arg_lci *a) return true; } -static bool trans_add(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, false, false, false, false); } -static bool trans_add_l(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add_l(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, true, false, false, false); } -static bool trans_add_tsv(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add_tsv(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, false, true, false, false); } -static bool trans_add_c(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add_c(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, false, false, false, true); } -static bool trans_add_c_tsv(DisasContext *ctx, arg_rrr_cf_sh *a) +static bool trans_add_c_tsv(DisasContext *ctx, arg_rrr_cf_d_sh *a) { return do_add_reg(ctx, a, false, true, false, true); } From patchwork Fri Oct 20 20:43:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736296 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501290wrl; Fri, 20 Oct 2023 13:45:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7GWVzVB8k2FlC6Mx/ElAxtesefFxytwZ4jT8PxdKqmZH4h5evnWWGMcEQxg5AeIeXj5u6 X-Received: by 2002:a05:6214:20e6:b0:66d:1624:2200 with SMTP id 6-20020a05621420e600b0066d16242200mr2720256qvk.13.1697834750014; Fri, 20 Oct 2023 13:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834750; cv=none; d=google.com; s=arc-20160816; b=DQH8sHNT9fF4mA2dadX8FfsTvKvz5eGnI0jiTaSa+i/jI3UvXAWfZun0XG4mqglJkX 97qBzseXUWIGB3KJ2NvEOV9c6JEz1NIiUn7gqm2xMzfDDYgTNtyg0ZgFML7wGS8DgFK0 +WB++LHqykoB/QK0evhOGj1K1ZLSHe5N3XljRAtzmv3VvjxZkcnf4j2vu4R1LiviLBEA 26OGijp6pUCKKuZ62oLiSVCUUnIyyyXmuUwW388NJiSrDa7XzihV3/EZpAlheno90HsO w7duLbhnfM2dSjh4sVWz5D2jBB6Nnez998og10V9+tOA7WJJ7HyE2KoKwMT3o4mrMXJQ xsuA== 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=ObJx9R3yQ+h7Sn6gc+ZiKm70o/Xu9BpZYR8uMzdovJM=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=gieKjL2vuJ1T54bZip5Rshr6Lb/umDoq90e4DfL7hQQBjwvnxnyeS+IVbP1V+qJuI2 tx1AKgppFBdTpsXxTyUPHIGbOWpr/OwMIIT1/Ywtc/yO016ccZT053W8NWqZ+CxcTl51 thSmgN1+SpM961Juq9GFexXnnFGuo7BjCdxlOiA9aNfOSVlVFjFc+HIgelYJJMpqN0hD 4vzpqo6IJ7KKjIMHTX8QBCpnpUFXLdBnmFSMUd8N+vcAGHoT1B80h3c1CvS+JmRmFYQF VmF1qBWQXe8K+NqL9kUTa+nl1OIMtWmXGIUVHCUtH83CHRiYArbc+d+pbo2bUIH+uOVE /xDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UZeZdT0S; 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 bo2-20020a05621414a200b0064c84ce3e14si1959494qvb.72.2023.10.20.13.45.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:45:49 -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=UZeZdT0S; 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 1qtwM4-0007yS-At; Fri, 20 Oct 2023 16:44:24 -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 1qtwLo-0007mI-7E for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLm-0008Fs-1n for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:07 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6b1ef786b7fso1158017b3a.3 for ; Fri, 20 Oct 2023 13:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834643; x=1698439443; 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=ObJx9R3yQ+h7Sn6gc+ZiKm70o/Xu9BpZYR8uMzdovJM=; b=UZeZdT0SL6Z4pnZGvumKS5+J9vgcCojhoHs4pO0o1CMmDAS99ZC/WaeM2+ar1ocZpA d9ECzerkBnRsq33UvRiCl/Tmr1LR8PJ9msy/D8YLFZ542E6pajdrze8VatwVvHdls9n+ vfiVqwFTLkFA3UM7KnmKypFQ9HO3rdSKhwbCmaeC5QaXcmIK29Puto2bki4dhKZhoGLg NeIB15jmGhUvUyTXp8cWY2v7hhdJPBbFJ7z5jR5bGKz0moPbFDNmZqX2Lu6AC0QRJID5 qbJ/5Quq8nhSg8+ccrL2ygG4q9dHNYDXM1stc3OH1F3PrB4hmrhpuIQiaHvYsqkzWeXR 23ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834643; x=1698439443; 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=ObJx9R3yQ+h7Sn6gc+ZiKm70o/Xu9BpZYR8uMzdovJM=; b=lrTwo/w+p97pGj98o86VOfCwZefxVcrlib5U1W8tVc7Hp5Qm4wdF5poNOHYaCvoerl b2AVtXX1l3j0YAoT54yudAgMMN1DCl5berg32JBOJZ5jhpeNRzPyII06v/R/Hc6+zmRk ZAUQ3HA/0L/2lHZxayhkP8GbTsJYn4m0SarFw3fOMsF4Sw8UCx7j2T3lXw/rmlDqdD/l Bsob3Lvoq3w0E5jhdwiDh0YDOQ4tbM2Ja8FJn9/C8rJAMxC1cjDxyBMLEVcByML2lpJO 4ZXmm2KiED5SR4SDEIofrI7Nmmt4EDiHYpdTLbKYawQwCAhfNcuA1WwdtYeAnBAvxBlU ezrQ== X-Gm-Message-State: AOJu0YxYGpRGOLPU0+W0xJ3XJmzHKctBcXeWM3D7KaYypZ0isetbL0eO 8H62w3xoCwm/tmNK1/yVGDu3tIERsXfHs1tbdWI= X-Received: by 2002:a05:6a20:4c95:b0:16b:c9f2:b632 with SMTP id fq21-20020a056a204c9500b0016bc9f2b632mr2476251pzb.62.1697834643675; Fri, 20 Oct 2023 13:44:03 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 34/65] target/hppa: Decode d for sub instructions Date: Fri, 20 Oct 2023 13:43:00 -0700 Message-Id: <20231020204331.139847-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 12 ++++++------ target/hppa/translate.c | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 0f29869949..ad454adcbb 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -172,12 +172,12 @@ add_tsv 000010 ..... ..... .... 1110.. . ..... @rrr_cf_d_sh add_c 000010 ..... ..... .... 011100 . ..... @rrr_cf_d_sh0 add_c_tsv 000010 ..... ..... .... 111100 . ..... @rrr_cf_d_sh0 -sub 000010 ..... ..... .... 010000 - ..... @rrr_cf -sub_tsv 000010 ..... ..... .... 110000 0 ..... @rrr_cf -sub_tc 000010 ..... ..... .... 010011 0 ..... @rrr_cf -sub_tsv_tc 000010 ..... ..... .... 110011 0 ..... @rrr_cf -sub_b 000010 ..... ..... .... 010100 0 ..... @rrr_cf -sub_b_tsv 000010 ..... ..... .... 110100 0 ..... @rrr_cf +sub 000010 ..... ..... .... 010000 . ..... @rrr_cf_d +sub_tsv 000010 ..... ..... .... 110000 . ..... @rrr_cf_d +sub_tc 000010 ..... ..... .... 010011 . ..... @rrr_cf_d +sub_tsv_tc 000010 ..... ..... .... 110011 . ..... @rrr_cf_d +sub_b 000010 ..... ..... .... 010100 . ..... @rrr_cf_d +sub_b_tsv 000010 ..... ..... .... 110100 . ..... @rrr_cf_d ldil 001000 t:5 ..................... i=%assemble_21 addil 001010 r:5 ..................... i=%assemble_21 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 50be7df76c..df5a6dc896 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1274,12 +1274,11 @@ static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, TCGv_reg in2, bool is_tsv, bool is_b, - bool is_tc, unsigned cf) + bool is_tc, unsigned cf, bool d) { TCGv_reg dest, sv, cb, cb_msb, zero, tmp; unsigned c = cf >> 1; DisasCond cond; - bool d = false; dest = tcg_temp_new(); cb = tcg_temp_new(); @@ -1337,7 +1336,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, ctx->null_cond = cond; } -static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf *a, +static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tsv, bool is_b, bool is_tc) { TCGv_reg tcg_r1, tcg_r2; @@ -1347,7 +1346,7 @@ static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf *a, } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_sub(ctx, a->t, tcg_r1, tcg_r2, is_tsv, is_b, is_tc, a->cf); + do_sub(ctx, a->t, tcg_r1, tcg_r2, is_tsv, is_b, is_tc, a->cf, a->d); return nullify_end(ctx); } @@ -1360,7 +1359,8 @@ static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) } tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); - do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf); + /* All SUBI conditions are 32-bit. */ + do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf, false); return nullify_end(ctx); } @@ -2640,32 +2640,32 @@ static bool trans_add_c_tsv(DisasContext *ctx, arg_rrr_cf_d_sh *a) return do_add_reg(ctx, a, false, true, false, true); } -static bool trans_sub(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, false, false, false); } -static bool trans_sub_tsv(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_tsv(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, true, false, false); } -static bool trans_sub_tc(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_tc(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, false, false, true); } -static bool trans_sub_tsv_tc(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_tsv_tc(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, true, false, true); } -static bool trans_sub_b(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_b(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, false, true, false); } -static bool trans_sub_b_tsv(DisasContext *ctx, arg_rrr_cf *a) +static bool trans_sub_b_tsv(DisasContext *ctx, arg_rrr_cf_d *a) { return do_sub_reg(ctx, a, true, true, false); } From patchwork Fri Oct 20 20:43:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736298 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501428wrl; Fri, 20 Oct 2023 13:46:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2n+rZX7PJ6r5wVydjdlYoHqxtR449e118bXLgU0mICoU4026WqF9jJlmNFrzUo+NYzLis X-Received: by 2002:ac8:5ad2:0:b0:419:9975:8096 with SMTP id d18-20020ac85ad2000000b0041999758096mr3920746qtd.49.1697834783205; Fri, 20 Oct 2023 13:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834783; cv=none; d=google.com; s=arc-20160816; b=ioe0m+v1+m4HRAB/u/xOgJx5HgPx/boYWsvdkMFIcP9G/LQz3dhiPq9PPXUs3IOrJW OQL2c6KElSFQhQKerCHs1rGi+eZlB7haQQHDh5mImTw5isFrP/Dhg/IiRNPcXxX+tg43 X0hsPgz3pKnqcP7spNmZ0jONRnoA67ktrLMVRtJaj5cUcPnxISTImFyHthPo7UmG4YzV Ec6UE8cx/AgneyJTaVGIPEex/UnWCgZnS+oDi8S7loiwaHCO1LYHz6ieReY5JfCcxJit +MR2XAhv035mCDvO1jwD2pbtzr623rdLhbOWKlP1ucZWamae9bS6zpKNI1mwI80tmKEH ZE0A== 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=cvByl24MJI51YSIY+m9lpJLCF2jw0swZvW6LzKcbRvs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=dzjytgnQKwfgF6D5aFsSwLMX/SR5mGQBpeSQPL9yQMe+pRAoTgLqVzFxXNK1LLFP8W qURItZAjQsIVGZWQvgykD5HrNLMbheY4c4myrLAeX6Gt1YguOIxe/lPhnm8qgT9jvspc 0wxWk7PjUgtXVTC+idruHbStEzAun+zFBtuiQBAvtwlUFwxLDNbL7T70OTH881Xx7aCk fipjVZN1i5rm7fjKmWWKW8Veu/zC3xNLfSvtOpn++waczG9eUAe9MB82v57nNgTMq40t pL9heg540O60JTKK7egTqVcIGecGdOcWJuoKwmYGbQgApBlCv/vZBQg5aUeoPW7LBzSX koGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PJOyGoQg; 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 h8-20020ac85848000000b0041811753adbsi1945628qth.342.2023.10.20.13.46.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:46:23 -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=PJOyGoQg; 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 1qtwM3-0007yM-3K; Fri, 20 Oct 2023 16:44:23 -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 1qtwLo-0007mG-4O for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLm-0008GK-23 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:07 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6b201a93c9cso1115421b3a.0 for ; Fri, 20 Oct 2023 13:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834644; x=1698439444; 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=cvByl24MJI51YSIY+m9lpJLCF2jw0swZvW6LzKcbRvs=; b=PJOyGoQg9v1GTcdg20QkrBUd9+Myezkva+gQbJPi4ybeMfpcL/aIUySjSFa4a7pmQb TYk+itaCO6Ttuz9MTSqF9MkzcB4dLBKZq3W6N9P1wIWVUzmOTOdBhA2NFfpAjbMdYsR8 3x4jJvHhNk0iPo52hR2DWz/i8zfNHiyHTNN2381uDVY0ZMB16eL1og0b9tsL7HxmlR0h 65LlDw83Ifm9B60AKVH8OB7bX2WX4g6yahfRFy+r4U01IRHcDQe2e4VzdJ0ayqEMMQUj HAKjVInuFAT6PDp02knnw4Npv6fSVeBI9/KYv388JGDZ0Fc+uLCWoVzrL05i+YFrIzQC qSOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834644; x=1698439444; 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=cvByl24MJI51YSIY+m9lpJLCF2jw0swZvW6LzKcbRvs=; b=rZjwTs+xHNz6fBvEzJPsycMZJyuCDhbn59PzcVc6YRpXnD5fx4GSFRvaiG4S9l/3kB hf1DLka2yAeV8dFqwKEDVWCNJdTlFXPaWvCwe+TZUHpLOmHrMpHAkIF3hrsxUEOzWz/c 7W6L7p+/jPoqqEbGNvgufYOzKqy5hQk4rTlv22uqgS8+VmgcBWg66qQ0MIO6+xvUMOsZ LlnCPhDTu4QBeckTrPC5+/bZcfr8aCJesq3xkgqACoYNH9q1SJmevjBkn6Aee0/Lvinh XpaP3aeMetB5PVN2Ch2oT8+83aBzUfM/V7fjWlh+WclTGm2uK3HucN1Cm9bhtnRNdCYb gMoQ== X-Gm-Message-State: AOJu0YxZMQHk3dpEOQLt75WDAglKgnabhMTcxuVHNxIGqQwit24nnvPN 2nTocYYu5Q/XaaKUAqlffobKoqbn8Oon3gV31yY= X-Received: by 2002:a05:6a20:8f01:b0:15e:2d9f:cae0 with SMTP id b1-20020a056a208f0100b0015e2d9fcae0mr3309955pzk.10.1697834644636; Fri, 20 Oct 2023 13:44:04 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 35/65] target/hppa: Decode d for bb instructions Date: Fri, 20 Oct 2023 13:43:01 -0700 Message-Id: <20231020204331.139847-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 Manipulate the shift count so that the bit to be tested is always placed at the MSB. Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 4 ++-- target/hppa/translate.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index ad454adcbb..b185523021 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -290,8 +290,8 @@ fmpysub_d 100110 ..... ..... ..... ..... 1 ..... @mpyadd # Conditional Branches #### -bb_sar 110000 00000 r:5 c:1 10 ........... n:1 . disp=%assemble_12 -bb_imm 110001 p:5 r:5 c:1 10 ........... n:1 . disp=%assemble_12 +bb_sar 110000 00000 r:5 c:1 1 d:1 ........... n:1 . disp=%assemble_12 +bb_imm 110001 p:5 r:5 c:1 1 d:1 ........... n:1 . disp=%assemble_12 movb 110010 ..... ..... ... ........... . . @rrb_cf f=0 movbi 110011 ..... ..... ... ........... . . @rib_cf f=0 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index df5a6dc896..543a694724 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3151,13 +3151,12 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) { TCGv_reg tmp, tcg_r; DisasCond cond; - bool d = false; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - if (cond_need_ext(ctx, d)) { + if (cond_need_ext(ctx, a->d)) { /* Force shift into [32,63] */ tcg_gen_ori_reg(tmp, cpu_sar, 32); tcg_gen_shl_reg(tmp, tcg_r, tmp); @@ -3173,14 +3172,13 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) { TCGv_reg tmp, tcg_r; DisasCond cond; - bool d = false; int p; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - p = a->p | (cond_need_ext(ctx, d) ? 32 : 0); + p = a->p | (cond_need_ext(ctx, a->d) ? 32 : 0); tcg_gen_shli_reg(tmp, tcg_r, p); cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); From patchwork Fri Oct 20 20:43:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736300 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501434wrl; Fri, 20 Oct 2023 13:46:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENLKB/tKWjKeG3WXl3Xz4M/5bU5yQHfgRHqrjYq0sUYlxq6fV0XjaSy1vpml9LbtYjJl7g X-Received: by 2002:a05:622a:1009:b0:41c:df99:47bf with SMTP id d9-20020a05622a100900b0041cdf9947bfmr1776490qte.30.1697834784592; Fri, 20 Oct 2023 13:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834784; cv=none; d=google.com; s=arc-20160816; b=lIJ/dBkVYWCU/T46+dufb/ij/T2VdpK9fraNSvgU0e0nfBs36Lqu4aW9Hd85PkNDHl T2xnz6SV77G1e6hrEGqXofL+hmGOG1M6r/f9p6JVrYfJaSysQ1Z2cyYJmmPe0YdV2d5j NcTAiCspdtjf6FKT1y1d3GwZv4iSr8Rx1ZPccVD4nAj4Wg0oSBtT9BPHXSA4+6K6nMuu YZdTxNCcqZ+tQfD6RZHqccU9eZld4fyD4AKlocIDi4VNMOcnnVzzgBG6rXv3OIJjIxmZ QuNZmAIhfL+jvt9MVVN4FFhZtVOHUqRZXlgK/+nhziL8uOCtf3/aSOBIPGmCbwuRYKfX q+Zg== 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=kXqbl0J9UOFpqWT8nVVjfRWDi4TXJT7ar8Epjag9g10=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=QWNFUAJiV8P5num5sbS7bqfZwCwaCMfHR1DEfZ65UQn2wLXN02CbwPoc7z1wDTG07z ShBW41lJsycFZYH7Cjm0jVQsmNhL/Mjjo79n7nmBzxmEpC1WFQAWI/DCRHN7HuWoVxp+ KodykMq9pIKcmC/viHiHLjyq4MN2nWJC81C5D4WTbGgI2BSzALvbkvKFTnodkZ2atIIe /Zt1oN5wCY7taDBUU38nvMq9lTnuJJlhgJyKDjYgPgNfZZQrj3KJN49J0r+favR7AT/i w4qO3MChEg4ncTKaR867uLYxW/jvbh0zqlK7dqOIZjJzGK1Idjt2EUmw0XrEBttVDANX dqHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zVkzk24S; 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 j17-20020ac85f91000000b004181b434f3esi1948028qta.147.2023.10.20.13.46.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:46:24 -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=zVkzk24S; 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 1qtwM6-00084f-By; Fri, 20 Oct 2023 16:44:26 -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 1qtwLt-0007pN-3e for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:13 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLm-0008Gj-LW for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:12 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6ba172c5f3dso1170059b3a.0 for ; Fri, 20 Oct 2023 13:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834645; x=1698439445; 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=kXqbl0J9UOFpqWT8nVVjfRWDi4TXJT7ar8Epjag9g10=; b=zVkzk24S7hNOUu5xMiQtXnOG7dCA0KBhspZoMQLPfEYJVt08g3hmrlpDOxc2E/XX/0 3zXF83AdAjsgkL9heMDdtTyXn64xVGrX1ueLZ/Qkbeyr6xQyFsMLl2ZpjuZnsSD7q9IJ bBx/LCerw2WSFpm2kB8DDhAfUqhDjQc0r9d7DkzH9GrYukYoidfULTjJ45wAfiWEJqGD WbIE+peIZKO4Hu2zElLiQtudM1q2UaCdI+2Mf5tXkt/glN2FxeIKwatcLo8WpAhK6jBu inO469X9oRKukM0XVsuPz1ctZh8ccqK7ALEwk7ErZymRlMp8QIAc6jj9BkPdgNZ2vYR+ hZpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834645; x=1698439445; 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=kXqbl0J9UOFpqWT8nVVjfRWDi4TXJT7ar8Epjag9g10=; b=oqbueXr3JN+vHA25gbj3nRi9DN7PQvp2hVdV8T143+Yxr/6xXbbsFpk7qlooMxO6Qj HBlIjM/kocZQ6iufSWb4zu/OxTPfWrqX5sZD+etUxpzA5mn9yAAHAAErc4URfj6Qau2n yDbcIh2UIIyiwgfKF6MjXPiiFMKslqfP3b9/Pn9Ca+YTUGKxm09nRJPWaNYxvr4Y5usO aJ+vPmFBCXzyrfTCZ1O6hTvO6o6Ig4fxYZMqdxspRBWhjGbG4rXPOvUc6kTwsklO83Bi 3UjVvja/MyS3Oppw9j0yGIoYEfKOPRJvvsqTFrU/ytqYI4oTzkqg8K1yBhe5X++Q+pld OXyQ== X-Gm-Message-State: AOJu0Yyc+ygAritTBNlK47HwUnYfaXuLEKZlshGD3kZ5il1sV6VmeFOc ws0MD5Gn9k9JDamQDBDIWc1FRN2mOSAtqD+K8Lk= X-Received: by 2002:a05:6a00:a13:b0:6b2:6835:2a82 with SMTP id p19-20020a056a000a1300b006b268352a82mr2987648pfh.13.1697834645400; Fri, 20 Oct 2023 13:44:05 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 36/65] target/hppa: Decode d for cmpb instructions Date: Fri, 20 Oct 2023 13:43:02 -0700 Message-Id: <20231020204331.139847-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 9 +++++++-- target/hppa/translate.c | 12 ++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index b185523021..fc327e2bb3 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -67,6 +67,7 @@ &rri_cf_d t r i cf d &rrb_c_f disp n c f r1 r2 +&rrb_c_d_f disp n c d f r1 r2 &rib_c_f disp n c f r i #### @@ -83,6 +84,8 @@ @rrb_cf ...... r2:5 r1:5 c:3 ........... n:1 . \ &rrb_c_f disp=%assemble_12 +@rrb_cdf ...... r2:5 r1:5 c:3 ........... n:1 . \ + &rrb_c_d_f disp=%assemble_12 @rib_cf ...... r:5 ..... c:3 ........... n:1 . \ &rib_c_f disp=%assemble_12 i=%im5_16 @@ -296,8 +299,10 @@ bb_imm 110001 p:5 r:5 c:1 1 d:1 ........... n:1 . disp=%assemble_12 movb 110010 ..... ..... ... ........... . . @rrb_cf f=0 movbi 110011 ..... ..... ... ........... . . @rib_cf f=0 -cmpb 100000 ..... ..... ... ........... . . @rrb_cf f=0 -cmpb 100010 ..... ..... ... ........... . . @rrb_cf f=1 +cmpb 100000 ..... ..... ... ........... . . @rrb_cdf d=0 f=0 +cmpb 100010 ..... ..... ... ........... . . @rrb_cdf d=0 f=1 +cmpb 100111 ..... ..... ... ........... . . @rrb_cdf d=1 f=0 +cmpb 101111 ..... ..... ... ........... . . @rrb_cdf d=1 f=1 cmpbi 100001 ..... ..... ... ........... . . @rib_cf f=0 cmpbi 100011 ..... ..... ... ........... . . @rib_cf f=1 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 543a694724..d1d9a4a137 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3070,11 +3070,10 @@ static bool trans_ldo(DisasContext *ctx, arg_ldo *a) } static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, - unsigned c, unsigned f, unsigned n, int disp) + unsigned c, unsigned f, bool d, unsigned n, int disp) { TCGv_reg dest, in2, sv; DisasCond cond; - bool d = false; in2 = load_gpr(ctx, r); dest = tcg_temp_new(); @@ -3092,14 +3091,19 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a) { + if (!ctx->is_pa20 && a->d) { + return false; + } nullify_over(ctx); - return do_cmpb(ctx, a->r2, load_gpr(ctx, a->r1), a->c, a->f, a->n, a->disp); + return do_cmpb(ctx, a->r2, load_gpr(ctx, a->r1), + a->c, a->f, a->d, a->n, a->disp); } static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) { nullify_over(ctx); - return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); + return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), + a->c, a->f, false, a->n, a->disp); } static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, From patchwork Fri Oct 20 20:43:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736302 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp501520wrl; Fri, 20 Oct 2023 13:46:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJm6XBv1Dw4WLaf+1rYepLvixQvYueVqg3sdVvEUcroh2Sm3azGz5lbC31rwTqqpxfdSAr X-Received: by 2002:a05:622a:92:b0:419:5b6c:be62 with SMTP id o18-20020a05622a009200b004195b6cbe62mr3104580qtw.4.1697834801037; Fri, 20 Oct 2023 13:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834801; cv=none; d=google.com; s=arc-20160816; b=AYgtb5z6n0vNZTKU4KRWzf4r/AcXN+Txucf0GIb9hsjHxvmkAb6XLEuM5CGNLxfzYU pbpGiZu2bUZVzuFiDd+C6ZGLpcwvI4Xpd7mZKTy1hkfNxgkMMYsUD5v+wLEBnkRxk7OU RT6/shrPFlkWPZKY8PbvceLEiu6N/2i0o/6ZqWQkXx9Un4PTSqIPFzRL/V7KtVX0v1Q+ lt4q1vgBUeLu0XGMJ2qqzQH0o+Vu6XDTOrrTqLG1nAD8mkwYaH7VupcpSFX5vbe8P+Pz HqK3Of+FkEJbd2XXaX8wlLEEZdstGuC6YYuXKT3r9xscVJoGX4G1A65pZDUtGnhVrwSE i8aQ== 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=9Y0TWqbSJ7897PJsLkdK8seC1JV+I54PI/WHM1mCLlw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=piM7jKa+dFIEdgWb1C0EBeg/0GDAjMu8QPnkGCqKXaZW90q5A7hOU2ZGEaG7a6+MZw EgKgUtwCoPNRIAKWZTLnuRa13Jz2NQyKEJEK9FIHEt4IaAMmMTL8iw6c3enZk5Uvg2fI xl9wBwUVNy6qR0k5XdvFYWVTHyLNyzv9X16i16NZqrTYyCCHS7Ef6uwJDR+yGDxxPIDv 2d7RTt9V7M0ZrjeNjw6kOF3/4SNuyfM2mF9ZFAqHTeGOB3+xTnDHpWNackzkccXhdh1F pkArOdBXLaV+4rHTAmMUwBY2ixYeTG36sNx+bXq6ZL7d/m0YsjVRokhLwbHkbF6uUbrx GNNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I9rivRQQ; 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 l16-20020a05622a175000b0040551209eb5si1933848qtk.585.2023.10.20.13.46.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:46:41 -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=I9rivRQQ; 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 1qtwM3-0007yQ-Kq; Fri, 20 Oct 2023 16:44:23 -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 1qtwLp-0007mM-IJ for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLn-0008Gr-Js for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:09 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6b7f0170d7bso1160115b3a.2 for ; Fri, 20 Oct 2023 13:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834646; x=1698439446; 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=9Y0TWqbSJ7897PJsLkdK8seC1JV+I54PI/WHM1mCLlw=; b=I9rivRQQL2ByoK9jUSheD/9LkC29beFLKI9tAD3om2+tsEsGYeFVPl0biChVXo7Ov1 t7vmi/OjoZbbbPEuHcG1JJ4lO8EwAOj8BCofULZLYWUUJXVID1qeuXci1uor1fZPW3lp sFgw+wRzZ4FFWuXKpnhXEUyf3WUzGHaWEFuuXEajY5djdLDKsQCIhQ4Gb195CEdkfdSP C32X+Yvb+z3GLloge9xXrkFWXgEgiwDTcjSn0u1AgcMbd47fX7PKaE01EtM821LKBCm+ 0SAXBMOOFuoiXauKIUiEapgFoeYcDobP3kjLLPP3z2BgAGrwlzyWWsRw0aGLImm5xHfD NTfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834646; x=1698439446; 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=9Y0TWqbSJ7897PJsLkdK8seC1JV+I54PI/WHM1mCLlw=; b=TSnuwwBF6fCNr3EDTB+5FaZ/pjSs4M7JqCY4cgT6W0ZpK2aQfKU2Z2k+gvFAtsmSFT gofWBrOEghyO8EDbqwjD/h5BTrwpg9NocPFIl0B5omIWfe2n6GDHzfy1rJ+/d4F7LaQT vNaRy+FNXhdw+AkaWau5wpVz4AjgMEsgoaZJ/q066M/TSM3PQfsscC3FSKRr29gjvf0l suqkX5mT0AlFQVThvUl8LhIp9Ejo7j59tju69bmZ72u658+PsVnqU5V8cXElEA/Ih12h t/t26iez0Tlk5hHedmuV91OQzNEJ6SG2HzueZrPvkNw4YYcPkVJK2bFJ+h1g1p5+fyW6 tw8g== X-Gm-Message-State: AOJu0YyWDMlMzuX45B8L7pKQX2OxWEh92ClroOllGny/zYjK0qDy1bok 5M7qaTVnJvsCa1IFuY0EI8dHaZNQ6i+WxqAnXeU= X-Received: by 2002:a05:6a00:812:b0:6b5:6c95:4671 with SMTP id m18-20020a056a00081200b006b56c954671mr3184314pfk.34.1697834646200; Fri, 20 Oct 2023 13:44:06 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 37/65] target/hppa: Decode CMPIB double-word Date: Fri, 20 Oct 2023 13:43:03 -0700 Message-Id: <20231020204331.139847-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 10 ++++++++-- target/hppa/translate.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index fc327e2bb3..48f09c9b06 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -51,6 +51,7 @@ %pos_to_m 0:1 !function=pos_to_m %neg_to_m 0:1 !function=neg_to_m %a_to_m 2:1 !function=neg_to_m +%cmpbid_c 13:2 !function=cmpbid_c #### # Argument set definitions @@ -69,6 +70,7 @@ &rrb_c_f disp n c f r1 r2 &rrb_c_d_f disp n c d f r1 r2 &rib_c_f disp n c f r i +&rib_c_d_f disp n c d f r i #### # Format definitions @@ -88,6 +90,8 @@ &rrb_c_d_f disp=%assemble_12 @rib_cf ...... r:5 ..... c:3 ........... n:1 . \ &rib_c_f disp=%assemble_12 i=%im5_16 +@rib_cdf ...... r:5 ..... c:3 ........... n:1 . \ + &rib_c_d_f disp=%assemble_12 i=%im5_16 #### # System @@ -303,8 +307,10 @@ cmpb 100000 ..... ..... ... ........... . . @rrb_cdf d=0 f=0 cmpb 100010 ..... ..... ... ........... . . @rrb_cdf d=0 f=1 cmpb 100111 ..... ..... ... ........... . . @rrb_cdf d=1 f=0 cmpb 101111 ..... ..... ... ........... . . @rrb_cdf d=1 f=1 -cmpbi 100001 ..... ..... ... ........... . . @rib_cf f=0 -cmpbi 100011 ..... ..... ... ........... . . @rib_cf f=1 +cmpbi 100001 ..... ..... ... ........... . . @rib_cdf d=0 f=0 +cmpbi 100011 ..... ..... ... ........... . . @rib_cdf d=0 f=1 +cmpbi 111011 r:5 ..... f:1 .. ........... n:1 . \ + &rib_c_d_f d=1 disp=%assemble_12 c=%cmpbid_c i=%im5_16 addb 101000 ..... ..... ... ........... . . @rrb_cf f=0 addb 101010 ..... ..... ... ........... . . @rrb_cf f=1 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d1d9a4a137..bb55718a4d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -329,6 +329,12 @@ static int expand_shl11(DisasContext *ctx, int val) return val << 11; } +/* Translate CMPI doubleword conditions to standard. */ +static int cmpbid_c(DisasContext *ctx, int val) +{ + return val ? val : 4; /* 0 == "*<<" */ +} + /* Include the auto-generated decoder. */ #include "decode-insns.c.inc" @@ -3101,9 +3107,12 @@ static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a) static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) { + if (!ctx->is_pa20 && a->d) { + return false; + } nullify_over(ctx); return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), - a->c, a->f, false, a->n, a->disp); + a->c, a->f, a->d, a->n, a->disp); } static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, From patchwork Fri Oct 20 20:43:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736351 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp504228wrl; Fri, 20 Oct 2023 13:56:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcb7fNHuI6F83bquKIelrH/i8MwcfaOa9J2HXvQSmyG4x9eUXKJJdq+G2xZIN1qNRpLPBT X-Received: by 2002:a05:620a:3185:b0:774:17fe:5820 with SMTP id bi5-20020a05620a318500b0077417fe5820mr9045199qkb.21.1697835383305; Fri, 20 Oct 2023 13:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835383; cv=none; d=google.com; s=arc-20160816; b=EIqjPIWafBRKjXw3bndmMwIj+TMoxk2NrVzoZlLBk60D8a6Pl1/c98j+kxer8gN6Go /75XbYgNLyxfrqVsfikC6zhqUNvDMnb6FC7yzO5/9uyiSu/UiKNs0bUblBKBRFwHMIRC Ny9hiu+lAnA2Kq2Vt5em3wYTd5KbZEFtJcAXRZKpMmy8xFw6nmA4hWyoL7RXAmnJtXSu 7rj1gjK+/a28T1IR99Ml7u5BBym1Q2KQmNiDfSFGG+KL4sk67Ku/hQXENaa4x7YkBkvq OFmKy2HrzNwSMKcJ9ha31ohlJ3iFZg+T8q38IYJewdoI0pZ4WfMwhY6dGAYB+19CVWsm zH6w== 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=294vPIKF0FsD09j8ptlM9k8sVT1xnHuXBETXznmUOGw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=viSaqEES5s/eLRoMwFTDtGhHwVDGzproe0yg039Ko6dZyLDWAU6pGBN1eeNlnCJS52 DgcJs0G8St7SpF9xbJiVJwEOizqMAcxDx/tblXq1flJGfedsATF2T2EEADYnrA7cLp7C VKXeqBMgAPAu8qcxCWek1zL/h3GOcJQDyBwjQIJnQsLumN1ZebZrPAH/0GUNbPuTQuPO RqnzOkS/1fpWhSCTobkW8YedM8dELkEtq4d6giURTbFOsBFMEVs1tJ0LOEBWfhiNKBIf KLqgJv/hoMqgGKwMD2AcE5kWxVnE2CJdMuJ0Zyc18VGJGNl2kGzT/7axVIgXAFQgofqx sJiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q7sQ+Qe0; 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 vv23-20020a05620a563700b00775d0319908si1894324qkn.16.2023.10.20.13.56.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:56:23 -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=q7sQ+Qe0; 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 1qtwM2-0007yG-DQ; Fri, 20 Oct 2023 16:44:22 -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 1qtwLr-0007p4-BF for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:11 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLo-0008H1-Kw for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:10 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso996768b3a.1 for ; Fri, 20 Oct 2023 13:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834647; x=1698439447; 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=294vPIKF0FsD09j8ptlM9k8sVT1xnHuXBETXznmUOGw=; b=q7sQ+Qe0tyDPQ7OiLpaybxiuCXWsbU+etjPJzE13fjmMOIOa7VK9puvRvPynErA1Tp GymwD0RxXfwc0E3148xSE34Igh8RpPahkvrDV1exemQt2jZbayOrBQwhT/ydnnKcEva7 8RUBGC7lXJnfR/iMTM/Qg7OjpkN9fdfzR823+BiweLEavbHZJWSKlES62B9cEgKQPuFs 3Vm8N07yL752GVK0W8mKy4J//gCf3PweQwaByGYkMbaBr9RjrJ2R3rLCcHpl+hyQm+48 crCCbaS5NBno6jiFWbA4CDd5sMOz8WIdO+yvLvk47yIZjDSH+4MShimU7jxbieS22M7p TUsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834647; x=1698439447; 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=294vPIKF0FsD09j8ptlM9k8sVT1xnHuXBETXznmUOGw=; b=w4WZGhprq1F8KiaqlMAsjQ4hhIHsSKJ3NYWnqhSJipVDzE7aamhIJmHgGoP/Go7MIR 5YFDKwEjgypkMjVBb9x3uSiKp5fQFzqvbIoST5haITA6DMnyX1rWkRPxUWi2+an/o3aI KEzRwQPjdIDKuk7f36pT58FTshiqsmnmpQAa7s+YWx9HNtc8McgF8KCCjdp9Q9kw9Ysn xrgAgEFMIa08zbstdF/zVsokwBLeL0QDWmZp2vrtEjvGMCq29iqKaFGf23YyShMV+9JP fpv2xArmduwjPBvdfBmUQ30e21JwCYqG4FXNxABT2wbiIQDhgfVxXXmvX3qUDQXoJPHb yvbQ== X-Gm-Message-State: AOJu0YylE9WKt0RKxUa3iG1e3bxXjnKgum+Tr5TtBrNJ+Mo3PaYku7sk xGGv5bffhVfHnju+4POeF7k8gK3BFamGbN8hdu8= X-Received: by 2002:a05:6a20:394a:b0:17b:a34d:5b56 with SMTP id r10-20020a056a20394a00b0017ba34d5b56mr3777882pzg.19.1697834646996; Fri, 20 Oct 2023 13:44:06 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 38/65] target/hppa: Decode ADDB double-word Date: Fri, 20 Oct 2023 13:43:04 -0700 Message-Id: <20231020204331.139847-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Signed-off-by: Richard Henderson --- target/hppa/translate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index bb55718a4d..21f2819d12 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3122,6 +3122,17 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, DisasCond cond; bool d = false; + /* + * For hppa64, the ADDB conditions change, dropping ZNV, SV, OD + * in favor of double-word EQ, LT, LE. + */ + if (ctx->is_pa20) { + d = c >= 5; + if (d) { + c &= 3; + } + } + in2 = load_gpr(ctx, r); dest = tcg_temp_new(); sv = NULL; From patchwork Fri Oct 20 20:43:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736318 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502607wrl; Fri, 20 Oct 2023 13:50:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwZiHN5DBNN3keuE+HqF4gPlgHS85f7ZYuG2A5urAIND5sftmxtyqDYfzQiRY/mQ2aKnuc X-Received: by 2002:a54:4787:0:b0:3a7:1d15:28fe with SMTP id o7-20020a544787000000b003a71d1528femr2665615oic.56.1697835020685; Fri, 20 Oct 2023 13:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835020; cv=none; d=google.com; s=arc-20160816; b=S07LvAo36DRgXHK6ToPs29bmOuIEl39oWimxDVTWbBKmeqvfPqU0Tx3UgqrOCdmeAe SATU5icYmFgtcEaN72+lRcA6ifUMuVJtXuEpQ16+RT11clLTqDH/uMFzXSGfiN9Guyxu LjARYvQwA+sQt3FfL/tTBPAk9cD+ja98Nv/vnwbFdE+LW1A8E9Cw/YPcbcfKWtx3edV/ K2drwxmRw6MfaP+uFYXjcc749Hcv7KYZSs2hCnROqErEypnxgCFsHYqPAtgqqOFUAN/R koVOrhLLd2SdvQ9kvaza0tSkhsVbW6wRiNwKMcsvSy9YgSNrpxrlxI0E3Ow7je0L2ILT GPEA== 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=vblR9i+m14sVOY03KrOJimUiWRKcg8IN+vUxURUwc5s=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=G0EUC/RcUQt3Nqtl7yUrQTe/ozbAIi/b/6bDOzFcB2rAOh9jfDJh7DUlqhtJHXlrkz q8p45nUx2NR4vWVvBchxgf2BM3mPZyru54wECIx0abGafi2fuDZmkJlHhnVOLaB1q7fT er7hVimmhlG0q2LU4AwljH/fIwTGc1zRLIYBlkxPI3L4evcMSRp15Eq+oQ4gN+8BnKqS oGSuZ+Xj0dTrPLy7YPhW0Ddnk2DzMSwbA13bNeNyX4MZbe55QVCHz85TxXRvHj2lyHPU evx0BP4nLXHvYuGr15zZMdjUtkVrYXf409gMh1hYstSfy78FdU93cXTFKjqL5TdpO8XZ Ym5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UyHlBw9s; 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 bo2-20020a05621414a200b0064c84ce3e14si1964585qvb.72.2023.10.20.13.50.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50:20 -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=UyHlBw9s; 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 1qtwM5-0007yx-7y; Fri, 20 Oct 2023 16:44:25 -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 1qtwLq-0007ou-Rh for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:10 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLp-0008HI-3G for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:44:10 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so1107497b3a.1 for ; Fri, 20 Oct 2023 13:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834648; x=1698439448; 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=vblR9i+m14sVOY03KrOJimUiWRKcg8IN+vUxURUwc5s=; b=UyHlBw9sukJKn0PECtYQKmJsZxbzA7CSJ2Xj1W47PUJZY52FFuvSV9AAdUqf8/vW4F ksYoMLgI2L2GlL53TVR+egfCurCbLxFX2Xs24DZTmGymyn5msdyCZjW53QKU0HdnYu60 fORxE25na+fNywPhnt389G2Mgd3e34+oinAp585SxzUSdXnvnZixRYJM0CvDClTSOewo A3wKJ/EzxLc58BfCx1PlCJFYMKsTI07T9AdVsLuuz2WUfQwYvlwiyl7HwuJPo5vh/aWY 7Jj9Fax/dSLLR09pZz0tmK/BTf24htv3s+UhckKVAUONee6A9gE1dFVhzfPwMqizDovv 6xrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834648; x=1698439448; 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=vblR9i+m14sVOY03KrOJimUiWRKcg8IN+vUxURUwc5s=; b=d0TYmR+ex1BT5zzhzZsci3gGyqBG5JUneYTkTLoG7t7MKQq7SJlsxFsY3OQLuDacHd wCEtlLo0jVjr0Ww4CxKtjYshXOgHIF7EtjQajeZJ/x1s3BfYewwbRZ6eW+wEtboVRmLJ cC+7Mq2z0o4D+vxgg3Q+Rq2PeTDN6KtNLmrRdZA7Ijju9gA2SEpDLAUIQSl6pVKBLDJe g3oelhEofrnAzW77TFT9V0tQMtkEyBxn2uzNjtsVhZ+8lG4stydkcFnO1o/iw1evFC6q qhJGxO4ouikz2EcFFxGRDtxRSRjW0y/+bIdG3tOjiXZr79hxFsiQ10ug/rWDeCPu08Gd 6y5w== X-Gm-Message-State: AOJu0YyYS3wGB8bZKZhr3nE4CnBMKJtu2gnex0HWhVQVhnhxYaandOVu e49iIfUSM0gQx7bQfQDVm3k+SjnqhR9o6GAw2Go= X-Received: by 2002:a05:6a00:2395:b0:6bd:9588:bd67 with SMTP id f21-20020a056a00239500b006bd9588bd67mr3114578pfc.24.1697834647868; Fri, 20 Oct 2023 13:44:07 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:44:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 39/65] target/hppa: Implement LDD, LDCD, LDDA, STD, STDA Date: Fri, 20 Oct 2023 13:43:05 -0700 Message-Id: <20231020204331.139847-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 15 +++++++++++---- target/hppa/translate.c | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 48f09c9b06..33eec3f4c3 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -215,9 +215,14 @@ ld 000011 ..... ..... .. . 0 -- 00 size:2 ...... @ldstx st 000011 ..... ..... .. . 1 -- 10 size:2 ...... @stim5 ldc 000011 ..... ..... .. . 1 -- 0111 ...... @ldim5 size=2 ldc 000011 ..... ..... .. . 0 -- 0111 ...... @ldstx size=2 +ldc 000011 ..... ..... .. . 1 -- 0101 ...... @ldim5 size=3 +ldc 000011 ..... ..... .. . 0 -- 0101 ...... @ldstx size=3 lda 000011 ..... ..... .. . 1 -- 0110 ...... @ldim5 size=2 lda 000011 ..... ..... .. . 0 -- 0110 ...... @ldstx size=2 +lda 000011 ..... ..... .. . 1 -- 0100 ...... @ldim5 size=3 +lda 000011 ..... ..... .. . 0 -- 0100 ...... @ldstx size=3 sta 000011 ..... ..... .. . 1 -- 1110 ...... @stim5 size=2 +sta 000011 ..... ..... .. . 1 -- 1111 ...... @stim5 size=3 stby 000011 b:5 r:5 sp:2 a:1 1 -- 1100 m:1 ..... disp=%im5_0 @fldstwx ...... b:5 x:5 sp:2 scale:1 ....... m:1 ..... \ @@ -244,6 +249,8 @@ fstd 001011 ..... ..... .. . 1 -- 100 0 . ..... @fldstdi # Offset Mem #### +@ldstim11 ...... b:5 t:5 sp:2 .............. \ + &ldst disp=%assemble_11a m=%ma2_to_m x=0 scale=0 size=3 @ldstim14 ...... b:5 t:5 sp:2 .............. \ &ldst disp=%lowsign_14 x=0 scale=0 m=0 @ldstim14m ...... b:5 t:5 sp:2 .............. \ @@ -275,11 +282,11 @@ fstw 011110 b:5 ..... sp:2 .............. \ fstw 011111 b:5 ..... sp:2 ...........0.. \ &ldst disp=%assemble_12a t=%rm64 m=0 x=0 scale=0 size=2 -fldd 010100 b:5 t:5 sp:2 .......... .. 1 . \ - &ldst disp=%assemble_11a m=%ma2_to_m x=0 scale=0 size=3 +ld 010100 ..... ..... .. ............0. @ldstim11 +fldd 010100 ..... ..... .. ............1. @ldstim11 -fstd 011100 b:5 t:5 sp:2 .......... .. 1 . \ - &ldst disp=%assemble_11a m=%ma2_to_m x=0 scale=0 size=3 +st 011100 ..... ..... .. ............0. @ldstim11 +fstd 011100 ..... ..... .. ............1. @ldstim11 #### # Floating-point Multiply Add diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 21f2819d12..da1dd7d74a 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2951,6 +2951,10 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) TCGv_reg zero, dest, ofs; TCGv_tl addr; + if (unlikely(TARGET_REGISTER_BITS == 32 && a->size > MO_32)) { + return gen_illegal(ctx); + } + nullify_over(ctx); if (a->m) { From patchwork Fri Oct 20 20:43:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736317 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502587wrl; Fri, 20 Oct 2023 13:50:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7TDfBamfqUjeuHf/CzUbCwVVt0c7udynSRgvpvgLJOMWdNr91PDFg5nHk8aL+06Qaf/jv X-Received: by 2002:a05:620a:400a:b0:775:7874:2bee with SMTP id h10-20020a05620a400a00b0077578742beemr3163570qko.55.1697835016870; Fri, 20 Oct 2023 13:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835016; cv=none; d=google.com; s=arc-20160816; b=q8ufO0nSDWqPzBX5Zg3aLRt2hYH1Hu5A2lmepqxWqt2P8w9kaCmyYOcyzR+sUd34JJ QZhsWgUTX3D/Mrwp/kO5MFWTvTTNkrus39FLbRd88xaId/5rgqI96YX0QB6tgS0R6i39 Pvc4mFsXCoiKaWRZz+X4M/XSb45iV29KVijfWMGK7embNyDZR0e1RXt6aXGCTP04r1tE GBGwrMCbi3cEljl5YqgYBPbkI6kyBTMwl49YSgJLbDX35U+EogyhrAm4Q0gWnRDHmRyH HBdt7QBtgu423gYu8ZzZfOJhy/X+Kf9+/CAo6pLSKyx3B1akeUlIOcav4RSJZJcL5q7g ehxw== 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=L/gxfPrTm0kos9X8f0jKtHEuelMBEgSfEp+oBZ3XX/Y=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=AwBDsAixrMhkAxM72OLspqhiXlDb6m1Lofy/VFPWpE3mruM1YOD68r/ZOvX+vV0JeT NA6gWwGgfMVyJ6mnKLi6pmqT8ZLTyuEYL6JU3z5qUfK+20E8HkS7oMm211+rFMgWYGFp Vz6Gwo+c7aJFwagcRJyc4GHtuZLKl6Ym4+9nUNao0buaVpO2Ejt3KutHLq8lsWbnLvgl r9VE2j7LDJsUnSs8+JN+Thx/rDFMhyTVhfVbLdw+d8oZOSiE9FcZpyONg6BUJr/4IheM Yncx3quKIgvSG5A0pj9hFX2KZrKa/Gxszshsy8qsZkhFRUTsqpOiP+zVR5uMZGZnx4+S g+Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uIVUpdKF; 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 t6-20020a05620a450600b0076f2ab07aafsi1998810qkp.690.2023.10.20.13.50.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50:16 -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=uIVUpdKF; 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 1qtwOo-0001g0-1O; Fri, 20 Oct 2023 16:47:14 -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 1qtwOm-0001fY-FP for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:12 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOk-00019t-HW for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:12 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6b26a3163acso1102464b3a.2 for ; Fri, 20 Oct 2023 13:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834829; x=1698439629; 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=L/gxfPrTm0kos9X8f0jKtHEuelMBEgSfEp+oBZ3XX/Y=; b=uIVUpdKFkxVRhhPpAsAPxRNN+DPdcznjbFjAuQWMfwZQzidGrq3whx0i3NuWLtzzql VWSTVI4WsfFe32ljYHYCtftzeSCTLfi6IiLgQxX+w6WjD9uNkOydjkVBmksLH4gYSCcQ 51HJlv0AG4yfAr/1mDtAovwzWJ4KTXmQX6ibh9xYEiRr0Nk9dBIWSm2RVoHLo9s7mClO 46Qr+FeMqZJv86oQKDien1fMfvLuqgojT9nk4vA7ldZyAL3AXGzkSsHB9K1LKNMJTa3p 4PSdfDXs0BpdcVUTLJUASy28AJtE/zqg67aOqt03Bl7wlDa5h+gODh+sYIvbJ2yazCFS R7Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834829; x=1698439629; 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=L/gxfPrTm0kos9X8f0jKtHEuelMBEgSfEp+oBZ3XX/Y=; b=X7BqUgEEtPN8Or/WzhAxdYG2DMPFGFsX3sU6l99WSFKn3l3H4XyhljELO2a70se9fj R6KmQ1HTP+vRHlTCtotr1RIOqvnE4D/Y7GtGUw7wH4KqCQkAyDXH2VFzAoT8cx9bw7dJ 4iKmxPNMuKnWvmxFjg1gBGmiko2GtD6LJUZXjBFa0NSYclFO7B85MOQGQEUi7hjkoWkN Fn9+7W/5lgP2bt28UmT5WgphCBsiIJ9kmUHvSuLZhYA7zZKBX6knmPSP8QFQiMHZ9T7T lxwT4ICLeUKYTPW4G6PQ6Iz9NJrET4uWAWdQfySpJ5sj72df7zUDvQhS9STrYCU5Cs8/ jpiw== X-Gm-Message-State: AOJu0Yxotb/HemppviMgBdIy9weVwu3ei5VdWvn8cDvP5UbwKgxJPdu1 Lc1yhok3JekbnjVLh9Amk+wU0m8BA9FCugKSgC0= X-Received: by 2002:a05:6a20:914b:b0:17b:129b:1813 with SMTP id x11-20020a056a20914b00b0017b129b1813mr3595911pzc.1.1697834829150; Fri, 20 Oct 2023 13:47:09 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 40/65] target/hppa: Implement DEPD, DEPDI Date: Fri, 20 Oct 2023 13:43:06 -0700 Message-Id: <20231020204331.139847-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 19 ++++++++-- target/hppa/translate.c | 80 +++++++++++++++++++++++++++------------- 2 files changed, 69 insertions(+), 30 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 33eec3f4c3..12684b590e 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -46,6 +46,10 @@ %im5_0 0:s1 1:4 %im5_16 16:s1 17:4 +%len5 0:5 !function=assemble_6 +%len6_8 8:1 0:5 !function=assemble_6 +%len6_12 12:1 0:5 !function=assemble_6 +%cpos6_11 11:1 5:5 %ma_to_m 5:1 13:1 !function=ma_to_m %ma2_to_m 2:2 !function=ma_to_m %pos_to_m 0:1 !function=pos_to_m @@ -334,10 +338,17 @@ shrpw_imm 110100 r2:5 r1:5 c:3 01 0 cpos:5 t:5 extrw_sar 110100 r:5 t:5 c:3 10 se:1 00000 clen:5 extrw_imm 110100 r:5 t:5 c:3 11 se:1 pos:5 clen:5 -depw_sar 110101 t:5 r:5 c:3 00 nz:1 00000 clen:5 -depw_imm 110101 t:5 r:5 c:3 01 nz:1 cpos:5 clen:5 -depwi_sar 110101 t:5 ..... c:3 10 nz:1 00000 clen:5 i=%im5_16 -depwi_imm 110101 t:5 ..... c:3 11 nz:1 cpos:5 clen:5 i=%im5_16 +dep_sar 110101 t:5 r:5 c:3 00 nz:1 00 000 ..... d=0 len=%len5 +dep_sar 110101 t:5 r:5 c:3 00 nz:1 1. 000 ..... d=1 len=%len6_8 +dep_imm 110101 t:5 r:5 c:3 01 nz:1 cpos:5 ..... d=0 len=%len5 +dep_imm 111100 t:5 r:5 c:3 .. nz:1 ..... ..... \ + d=1 len=%len6_12 cpos=%cpos6_11 +depi_sar 110101 t:5 ..... c:3 10 nz:1 d:1 . 000 ..... \ + i=%im5_16 len=%len6_8 +depi_imm 110101 t:5 ..... c:3 11 nz:1 cpos:5 ..... \ + d=0 i=%im5_16 len=%len5 +depi_imm 111101 t:5 ..... c:3 .. nz:1 ..... ..... \ + d=1 i=%im5_16 len=%len6_12 cpos=%cpos6_11 #### # Branch External diff --git a/target/hppa/translate.c b/target/hppa/translate.c index da1dd7d74a..5d07d0d890 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -329,6 +329,17 @@ static int expand_shl11(DisasContext *ctx, int val) return val << 11; } +static int assemble_6(DisasContext *ctx, int val) +{ + /* + * Officially, 32 * x + 32 - y. + * Here, x is already in bit 5, and y is [4:0]. + * Since -y = ~y + 1, in 5 bits 32 - y => y ^ 31 + 1, + * with the overflow from bit 4 summing with x. + */ + return (val ^ 31) + 1; +} + /* Translate CMPI doubleword conditions to standard. */ static int cmpbid_c(DisasContext *ctx, int val) { @@ -3383,17 +3394,23 @@ static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) return nullify_end(ctx); } -static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) +static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) { - unsigned len = 32 - a->clen; + unsigned len, width; target_sreg mask0, mask1; TCGv_reg dest; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } - if (a->cpos + len > 32) { - len = 32 - a->cpos; + + len = a->len; + width = a->d ? 64 : 32; + if (a->cpos + len > width) { + len = width - a->cpos; } dest = dest_gpr(ctx, a->t); @@ -3402,11 +3419,8 @@ static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) if (a->nz) { TCGv_reg src = load_gpr(ctx, a->t); - if (mask1 != -1) { - tcg_gen_andi_reg(dest, src, mask1); - src = dest; - } - tcg_gen_ori_reg(dest, src, mask0); + tcg_gen_andi_reg(dest, src, mask1); + tcg_gen_ori_reg(dest, dest, mask0); } else { tcg_gen_movi_reg(dest, mask0); } @@ -3415,22 +3429,28 @@ static bool trans_depwi_imm(DisasContext *ctx, arg_depwi_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); } return nullify_end(ctx); } -static bool trans_depw_imm(DisasContext *ctx, arg_depw_imm *a) +static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) { unsigned rs = a->nz ? a->t : 0; - unsigned len = 32 - a->clen; + unsigned len, width; TCGv_reg dest, val; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } - if (a->cpos + len > 32) { - len = 32 - a->cpos; + + len = a->len; + width = a->d ? 64 : 32; + if (a->cpos + len > width) { + len = width - a->cpos; } dest = dest_gpr(ctx, a->t); @@ -3445,26 +3465,26 @@ static bool trans_depw_imm(DisasContext *ctx, arg_depw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); } return nullify_end(ctx); } -static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, - unsigned nz, unsigned clen, TCGv_reg val) +static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, + bool d, bool nz, unsigned len, TCGv_reg val) { unsigned rs = nz ? rt : 0; - unsigned len = 32 - clen; + unsigned widthm1 = d ? 63 : 31; TCGv_reg mask, tmp, shift, dest; - unsigned msb = 1U << (len - 1); + target_ureg msb = 1ULL << (len - 1); dest = dest_gpr(ctx, rt); shift = tcg_temp_new(); tmp = tcg_temp_new(); /* Convert big-endian bit numbering in SAR to left-shift. */ - tcg_gen_andi_reg(shift, cpu_sar, 31); - tcg_gen_xori_reg(shift, shift, 31); + tcg_gen_andi_reg(shift, cpu_sar, widthm1); + tcg_gen_xori_reg(shift, shift, widthm1); mask = tcg_temp_new(); tcg_gen_movi_reg(mask, msb + (msb - 1)); @@ -3482,25 +3502,33 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, /* Install the new nullification. */ cond_free(&ctx->null_cond); if (c) { - ctx->null_cond = do_sed_cond(ctx, c, false, dest); + ctx->null_cond = do_sed_cond(ctx, c, d, dest); } return nullify_end(ctx); } -static bool trans_depw_sar(DisasContext *ctx, arg_depw_sar *a) +static bool trans_dep_sar(DisasContext *ctx, arg_dep_sar *a) { + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } - return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, load_gpr(ctx, a->r)); + return do_dep_sar(ctx, a->t, a->c, a->d, a->nz, a->len, + load_gpr(ctx, a->r)); } -static bool trans_depwi_sar(DisasContext *ctx, arg_depwi_sar *a) +static bool trans_depi_sar(DisasContext *ctx, arg_depi_sar *a) { + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } - return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, tcg_constant_reg(a->i)); + return do_dep_sar(ctx, a->t, a->c, a->d, a->nz, a->len, + tcg_constant_reg(a->i)); } static bool trans_be(DisasContext *ctx, arg_be *a) From patchwork Fri Oct 20 20:43:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736331 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502903wrl; Fri, 20 Oct 2023 13:51:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFY93RheL9yH6I/b9c+CccY+Aix6vWI5L4Pdc+8Kl1HrtzSb9HFKnpv5XQF1kHCUkU/XrDm X-Received: by 2002:a0c:cd10:0:b0:66d:19d6:2eb5 with SMTP id b16-20020a0ccd10000000b0066d19d62eb5mr2525493qvm.7.1697835094848; Fri, 20 Oct 2023 13:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835094; cv=none; d=google.com; s=arc-20160816; b=Jy91aFnJv2ubG3JdoeWuifDPh9Mb8tmSri/696v69lreauqftTxckszUB+F7Ss7ugI aWlugN9yXQ51onOmhWG+e9nBhdHYfmhUGaeyBh8VC9lgPDQjagw8L8v4gApHgkiuVFd9 Nnbl5AqOfzpWgxvpSs+nQtRSDh+OH+XJif5z+gvAHkfflMNxJdfV+sVnnk3Tm2mSpyYI ld8UFi6oFpVrVA2pAhe9zG15BxX9tpZabAy8Ze+oaxs3QICY4TmaSMgPkvfylvrKEFlq JQiOTbBjiUWxj0GST5lVCvvn4IYShjTq167HGUEuBWTdtugrCLiaebSFwO11RI+YRBYT PNGQ== 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=HnFt0Jqc97RoWbYAH0MygVjhqU7llo2mciBhZg9UKaQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=s91hp0AA43ut0Kn2BptfWuP3P4wL1KnmQF8X11/yEqcrqjjlVoDVfj3LUpU5kgsGsX /agfFRjTgPjoJ4U48oFwOkChxiUabvkhODbJfYOOZbnTHoFCmLaem8TaEwKBkjVqm0BH /Kxxrsb0Oj8NXjhm0MgarTH9gd+AHm0ldIFptONO0LIBsoJuYCZMwmj42yZ4ANxJ7mOv 7rN9yfmO2yLlqwe5q79Gzt/Up1Ni4eVVjQ7mR0Y+3rTe3eRzwOHTqHPLSNcyIW0MXJF7 +MW4Zk7/YHIprW/6uEswyBP7XAEJyHt5ODuo4oiQGK6ZY+dPrVu3obY1NDXjgwfR95Ap Fx4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RXz1t7WK; 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 i7-20020a05620a0a0700b00775907603f0si1785136qka.470.2023.10.20.13.51.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:34 -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=RXz1t7WK; 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 1qtwOp-0001kY-3H; Fri, 20 Oct 2023 16:47:15 -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 1qtwOn-0001fh-0X for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:13 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOl-0001A1-7r for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:12 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6b3c2607d9bso1166278b3a.1 for ; Fri, 20 Oct 2023 13:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834830; x=1698439630; 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=HnFt0Jqc97RoWbYAH0MygVjhqU7llo2mciBhZg9UKaQ=; b=RXz1t7WK/hFdf9lZ3aSXcjOsYUoY7Ez5fCNp3N7+dk6lhG+Oneh2EFuooIueXWDYQ3 7nw6jcJENJHJBGfFG6bSSZQa7FljLckijEDpEO35eOQlpE+zx8bRJ5y7hZ3Hjzu8jSjs IC8gB3Wk04gweH+P+LLGWbd7xxiychoNjU7yDCAvuRf1s2EHX/1lf8cEG0mlxG8lJKAS K7AmNLFudXDTde8sJsOvsBZ0NDhT5ArsL7gr1qiXpRiaOszenlrLGinz4lb14RBGY4Ms 3avkj2ACv3oHepU+FRD6iNMgQ7WxbWxEsCvV9dWHwmXwodhbbTUW87SVCCJYYUAeEmkv xcNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834830; x=1698439630; 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=HnFt0Jqc97RoWbYAH0MygVjhqU7llo2mciBhZg9UKaQ=; b=dh5GLyD3P5qopi6JutlQMysNbfJFLh0Qptji3dlHmkJqNWT73IKBx5ZmSW0HkUi42l 0CSDMY/Pb5fD6rrZ+E7p85izg8MS5gWJmqAqj6jtM0wfm0Q3Y3KtgutFtokyiDtfFHdE ucZPeQ002s91t3i6ygi9ZDuw9+sAH8v34fM2T/88Iah/e/G9ji6jVQV+Z+/txCtvizPa LQzCuOm7hYYeOEzZwlPDA0/vVI+5T11SghAVhrXZc95UGj6vqf8YCNwRpOMQ5qRjpCpU 9TeG2k606jLVUABwrLve5RZRO9ZH3UwPj2+mjGJS8vJatrzqPB05AuPC3L9mG8B64Ela xNRw== X-Gm-Message-State: AOJu0YyJ3+/B3GSVoKgSg44JcFlMX393QoYBDzejUymlHs/6/KqwzAYh 0HAGJm3JoN3fT5enRjemFtQv1IzNHZ2FQrC9saQ= X-Received: by 2002:a05:6a00:194a:b0:690:bdda:7c35 with SMTP id s10-20020a056a00194a00b00690bdda7c35mr2914314pfk.1.1697834829946; Fri, 20 Oct 2023 13:47:09 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 41/65] target/hppa: Implement EXTRD Date: Fri, 20 Oct 2023 13:43:07 -0700 Message-Id: <20231020204331.139847-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 7 +++++-- target/hppa/translate.c | 34 +++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 12684b590e..7b51f39b9e 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -335,8 +335,11 @@ addbi 101011 ..... ..... ... ........... . . @rib_cf f=1 shrpw_sar 110100 r2:5 r1:5 c:3 00 0 00000 t:5 shrpw_imm 110100 r2:5 r1:5 c:3 01 0 cpos:5 t:5 -extrw_sar 110100 r:5 t:5 c:3 10 se:1 00000 clen:5 -extrw_imm 110100 r:5 t:5 c:3 11 se:1 pos:5 clen:5 +extr_sar 110100 r:5 t:5 c:3 10 se:1 00 000 ..... d=0 len=%len5 +extr_sar 110100 r:5 t:5 c:3 10 se:1 1. 000 ..... d=1 len=%len6_8 +extr_imm 110100 r:5 t:5 c:3 11 se:1 pos:5 ..... d=0 len=%len5 +extr_imm 110110 r:5 t:5 c:3 .. se:1 ..... ..... \ + d=1 len=%len6_12 pos=%cpos6_11 dep_sar 110101 t:5 r:5 c:3 00 nz:1 00 000 ..... d=0 len=%len5 dep_sar 110101 t:5 r:5 c:3 00 nz:1 1. 000 ..... d=1 len=%len6_8 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 5d07d0d890..99b7622841 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3333,11 +3333,14 @@ static bool trans_shrpw_imm(DisasContext *ctx, arg_shrpw_imm *a) return nullify_end(ctx); } -static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) +static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) { - unsigned len = 32 - a->clen; + unsigned widthm1 = a->d ? 63 : 31; TCGv_reg dest, src, tmp; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } @@ -3347,36 +3350,45 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a) tmp = tcg_temp_new(); /* Recall that SAR is using big-endian bit numbering. */ - tcg_gen_andi_reg(tmp, cpu_sar, 31); - tcg_gen_xori_reg(tmp, tmp, 31); + tcg_gen_andi_reg(tmp, cpu_sar, widthm1); + tcg_gen_xori_reg(tmp, tmp, widthm1); if (a->se) { tcg_gen_sar_reg(dest, src, tmp); - tcg_gen_sextract_reg(dest, dest, 0, len); + tcg_gen_sextract_reg(dest, dest, 0, a->len); } else { tcg_gen_shr_reg(dest, src, tmp); - tcg_gen_extract_reg(dest, dest, 0, len); + tcg_gen_extract_reg(dest, dest, 0, a->len); } save_gpr(ctx, a->t, dest); /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); } return nullify_end(ctx); } -static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) +static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) { - unsigned len = 32 - a->clen; - unsigned cpos = 31 - a->pos; + unsigned len, cpos, width; TCGv_reg dest, src; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } + len = a->len; + width = a->d ? 64 : 32; + cpos = width - 1 - a->pos; + if (cpos + len > width) { + len = width - cpos; + } + dest = dest_gpr(ctx, a->t); src = load_gpr(ctx, a->r); if (a->se) { @@ -3389,7 +3401,7 @@ static bool trans_extrw_imm(DisasContext *ctx, arg_extrw_imm *a) /* Install the new nullification. */ cond_free(&ctx->null_cond); if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, false, dest); + ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); } return nullify_end(ctx); } From patchwork Fri Oct 20 20:43:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736337 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502983wrl; Fri, 20 Oct 2023 13:51:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHV/beFu8OkLaCn2eL8G20CYM4SQxXmh611SlghynQX7ONLoUPv65+VN05CLJJYzMBiMv05 X-Received: by 2002:a05:620a:19a4:b0:775:ed1e:2b14 with SMTP id bm36-20020a05620a19a400b00775ed1e2b14mr2820334qkb.54.1697835112662; Fri, 20 Oct 2023 13:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835112; cv=none; d=google.com; s=arc-20160816; b=XEhlYZfR/AL9/O2r6/r7N2Ljnjaroo9FAd2b+6BwpwOKp9DMfrs8YDoXd3c1xkFnW6 ZCjxhlKpk4Gh7nwdm6VAtGQLDuDkD9g8Qn3zF2ujtFN48eN2Kftz3B3eLCgd99b5HsiS 5JPM3nHkSJwUYYYJ0nd8SU84PlpykXRm3Lk9Cs+J/Q6DeBbSqZftvA6PqAN28hnZ18MT /s0Nm1Qm0nYo3gv2eiYPCF9Tneaymf6Ncef19N9pKsD4ZNYX4yres/rZagc5nIE1PHlC ZZ7flY893AP2e/McqhASSqDY0E+I0jtK/cmeeF6dQCu4iLk/Bod6AHHKKx8iKXoXiluk mg0g== 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=BhzrhB16C9PweWmZVzgb1Vp7AhWyTVscP3gbZpvYFDM=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ioN4c8pDXtIp4JjbKXHmxK5kJdmDHlu98yo2gODCBcyp/go54pkYF1A9TwlFPD+02X ocnWV25EMsYKnwpsud/bgw0JOtBRuMec8+6rmqIWpOng6tUICj0lLUqiwpQsPwvHs5sa BsTPfalG2aNiSYQQSkfipM3+QtlTiJsEIuJVC+Qy//EAMu+0tGZ8vgPHi1yn+z0NoO3G TzA1glt6RCTA/7scuMvwaNveCzM561EJntcE2aCYB4ZCiGI7hwP1e/7ypUYKnjA3Xgn9 rWqKLfNxy5Ad0d/uNBbwST+L2jum3WnPtONKFUqqpaFSRKqXkLf/J8efKIEU9SgK71dK sfgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SUTxvSYo; 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 qs20-20020a05620a395400b007789a38928asi105946qkn.612.2023.10.20.13.51.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:52 -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=SUTxvSYo; 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 1qtwOp-0001lK-Pa; Fri, 20 Oct 2023 16:47:15 -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 1qtwOn-0001fv-SF for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:13 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOm-0001AB-15 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:13 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6b709048d8eso1084316b3a.2 for ; Fri, 20 Oct 2023 13:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834831; x=1698439631; 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=BhzrhB16C9PweWmZVzgb1Vp7AhWyTVscP3gbZpvYFDM=; b=SUTxvSYoguvpHgN1y3GpbwOV0FWAE+rIC7ascr+kTs2HMknfDjKFTNpCXtCruZmRH1 /PcHsjjvS9BaCP32cULrZT7GugXHBwA6YATrgHTM+XENjXpktvw7cQA9aKx2ODkTX5Aq m2psBQyJCZyBjQaUp5801icEj/SOsrsqVA7i6jFVyDLGBA9gf45h+Zdcq1bRK3+xr5FP TnTndWyAmqL93ZQWR8fXOxLOHMm045Xc02hqr7hGXNgCaaEOgQgM2apBMmyMOoclkWZh TB9amJpdaDcDFZFIiNiX1fm0FHRt0Sknlol5p4czT8RmQjFfjmnfZrcVE8kDIMUwxI1t Vc8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834831; x=1698439631; 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=BhzrhB16C9PweWmZVzgb1Vp7AhWyTVscP3gbZpvYFDM=; b=Uulx/uV30aooYIvHxAaIuO5SjAxg3vWH9aq1B8RWka1XutSI1GtUakhSXEMHVHWz9T Xm/DBDJ3CvGS4uPUWuJFQa2PjyrXjgEDv6vkY1aWfZI8NqJRylCT03thnxtitP/g5+Iy +xWvuSaIT7u2awE1qqlCf+n8t2u/Cs+JhK159usAIm6eEg8bLChmalmRU6LC+iOHRWN6 vlYyN5BFkjH8t6G51iTq16g56aruwUxxZ3b8r/u+SaYngb9hd8mZqUc4Op7QumZlK2zL Mfs14GGfOBVSAX2B3CyuS68pcSBvg7p7TwJk/PpDMSYyj7s6YRehZDpBlBVS7M3prc+c gJnw== X-Gm-Message-State: AOJu0YxxLenBJ6lCywmWu0cSqCdLPpm23ADJSRdSgFzzSWY4fazQd2L/ gAq/xOtalUKBs2sPVxk8MafXnqTOrxG60sY/Z9Q= X-Received: by 2002:a05:6a21:a103:b0:16b:abad:87c5 with SMTP id aq3-20020a056a21a10300b0016babad87c5mr2663180pzc.10.1697834830748; Fri, 20 Oct 2023 13:47:10 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 42/65] target/hppa: Implement SHRPD Date: Fri, 20 Oct 2023 13:43:08 -0700 Message-Id: <20231020204331.139847-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 6 ++- target/hppa/translate.c | 79 ++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 25 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 7b51f39b9e..6f0c3f6ea5 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -332,8 +332,10 @@ addbi 101011 ..... ..... ... ........... . . @rib_cf f=1 # Shift, Extract, Deposit #### -shrpw_sar 110100 r2:5 r1:5 c:3 00 0 00000 t:5 -shrpw_imm 110100 r2:5 r1:5 c:3 01 0 cpos:5 t:5 +shrp_sar 110100 r2:5 r1:5 c:3 00 0 d:1 0000 t:5 +shrp_imm 110100 r2:5 r1:5 c:3 01 0 cpos:5 t:5 d=0 +shrp_imm 110100 r2:5 r1:5 c:3 0. 1 ..... t:5 \ + d=1 cpos=%cpos6_11 extr_sar 110100 r:5 t:5 c:3 10 se:1 00 000 ..... d=0 len=%len5 extr_sar 110100 r:5 t:5 c:3 10 se:1 1. 000 ..... d=1 len=%len6_8 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 99b7622841..05fe5bf7fe 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3258,32 +3258,56 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a) return do_cbranch(ctx, a->disp, a->n, &cond); } -static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) +static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) { - TCGv_reg dest; + TCGv_reg dest, tmp; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } dest = dest_gpr(ctx, a->t); if (a->r1 == 0) { - tcg_gen_ext32u_reg(dest, load_gpr(ctx, a->r2)); - tcg_gen_shr_reg(dest, dest, cpu_sar); + if (a->d) { + tcg_gen_shr_reg(dest, dest, cpu_sar); + } else { + tcg_gen_ext32u_reg(dest, load_gpr(ctx, a->r2)); + tmp = tcg_temp_new(); + tcg_gen_andi_reg(tmp, cpu_sar, 31); + tcg_gen_shr_reg(dest, dest, tmp); + } } else if (a->r1 == a->r2) { - TCGv_i32 t32 = tcg_temp_new_i32(); - TCGv_i32 s32 = tcg_temp_new_i32(); + if (a->d) { + tcg_gen_rotr_reg(dest, load_gpr(ctx, a->r2), cpu_sar); + } else { + TCGv_i32 t32 = tcg_temp_new_i32(); + TCGv_i32 s32 = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(t32, load_gpr(ctx, a->r2)); - tcg_gen_trunc_reg_i32(s32, cpu_sar); - tcg_gen_rotr_i32(t32, t32, s32); - tcg_gen_extu_i32_reg(dest, t32); + tcg_gen_trunc_reg_i32(t32, load_gpr(ctx, a->r2)); + tcg_gen_trunc_reg_i32(s32, cpu_sar); + tcg_gen_andi_i32(s32, s32, 31); + tcg_gen_rotr_i32(t32, t32, s32); + tcg_gen_extu_i32_reg(dest, t32); + } + } else if (a->d) { + TCGv_reg t = tcg_temp_new(); + TCGv_reg n = tcg_temp_new(); + + tcg_gen_xori_reg(n, cpu_sar, 63); + tcg_gen_shl_reg(t, load_gpr(ctx, a->r2), n); + tcg_gen_shli_reg(t, t, 1); + tcg_gen_shr_reg(dest, load_gpr(ctx, a->r1), cpu_sar); + tcg_gen_or_reg(dest, dest, t); } else { TCGv_i64 t = tcg_temp_new_i64(); TCGv_i64 s = tcg_temp_new_i64(); tcg_gen_concat_reg_i64(t, load_gpr(ctx, a->r2), load_gpr(ctx, a->r1)); tcg_gen_extu_reg_i64(s, cpu_sar); + tcg_gen_andi_i64(s, s, 31); tcg_gen_shr_i64(t, t, s); tcg_gen_trunc_i64_reg(dest, t); } @@ -3297,31 +3321,40 @@ static bool trans_shrpw_sar(DisasContext *ctx, arg_shrpw_sar *a) return nullify_end(ctx); } -static bool trans_shrpw_imm(DisasContext *ctx, arg_shrpw_imm *a) +static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) { - unsigned sa = 31 - a->cpos; + unsigned width, sa; TCGv_reg dest, t2; + if (!ctx->is_pa20 && a->d) { + return false; + } if (a->c) { nullify_over(ctx); } + width = a->d ? 64 : 32; + sa = width - 1 - a->cpos; + dest = dest_gpr(ctx, a->t); t2 = load_gpr(ctx, a->r2); if (a->r1 == 0) { - tcg_gen_extract_reg(dest, t2, sa, 32 - sa); - } else if (TARGET_REGISTER_BITS == 32) { + tcg_gen_extract_reg(dest, t2, sa, width - sa); + } else if (width == TARGET_REGISTER_BITS) { tcg_gen_extract2_reg(dest, t2, cpu_gr[a->r1], sa); - } else if (a->r1 == a->r2) { - TCGv_i32 t32 = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(t32, t2); - tcg_gen_rotri_i32(t32, t32, sa); - tcg_gen_extu_i32_reg(dest, t32); } else { - TCGv_i64 t64 = tcg_temp_new_i64(); - tcg_gen_concat_reg_i64(t64, t2, cpu_gr[a->r1]); - tcg_gen_shri_i64(t64, t64, sa); - tcg_gen_trunc_i64_reg(dest, t64); + assert(!a->d); + if (a->r1 == a->r2) { + TCGv_i32 t32 = tcg_temp_new_i32(); + tcg_gen_trunc_reg_i32(t32, t2); + tcg_gen_rotri_i32(t32, t32, sa); + tcg_gen_extu_i32_reg(dest, t32); + } else { + TCGv_i64 t64 = tcg_temp_new_i64(); + tcg_gen_concat_reg_i64(t64, t2, cpu_gr[a->r1]); + tcg_gen_shri_i64(t64, t64, sa); + tcg_gen_trunc_i64_reg(dest, t64); + } } save_gpr(ctx, a->t, dest); From patchwork Fri Oct 20 20:43:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736341 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503587wrl; Fri, 20 Oct 2023 13:54:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8vpLgbSTMT/bjErkO3cK5b1UOkpCZJYxFF+rCBqHczD2+SajrZmjQ83CDIpQg8SB4zIxj X-Received: by 2002:a05:620a:8d05:b0:76e:e619:1f95 with SMTP id rb5-20020a05620a8d0500b0076ee6191f95mr2647639qkn.78.1697835245184; Fri, 20 Oct 2023 13:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835245; cv=none; d=google.com; s=arc-20160816; b=dHOBpZQgpx/Au7o3ZvW/l8y/pFxUiu938pDQbaAgaGkE0uYSdN1jQzTB0EZTMmm+fV oOIAOfT5vCzb+JlYZIDCq+i25Ot35t3wUYzxjCKSr4/jteCdbDiMNjZOnkb/NZ33PtXn 8HG1l3I92jCqZcYgoPencztI62ExFLiLUNeYZiGMWCuYcNIZXQIqDx5JP3/Acsxf0T3u 8KP0BDRnoBD0+lm+lVGXtlXh3JCmCAJxxR5DPYZiF1pBmKMhoYxpeEg2zMu4OWQSZguX OwW3wD0p9gPa5CFYISFcW9uH7tBJoyGWuhfyFLRHGpVGEFgFGdSWAsrYyus7tdfZMza0 ydwA== 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=Eb3lHT3qpP27fmh9TI6JGY9d7TBx7N43aA+xXi4r9Co=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Higx5JnyLxpnXd5w4fZW19VNc79/7o77AMSnFDas9jtPRm+uIv4RTJXWBV1s/ZkQO4 4tF8elgte+OJPJZrolAdFd9riofkloVyn/xCo2L82ABQnDvZt4eDTsbofZWjFaKdRSXZ Ynuf9R3VEpau7sarBw19ZDOwibNCglxZZMXlMNpH3lFbVgROE7V47D7KMtRvMC/qjzJn +fLTutLYFS/VrnJowwroHhjq9AngYHNVNZbcTLpvYAZ6SGmkYwrbtBbJtcQwr81R5amC A+HH3dO04uDNcDlilZnliHYLxwiBA43gx5mgeo6QdDwUcL8EfdAb542+B0Twy6E3HUsX HI4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TFs8g1IM; 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 u6-20020a05620a120600b0077592f8e4bfsi1880036qkj.464.2023.10.20.13.54.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:05 -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=TFs8g1IM; 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 1qtwOr-0001nC-FS; Fri, 20 Oct 2023 16:47:17 -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 1qtwOo-0001h6-A0 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:14 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOm-0001AF-Ou for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:14 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b36e1fcee9so1239532b3a.3 for ; Fri, 20 Oct 2023 13:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834831; x=1698439631; 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=Eb3lHT3qpP27fmh9TI6JGY9d7TBx7N43aA+xXi4r9Co=; b=TFs8g1IMaDKU5O77WWQ5PquWmkqvplZs54zCixeiBIkSuWfAqoqvikGQLymYvw7iI+ sMi4/5MIDeDLi6w4Govl9wLZ+HppFEh0wLcVS+1C26pT8ORVjmPfTOowhBIfn5SQ3/9u R9DHwZIDKakdFO12PKP7Wd0SEj7kllKTT064EV4Juv0icw574kpBp3YsVB12E4VWoMwR 30eZmyTECWNSYdugi44ssuTn1TOSXE5e1t7HnKpyUbZzBgnCoL+eAqYZH7QtBHQZwBUe FURx/RDKdIT0wMDW7sRJS7HzYdlaUKLlTk8VTUezvQaWhiiZDMy90gyxQYHl2WEujnf1 nwNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834831; x=1698439631; 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=Eb3lHT3qpP27fmh9TI6JGY9d7TBx7N43aA+xXi4r9Co=; b=n29p04AVBqCHaUAvqithDmZADlvXZV3RTf2GGiG91XK/s4epiS+lxOPz6HXxMJEKri 7+zValMzKDQdAgNMBW8sjRHXzzumH57j1Opji7lkH9NKaPqTzPtMBQJWSPqurCzsyJXW QECppOrB3fE+48cFaZnWxr/ix01wWLFYzKSVuEEERbsvXRtLzx+BDw9XviVIprMm0Lib x904ZtlpfFmgo2KTdtJaggKKK8Vae9d93IBj4YqfB1zovCzzoC2vNkgcixH5/9cI0aiO EPYVdZLpNofw182FIECyRy/khJT8GFIgObalJIhhgPUaXp0cZJNtSz2JQ1sE/Ux5rBfu 5r5A== X-Gm-Message-State: AOJu0YxGswlB74Aa6Nbo0jwZSuqlcDCDk3LhFZMUpP8UdHeDxiD2p/S5 2ER2Sc0FpKnzb+3bZjPbeDLx0oRPqbTQWiD7+xI= X-Received: by 2002:a05:6a20:7fa5:b0:15e:b8a1:57b9 with SMTP id d37-20020a056a207fa500b0015eb8a157b9mr3609527pzj.24.1697834831469; Fri, 20 Oct 2023 13:47:11 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 43/65] target/hppa: Implement CLRBTS, POPBTS, PUSHBTS, PUSHNOM Date: Fri, 20 Oct 2023 13:43:09 -0700 Message-Id: <20231020204331.139847-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 2 ++ target/hppa/translate.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 6f0c3f6ea5..ba7731b517 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -381,6 +381,8 @@ bl 111010 ..... ..... 101 ........... n:1 . &BL l=2 \ disp=%assemble_22 b_gate 111010 ..... ..... 001 ........... . . @bl blr 111010 l:5 x:5 010 00000000000 n:1 0 +nopbts 111010 00000 00000 010 0---------1 0 1 # clrbts/popbts +nopbts 111010 00000 ----- 010 00000000000 0 1 # pushbts/pushnom bv 111010 b:5 x:5 110 00000000000 n:1 0 bve 111010 b:5 00000 110 10000000000 n:1 - l=0 bve 111010 b:5 00000 111 10000000000 n:1 - l=2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 05fe5bf7fe..4dccaff687 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3746,6 +3746,12 @@ static bool trans_bve(DisasContext *ctx, arg_bve *a) #endif } +static bool trans_nopbts(DisasContext *ctx, arg_nopbts *a) +{ + /* All branch target stack instructions implement as nop. */ + return ctx->is_pa20; +} + /* * Float class 0 */ From patchwork Fri Oct 20 20:43:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736343 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503656wrl; Fri, 20 Oct 2023 13:54:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZVx1xQmExrZ10hO3PakSnT7b/TpCXBll34Uhj8lLrraKEb+rwznlIQTgB+n3/e5b7IO+S X-Received: by 2002:a05:6214:21a5:b0:66d:173a:aca7 with SMTP id t5-20020a05621421a500b0066d173aaca7mr2841875qvc.55.1697835263093; Fri, 20 Oct 2023 13:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835263; cv=none; d=google.com; s=arc-20160816; b=V6s8IIgTpJd3YLj8pihJJ+eVZzwJrRKKauiNShC1oCsDHuZDkw35nrEnl/fktiVE0g xCJiXsRWJUkm0tWjaNMynay11kgpjkPrqTAtE6xIPPciWeHaIfIWHCY7qsQ33SBNCl5X Kl71AAS9LIrNbJDl0qLbp4m/Pz8YByvGagVrO2P7jzDKvztqKTUUIxrEoQ8QnM57Eqdu is7Noag4q+kMXUANQAlhjb4xz9oZW/JhKNfzK4VHwdzyUQzDJZgYRuy0pNyZmis7VJ3D GL1nCsFbThAp6QanARqOevCd8nM4UW85ThHA/F4mZchxF51IZPG7Foeq0s9Xe9uXN8hw 1rqw== 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=ZBv0UGGbMGWQod99fsiuIH0B6h9NComvbm3X1UOBlMo=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=p7+lf6/lZikS/Yy1QLa91QaaL2t8y0+OPJdEArvT7dgh6Pw/mnHby55WfBw4Yp6Ne/ NKZxS7RXc9M85h09NLkWC92FteY9WaXANZf2viRURao9wlNSQNhEvafIc9pjrWiSwQbL DM0i+9ibkilJZxfykIReqpg2xTdxgwB7tBS/+zppa+odonc8FLqCN1PN4Y/FPG7TXkc7 b0BVNLBiWpb0drwyMYVQF9d5x/5uSLfk/JOKo58defZC73zq2AWDOqSCx1V+HCLtP5w7 ZLg+zRZ4LPOPqkmIhigPaZiXl3T0+rk5RGUcyFwSPl5Z/m1PHZvyZf3mbPuGt07s/L1O HiLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qCs8CeT2; 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 or15-20020a056214468f00b0065cfeb73597si2129364qvb.10.2023.10.20.13.54.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:23 -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=qCs8CeT2; 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 1qtwOr-0001mm-6X; Fri, 20 Oct 2023 16:47:17 -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 1qtwOp-0001lf-Rp for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:15 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOn-0001AU-M2 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:15 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b497c8575aso1220318b3a.1 for ; Fri, 20 Oct 2023 13:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834832; x=1698439632; 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=ZBv0UGGbMGWQod99fsiuIH0B6h9NComvbm3X1UOBlMo=; b=qCs8CeT2IOHAUTRADub4xM533iAPhi+Ly6SfG1NkfaCjnMap6+N+mVmv2fBM2Zmp6w 8CB30As4SKI3FUdM3g/todzTaQIkj10bHojFX+1QuZF8T81ZVrtC+HX2u5wtqXkN0KAW Ap8Vvh2hQUg2SVrP+4te3uGIr57+xDVopf8PKv7iacTvuq1th/7QP13YknYElRBvUJro XAn3otIgDY6uBs3/9Nw4lkYq6Add68wbUxBElCDTqAszwjhFXIVDkTZODJ1P9LJumxrs K0vDXEjlrYmnFQJgVT3ShMnvMPYSlU0o9S5/dMpfQQY+GyGssGGUwDOlVpjK+8Os/VkD cx1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834832; x=1698439632; 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=ZBv0UGGbMGWQod99fsiuIH0B6h9NComvbm3X1UOBlMo=; b=mqLMRXlBfwW0CnMnSYE/LsYwANkC2entsyqdqaxcXRwam4Wmfp7q/FOhPgtrd4TkKZ 6sE5QY6ud2jh9+Ug1WJDNywcVKlFWbeuwnqpsCnv5PQcfQ6KCtuNFxN++cbB8IPn02m3 XJNNhInczKrWPdmbp4CtSmxjCgc+OacIcncJmDhkCWPI9QmOnzpweu9fU8Cpe9rsVb4e 4T4W4AYsvc/++4MKh1vGWxOIhAw1+3X+xWlKw5t+J/fBwk8SO2ERoPHaANHS0dLQmCp7 B/KJowGT+FFdSDSUiiJqyUBpHlLw3BOWBssj+F/XZmr0N25Z2NgYgmj+WeOCxqKZ99Lh 5c/A== X-Gm-Message-State: AOJu0Yw8dBucm/JtaTicjmTcS/fHOXXWY5mOf9/B3abeUI8lk/munsmz E8e58BPkzyRDmrUwx0/oYfi172/pODazRTzM31M= X-Received: by 2002:a05:6a00:2345:b0:68f:bb02:fdf with SMTP id j5-20020a056a00234500b0068fbb020fdfmr3041528pfj.27.1697834832424; Fri, 20 Oct 2023 13:47:12 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 44/65] target/hppa: Implement STDBY Date: Fri, 20 Oct 2023 13:43:10 -0700 Message-Id: <20231020204331.139847-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 Signed-off-by: Richard Henderson --- target/hppa/helper.h | 5 ++ target/hppa/insns.decode | 1 + target/hppa/op_helper.c | 178 +++++++++++++++++++++++++++++++++++++-- target/hppa/translate.c | 31 +++++++ 4 files changed, 210 insertions(+), 5 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 647f043c85..9920d38ded 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -16,6 +16,11 @@ DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_b, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_e, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) + DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index ba7731b517..9d8c6a1a16 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -228,6 +228,7 @@ lda 000011 ..... ..... .. . 0 -- 0100 ...... @ldstx size=3 sta 000011 ..... ..... .. . 1 -- 1110 ...... @stim5 size=2 sta 000011 ..... ..... .. . 1 -- 1111 ...... @stim5 size=3 stby 000011 b:5 r:5 sp:2 a:1 1 -- 1100 m:1 ..... disp=%im5_0 +stdby 000011 b:5 r:5 sp:2 a:1 1 -- 1101 m:1 ..... disp=%im5_0 @fldstwx ...... b:5 x:5 sp:2 scale:1 ....... m:1 ..... \ &ldst t=%rt64 disp=0 size=2 diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 837e2b3117..94c9ca5858 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -56,11 +56,11 @@ void HELPER(tcond)(CPUHPPAState *env, target_ureg cond) } } -static void atomic_store_3(CPUHPPAState *env, target_ulong addr, - uint32_t val, uintptr_t ra) +static void atomic_store_mask32(CPUHPPAState *env, target_ulong addr, + uint32_t val, uint32_t mask, uintptr_t ra) { int mmu_idx = cpu_mmu_index(env, 0); - uint32_t old, new, cmp, mask, *haddr; + uint32_t old, new, cmp, *haddr; void *vaddr; vaddr = probe_access(env, addr, 3, MMU_DATA_STORE, mmu_idx, ra); @@ -81,6 +81,35 @@ static void atomic_store_3(CPUHPPAState *env, target_ulong addr, } } +static void atomic_store_mask64(CPUHPPAState *env, target_ulong addr, + uint64_t val, uint64_t mask, + int size, uintptr_t ra) +{ +#ifdef CONFIG_ATOMIC64 + int mmu_idx = cpu_mmu_index(env, 0); + uint64_t old, new, cmp, *haddr; + void *vaddr; + + vaddr = probe_access(env, addr, size, MMU_DATA_STORE, mmu_idx, ra); + if (vaddr == NULL) { + cpu_loop_exit_atomic(env_cpu(env), ra); + } + haddr = (uint64_t *)((uintptr_t)vaddr & -8); + + old = *haddr; + while (1) { + new = be32_to_cpu((cpu_to_be32(old) & ~mask) | (val & mask)); + cmp = qatomic_cmpxchg__nocheck(haddr, old, new); + if (cmp == old) { + return; + } + old = cmp; + } +#else + cpu_loop_exit_atomic(env_cpu(env), ra); +#endif +} + static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val, bool parallel, uintptr_t ra) { @@ -94,7 +123,7 @@ static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val, case 1: /* The 3 byte store must appear atomic. */ if (parallel) { - atomic_store_3(env, addr, val, ra); + atomic_store_mask32(env, addr, val, 0x00ffffffu, ra); } else { cpu_stb_data_ra(env, addr, val >> 16, ra); cpu_stw_data_ra(env, addr + 1, val, ra); @@ -106,6 +135,62 @@ static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val, } } +static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val, + bool parallel, uintptr_t ra) +{ + switch (addr & 7) { + case 7: + cpu_stb_data_ra(env, addr, val, ra); + break; + case 6: + cpu_stw_data_ra(env, addr, val, ra); + break; + case 5: + /* The 3 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask32(env, addr, val, 0x00ffffffu, ra); + } else { + cpu_stb_data_ra(env, addr, val >> 16, ra); + cpu_stw_data_ra(env, addr + 1, val, ra); + } + break; + case 4: + cpu_stl_data_ra(env, addr, val, ra); + break; + case 3: + /* The 5 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr, val, 0x000000ffffffffffull, 5, ra); + } else { + cpu_stb_data_ra(env, addr, val >> 32, ra); + cpu_stl_data_ra(env, addr + 1, val, ra); + } + break; + case 2: + /* The 6 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr, val, 0x0000ffffffffffffull, 6, ra); + } else { + cpu_stw_data_ra(env, addr, val >> 32, ra); + cpu_stl_data_ra(env, addr + 2, val, ra); + } + break; + case 1: + /* The 7 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr, val, 0x00ffffffffffffffull, 7, ra); + } else { + cpu_stb_data_ra(env, addr, val >> 48, ra); + cpu_stw_data_ra(env, addr + 1, val >> 32, ra); + cpu_stl_data_ra(env, addr + 3, val, ra); + } + break; + default: + cpu_stl_data_ra(env, addr, val, ra); + break; + } +} + void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ureg val) { do_stby_b(env, addr, val, false, GETPC()); @@ -117,6 +202,17 @@ void HELPER(stby_b_parallel)(CPUHPPAState *env, target_ulong addr, do_stby_b(env, addr, val, true, GETPC()); } +void HELPER(stdby_b)(CPUHPPAState *env, target_ulong addr, target_ureg val) +{ + do_stdby_b(env, addr, val, false, GETPC()); +} + +void HELPER(stdby_b_parallel)(CPUHPPAState *env, target_ulong addr, + target_ureg val) +{ + do_stdby_b(env, addr, val, true, GETPC()); +} + static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ureg val, bool parallel, uintptr_t ra) { @@ -124,7 +220,68 @@ static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ureg val, case 3: /* The 3 byte store must appear atomic. */ if (parallel) { - atomic_store_3(env, addr - 3, val, ra); + atomic_store_mask32(env, addr - 3, val, 0xffffff00u, ra); + } else { + cpu_stw_data_ra(env, addr - 3, val >> 16, ra); + cpu_stb_data_ra(env, addr - 1, val >> 8, ra); + } + break; + case 2: + cpu_stw_data_ra(env, addr - 2, val >> 16, ra); + break; + case 1: + cpu_stb_data_ra(env, addr - 1, val >> 24, ra); + break; + default: + /* Nothing is stored, but protection is checked and the + cacheline is marked dirty. */ + probe_write(env, addr, 0, cpu_mmu_index(env, 0), ra); + break; + } +} + +static void do_stdby_e(CPUHPPAState *env, target_ulong addr, uint64_t val, + bool parallel, uintptr_t ra) +{ + switch (addr & 7) { + case 7: + /* The 7 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr - 7, val, + 0xffffffffffffff00ull, 7, ra); + } else { + cpu_stl_data_ra(env, addr - 7, val >> 32, ra); + cpu_stw_data_ra(env, addr - 3, val >> 16, ra); + cpu_stb_data_ra(env, addr - 1, val >> 8, ra); + } + break; + case 6: + /* The 6 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr - 6, val, + 0xffffffffffff0000ull, 6, ra); + } else { + cpu_stl_data_ra(env, addr - 6, val >> 32, ra); + cpu_stw_data_ra(env, addr - 2, val >> 16, ra); + } + break; + case 5: + /* The 5 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask64(env, addr - 5, val, + 0xffffffffff000000ull, 5, ra); + } else { + cpu_stl_data_ra(env, addr - 5, val >> 32, ra); + cpu_stb_data_ra(env, addr - 1, val >> 24, ra); + } + break; + case 4: + cpu_stl_data_ra(env, addr - 4, val >> 32, ra); + break; + case 3: + /* The 3 byte store must appear atomic. */ + if (parallel) { + atomic_store_mask32(env, addr - 3, val, 0xffffff00u, ra); } else { cpu_stw_data_ra(env, addr - 3, val >> 16, ra); cpu_stb_data_ra(env, addr - 1, val >> 8, ra); @@ -155,6 +312,17 @@ void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr, do_stby_e(env, addr, val, true, GETPC()); } +void HELPER(stdby_e)(CPUHPPAState *env, target_ulong addr, target_ureg val) +{ + do_stdby_e(env, addr, val, false, GETPC()); +} + +void HELPER(stdby_e_parallel)(CPUHPPAState *env, target_ulong addr, + target_ureg val) +{ + do_stdby_e(env, addr, val, true, GETPC()); +} + void HELPER(ldc_check)(target_ulong addr) { if (unlikely(addr & 0xf)) { diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4dccaff687..650f5812dd 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3031,6 +3031,37 @@ static bool trans_stby(DisasContext *ctx, arg_stby *a) return nullify_end(ctx); } +static bool trans_stdby(DisasContext *ctx, arg_stby *a) +{ + TCGv_reg ofs, val; + TCGv_tl addr; + + nullify_over(ctx); + + form_gva(ctx, &addr, &ofs, a->b, 0, 0, a->disp, a->sp, a->m, + ctx->mmu_idx == MMU_PHYS_IDX); + val = load_gpr(ctx, a->r); + if (a->a) { + if (tb_cflags(ctx->base.tb) & CF_PARALLEL) { + gen_helper_stdby_e_parallel(tcg_env, addr, val); + } else { + gen_helper_stdby_e(tcg_env, addr, val); + } + } else { + if (tb_cflags(ctx->base.tb) & CF_PARALLEL) { + gen_helper_stdby_b_parallel(tcg_env, addr, val); + } else { + gen_helper_stdby_b(tcg_env, addr, val); + } + } + if (a->m) { + tcg_gen_andi_reg(ofs, ofs, ~7); + save_gpr(ctx, a->b, ofs); + } + + return nullify_end(ctx); +} + static bool trans_lda(DisasContext *ctx, arg_ldst *a) { int hold_mmu_idx = ctx->mmu_idx; From patchwork Fri Oct 20 20:43:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736322 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502700wrl; Fri, 20 Oct 2023 13:50:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTS06FzKD/8jVMZVnkpkA93UH+0ug8EMuZ4ojw7k12uR3yqEow30L7cS3QBpl+EbawBL0n X-Received: by 2002:a05:6214:caa:b0:66d:1a20:f278 with SMTP id s10-20020a0562140caa00b0066d1a20f278mr3575426qvs.29.1697835048006; Fri, 20 Oct 2023 13:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835047; cv=none; d=google.com; s=arc-20160816; b=HE1AfDnm9bxul8ZgzOEere0OcUKu9I/eSHUzBYsgtMhhzDczZ6T7Nb/YG23kKGHCdu HcHht0zrfQmhNp1LrDxMmQkUqXmH9pBAEDb7fNUx+Cql/qq8eUfPul4OJYvvtq9P8yKQ IuGYfpJKKQOtWcRdONn1fYfEV91z240N0rHQyQjk0oH310FEeiqAogL+aCpd+fy2G1Iu YZNIfsomZQ8sIj6Lf6QDU+T5wFJwJyQjPEFGY/ibnnkXEpmidazjNgJHbhFgAG28GvM8 uBNdu9jdPu3qYc6IaErUx6Al4zF5U0EL3rLJoYbATESTPNNWkURImSvdC4jEzGDx+3AB 72Gw== 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=iceGonzdaVmnQSlk4xLAZNOj4sU0L4Dh8hQYUhsbnsk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=V3ls797mjXZg9ShqQf9M5bpHzFPk0rW5z2Oii5hGZJ1Catg8V5kIsvaCzdoAodf+Uo xN/QsLjegpzvg5jt69YNrNSqaYQ92GsQb7PUQIxok+KM44nB9wNCCRtSRE6REeibTF3/ s/qhc80mBYAU4Ex6ZdM9cDXdd7JxoBL2Bo/UseNS664qBp4ub7pe5YzYYcNGW01337H5 qkBxGTOjM/ktac5Mve76InGCieZ3vDk9kFkqR5avpG9Kfh/MV9k0OPqXJzVcZM8bSnC2 chN58sI+u8Wv1ooaNCLM0pb1mfMVcIYsXRr3pMzn6Yru8Ws5hHmlZ0m2a0Bx+OAgncrM bbkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RUIZOgt8; 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 e16-20020ad442b0000000b00656ef23713dsi1962924qvr.223.2023.10.20.13.50.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50:47 -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=RUIZOgt8; 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 1qtwOu-0001of-TR; Fri, 20 Oct 2023 16:47:21 -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 1qtwOq-0001mZ-Ul for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:16 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOo-0001Ag-OQ for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:16 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6bd32d1a040so1216234b3a.3 for ; Fri, 20 Oct 2023 13:47:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834833; x=1698439633; 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=iceGonzdaVmnQSlk4xLAZNOj4sU0L4Dh8hQYUhsbnsk=; b=RUIZOgt8U72/28jbE5LeTnVldja5hDu+KRCmAazFLotW62Mg06DdUcPDJrPv2tZueO MYLdT61K+spYpaxr/yYyYU607dFkmLMjbDieMxrVxuNaAH2Qw0g1IZvYNmFal1ahQONr KlI8fZ5BBwD2VsR/jySAel5/MuGALJa+X/7n5es2zZ1HUineVuIK8NXyq46xGNRvsSr9 cf/Jgvo4Tz5yvB2xxRDn6jXkMHEhXmGDM4lHapL49ucJ0PSmwAXrci9OiEPckRZrWteg Mq6dqVq09h6EUw7gEjrc86725Tk57VuKZqGn9XO77By92cQFlXQU3yePYXKyPKZVhcn0 WT7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834833; x=1698439633; 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=iceGonzdaVmnQSlk4xLAZNOj4sU0L4Dh8hQYUhsbnsk=; b=NAyaXWPIK7yHSwAB+2f30yfjp9nV29FTGBwkZGN/Ill9ry6xg4LGcVoSkORGxIYjDc 4nAD1RPjZNQt9fbuijDbKI49UWAEx4R1e87Ihpdf6XKeAlWCDxrilg7dvg6KaAQApvyK 2pW/zAHnoODRxBMIsHlFZpwymyMYU3WcU1WOrc9g/Hr/KJ40JOLjFHsVfs3nEJTek69x /x/nlPZg97XwL76hK8tr5aBEWd0HBZGg6d/YGUiX3fSQNSyjvfExJ1GZO5hgtabJ9aV9 lgeDevDvplq90HFf01cAAif00K8tFLfkFUs+SsKohYG6F++SxuzBF+j7l+4oEWJWoiTo FpSA== X-Gm-Message-State: AOJu0Yy6g44+m/20metD0XJkH6eS6qIBSY3C6h1VWBfHakfI3iQkhbDa iycBqdygf66PSP2dKF5A4CRrxu6skbBnGjnWQaI= X-Received: by 2002:a05:6a21:3889:b0:179:f761:4348 with SMTP id yj9-20020a056a21388900b00179f7614348mr2111249pzb.34.1697834833450; Fri, 20 Oct 2023 13:47:13 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 45/65] target/hppa: Implement IDTLBT, IITLBT Date: Fri, 20 Oct 2023 13:43:11 -0700 Message-Id: <20231020204331.139847-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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 Rename the existing insert tlb helpers to emphasize that they are for pa1.1 cpus. Implement a combined i/d tlb for pa2.0. Still missing is the new 'P' tlb bit. Signed-off-by: Richard Henderson --- target/hppa/helper.h | 5 ++-- target/hppa/insns.decode | 4 +++ target/hppa/mem_helper.c | 63 +++++++++++++++++++++++++++++++++------- target/hppa/translate.c | 35 ++++++++++++++++++---- 4 files changed, 89 insertions(+), 18 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 9920d38ded..58b6754dbe 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -94,8 +94,9 @@ DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tr) DEF_HELPER_FLAGS_2(write_eirr, TCG_CALL_NO_RWG, void, env, tr) DEF_HELPER_FLAGS_2(write_eiem, TCG_CALL_NO_RWG, void, env, tr) DEF_HELPER_FLAGS_2(swap_system_mask, TCG_CALL_NO_RWG, tr, env, tr) -DEF_HELPER_FLAGS_3(itlba, TCG_CALL_NO_RWG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(itlbp, TCG_CALL_NO_RWG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(itlba_pa11, TCG_CALL_NO_RWG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(itlbp_pa11, TCG_CALL_NO_RWG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(itlbt_pa20, TCG_CALL_NO_RWG, void, env, tr, tr) DEF_HELPER_FLAGS_2(ptlb, TCG_CALL_NO_RWG, void, env, tl) DEF_HELPER_FLAGS_1(ptlbe, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_2(lpa, TCG_CALL_NO_WG, tr, env, tl) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 9d8c6a1a16..db1b9f750f 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -152,6 +152,10 @@ ixtlbx 000001 b:5 r:5 ... 000000 addr:1 0 00000 \ # pcxl and pcxl2 Fast TLB Insert instructions ixtlbxf 000001 00000 r:5 00 0 data:1 01000 addr:1 0 00000 +# pa2.0 tlb insert instructions +ixtlbt 000001 r2:5 r1:5 000 1100000 0 00000 # idtlbt +ixtlbt 000001 r2:5 r1:5 000 0100000 0 00000 # iitlbt + pxtlbx 000001 b:5 x:5 sp:2 0100100 local:1 m:1 ----- data=1 pxtlbx 000001 b:5 x:5 ... 000100 local:1 m:1 ----- \ sp=%assemble_sr3x data=0 diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 1a63717571..356746654c 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -312,7 +312,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, } /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ -void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) +void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { hppa_tlb_entry *empty = NULL; int i; @@ -338,15 +338,12 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr, target_ureg reg) /* Note that empty->entry_valid == 0 already. */ empty->va_b = addr & TARGET_PAGE_MASK; empty->va_e = empty->va_b + TARGET_PAGE_SIZE - 1; - /* - * FIXME: This is wrong, as this is a pa1.1 function. - * But for the moment translate abs address for pa2.0. - */ - empty->pa = hppa_abs_to_phys(env, extract32(reg, 5, 20) << TARGET_PAGE_BITS); + empty->pa = extract32(reg, 5, 20) << TARGET_PAGE_BITS; trace_hppa_tlb_itlba(env, empty, empty->va_b, empty->va_e, empty->pa); } -static void set_access_bits(CPUHPPAState *env, hppa_tlb_entry *ent, target_ureg reg) +static void set_access_bits_pa11(CPUHPPAState *env, hppa_tlb_entry *ent, + target_ureg reg) { ent->access_id = extract32(reg, 1, 18); ent->u = extract32(reg, 19, 1); @@ -362,7 +359,7 @@ static void set_access_bits(CPUHPPAState *env, hppa_tlb_entry *ent, target_ureg } /* Insert (Insn/Data) TLB Protection. Note this is PA 1.1 only. */ -void HELPER(itlbp)(CPUHPPAState *env, target_ulong addr, target_ureg reg) +void HELPER(itlbp_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) { hppa_tlb_entry *ent = hppa_find_tlb(env, addr); @@ -370,8 +367,54 @@ void HELPER(itlbp)(CPUHPPAState *env, target_ulong addr, target_ureg reg) qemu_log_mask(LOG_GUEST_ERROR, "ITLBP not following ITLBA\n"); return; } + set_access_bits_pa11(env, ent, reg); +} - set_access_bits(env, ent, reg); +void HELPER(itlbt_pa20)(CPUHPPAState *env, target_ureg r1, target_ureg r2) +{ + hppa_tlb_entry *ent, *empty = NULL; + vaddr va_b, va_e; + uint64_t page_size; + + va_b = deposit64(env->cr[CR_IIAOQ], 32, 32, env->cr[CR_IIASQ]); + va_b &= TARGET_PAGE_MASK; + page_size = TARGET_PAGE_SIZE << (2 * (r1 & 0xf)); + va_e = va_b + page_size - 1; + + for (int i = 0; i < ARRAY_SIZE(env->tlb); ++i) { + ent = &env->tlb[i]; + if (ent->entry_valid) { + if (ent->va_b <= va_e && va_b <= ent->va_e) { + hppa_flush_tlb_ent(env, ent, false); + empty = ent; + } + } else { + empty = ent; + } + } + + /* If we didn't see an empty entry, evict one. */ + ent = empty ? empty : hppa_alloc_tlb_ent(env); + + ent->va_b = va_b; + ent->va_e = va_e; + ent->pa = (r1 << 7) & TARGET_PAGE_MASK; + ent->t = extract64(r2, 61, 1); + ent->d = extract64(r2, 60, 1); + ent->b = extract64(r2, 59, 1); + ent->ar_type = extract64(r2, 56, 3); + ent->ar_pl1 = extract64(r2, 54, 2); + ent->ar_pl2 = extract64(r2, 52, 2); + ent->u = extract64(r2, 51, 1); + /* o = bit 50 */ + /* p = bit 49 */ + ent->access_id = extract64(r2, 1, 31); + ent->entry_valid = 1; + + trace_hppa_tlb_itlba(env, ent, ent->va_b, ent->va_e, ent->pa); + trace_hppa_tlb_itlbp(env, ent, ent->access_id, ent->u, + ent->ar_pl2, ent->ar_pl1, ent->ar_type, + ent->b, ent->d, ent->t); } /* Purge (Insn/Data) TLB. This is explicitly page-based, and is @@ -519,7 +562,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) btlb->va_b = virt_page << TARGET_PAGE_BITS; btlb->va_e = btlb->va_b + len * TARGET_PAGE_SIZE - 1; btlb->pa = phys_page << TARGET_PAGE_BITS; - set_access_bits(env, btlb, env->gr[20]); + set_access_bits_pa11(env, btlb, env->gr[20]); btlb->t = 0; btlb->d = 1; } else { diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 650f5812dd..2a09e1cdad 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2493,6 +2493,9 @@ static bool trans_probe(DisasContext *ctx, arg_probe *a) static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) { + if (ctx->is_pa20) { + return false; + } CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY TCGv_tl addr; @@ -2503,9 +2506,9 @@ static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) form_gva(ctx, &addr, &ofs, a->b, 0, 0, 0, a->sp, 0, false); reg = load_gpr(ctx, a->r); if (a->addr) { - gen_helper_itlba(tcg_env, addr, reg); + gen_helper_itlba_pa11(tcg_env, addr, reg); } else { - gen_helper_itlbp(tcg_env, addr, reg); + gen_helper_itlbp_pa11(tcg_env, addr, reg); } /* Exit TB for TLB change if mmu is enabled. */ @@ -2551,6 +2554,9 @@ static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlbx *a) */ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) { + if (ctx->is_pa20) { + return false; + } CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY TCGv_tl addr, atl, stl; @@ -2562,8 +2568,6 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) * FIXME: * if (not (pcxl or pcxl2)) * return gen_illegal(ctx); - * - * Note for future: these are 32-bit systems; no hppa64. */ atl = tcg_temp_new_tl(); @@ -2581,9 +2585,9 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) reg = load_gpr(ctx, a->r); if (a->addr) { - gen_helper_itlba(tcg_env, addr, reg); + gen_helper_itlba_pa11(tcg_env, addr, reg); } else { - gen_helper_itlbp(tcg_env, addr, reg); + gen_helper_itlbp_pa11(tcg_env, addr, reg); } /* Exit TB for TLB change if mmu is enabled. */ @@ -2594,6 +2598,25 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) #endif } +static bool trans_ixtlbt(DisasContext *ctx, arg_ixtlbt *a) +{ + if (!ctx->is_pa20) { + return false; + } + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY + nullify_over(ctx); + + gen_helper_itlbt_pa20(tcg_env, load_gpr(ctx, a->r1), load_gpr(ctx, a->r2)); + + /* Exit TB for TLB change if mmu is enabled. */ + if (ctx->tb_flags & PSW_C) { + ctx->base.is_jmp = DISAS_IAQ_N_STALE; + } + return nullify_end(ctx); +#endif +} + static bool trans_lpa(DisasContext *ctx, arg_ldst *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); From patchwork Fri Oct 20 20:43:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736310 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502213wrl; Fri, 20 Oct 2023 13:48:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrHjNSa2oT3FwBUS4xVTBE1/0cmVcbLKOEfXj5Img8ZJpllnqrnLzVoqmEFyh/ITuHBMl9 X-Received: by 2002:a05:620a:4004:b0:774:9dc7:ce3d with SMTP id h4-20020a05620a400400b007749dc7ce3dmr3014641qko.12.1697834936695; Fri, 20 Oct 2023 13:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834936; cv=none; d=google.com; s=arc-20160816; b=WhQ1UV3HHWmE0p4FnzY6sDHcclqQnAN+D56eVKY2g/uq0hoXUsEEWj1wb4nXuSZz9S 5mzbxYSiSswXKDvHQLWbVrA9FrPOm625ZlL7IPu79Sj+IdNLucrBqdr2p1XvKV4E5iTJ 09fd+qaxdVBI6l8Vve65eX+k5Jem6/18bZBRhoEePuPm12wuoqHyydOpxhhlcQWIRB9j ySR1hC2cbSKoMp8ujhoi/1AyfmuuN1OCK9GMPqRoOYVqT+56HC3g3x7jW0vwsN0DE9hW k6JD7XiphA3jQvo9wvi3g4j3X+IotD4YStzc9YFZKxhF4oJBYvHb2XVYhdLTkpUuzNmm s/MQ== 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=ZidGRalLwOY7DoY6Z59b3Uu+qUnyVDoR533dncqCuKQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=qsMQ8i9nUzQY7FbEun2gL906MHHee5vw+2MfaW1TVl2Zq6V5hYjV2VsRIvsS4KeNsv oRLNYsGbtqEUbk0LycCbL+m1cdL5/H4xqpAfmVcs4KvbfZHPkGvtlGuZdfWQY7n/dKCr xkCqQO4Pv+MoM9TTupQTk8uuCHW48/htQVwMSYwWp7nDaoqUMPlcpG6Nh51CFTLjLFH9 hMIeMfgzUKRWC3ryZIF0xOfdbQwafd79Lc0P5p8Q31H3Qq93lVNwziiAc1MgZDw7fg0U FYwHbtBJM72aVktFjUEnyAg9IApjCd1hg7EOxWr2o2Eirc+hkIkAgOPi9U5DPyQUhdXo M8Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TYyWj7ER; 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 p9-20020a05620a22a900b0076f39f669desi1914134qkh.51.2023.10.20.13.48.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:48:56 -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=TYyWj7ER; 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 1qtwOs-0001no-Pb; Fri, 20 Oct 2023 16:47:18 -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 1qtwOr-0001mr-6Q for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:17 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOp-0001Aq-Km for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:16 -0400 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-565334377d0so918087a12.2 for ; Fri, 20 Oct 2023 13:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834834; x=1698439634; 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=ZidGRalLwOY7DoY6Z59b3Uu+qUnyVDoR533dncqCuKQ=; b=TYyWj7ERVwiTehoWl00ATJF3C1+RyoSnGT/VNvkrM1PWbxtXNNGSoFwgVWZAEwLmUq JFtknzcOtU1deVFFbOUAil3zJzx8U3uyJstChaVfHXo/0HjWufzgIbRiYssx/egsqWWO NoteOkWjBTDXnEw3WwaRrJVcqpTN16Ig/amgtkbqCk7Hh/Z0onDZmxvEZE3RpbP3izPW G+yK5wAQcjZTOvI7IsVjK3AyjtRXZPaDf5jExeKRTQHx2RMRp7PDnRbAdt6tRndo+J69 MRtEHgplp4u7tAcL4eezjsJ6ZqtFw4ni25oQVNoDFBwZEHxTWSg0vk1zDu+YajpeT+4r skNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834834; x=1698439634; 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=ZidGRalLwOY7DoY6Z59b3Uu+qUnyVDoR533dncqCuKQ=; b=G+ygttd6OIINY9a75TG2f+9chg1w5F+EOvKGMHoacjN+hNwcknYy+/LIAt12XtD1ZN fB0QHXf3/BFgp2WVQmZmVGXjFx5EkaGfzS4XZxvE1YOv5Vq3663VebuPd0h4o7hZzNJA ufxbCHxV7FZkPjq3pVAtiNZcrB56yDcJXXJB80zRT4j+IS4qicgmbKHr+HBSXevST8A3 Vqkzc9dnFu3udiSIDTo5pALIo23f9ba4Zr/A3/cDKzG0sVXWw94mA0n5TKOUL6mABEmB YwDuSZmQ9FjX4kEsUoLzq6qSoXDlyXS5mwfpWHgqNQ580epDzhC9Gj+VtW4g9344p3kB N2Tw== X-Gm-Message-State: AOJu0YwQiafCZIFciT9oIqqRayhMg6yIUOZTfz9W7k0KO5vPP8NMRpaU UnpPiB2b/K1uNZxZC9GQFnKPFeItQTxWfwDc/XA= X-Received: by 2002:a05:6a20:da9f:b0:16b:c20d:fcd1 with SMTP id iy31-20020a056a20da9f00b0016bc20dfcd1mr3758942pzb.21.1697834834380; Fri, 20 Oct 2023 13:47:14 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 46/65] hw/hppa: Use uint32_t instead of target_ureg Date: Fri, 20 Oct 2023 13:43:12 -0700 Message-Id: <20231020204331.139847-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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 size of target_ureg is going to change. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/hppa/machine.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 85682e6bab..1f09b4b490 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -391,9 +391,9 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) true, EM_PARISC, 0, 0); /* Unfortunately, load_elf sign-extends reading elf32. */ - firmware_entry = (target_ureg)firmware_entry; - firmware_low = (target_ureg)firmware_low; - firmware_high = (target_ureg)firmware_high; + firmware_entry = (uint32_t)firmware_entry; + firmware_low = (uint32_t)firmware_low; + firmware_high = (uint32_t)firmware_high; if (size < 0) { error_report("could not load firmware '%s'", firmware_filename); @@ -420,9 +420,9 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) true, EM_PARISC, 0, 0); /* Unfortunately, load_elf sign-extends reading elf32. */ - kernel_entry = (target_ureg) cpu_hppa_to_phys(NULL, kernel_entry); - kernel_low = (target_ureg)kernel_low; - kernel_high = (target_ureg)kernel_high; + kernel_entry = (uint32_t) cpu_hppa_to_phys(NULL, kernel_entry); + kernel_low = (uint32_t)kernel_low; + kernel_high = (uint32_t)kernel_high; if (size < 0) { error_report("could not load kernel '%s'", kernel_filename); From patchwork Fri Oct 20 20:43:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736320 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502679wrl; Fri, 20 Oct 2023 13:50:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGM66hmPjSbxVrRndmzPCoJRc/OdJEScaKdtisCLoZlihdRHE/0sLKuwI70DmQ3VgzKCMhy X-Received: by 2002:a05:622a:1302:b0:418:1d1c:ee13 with SMTP id v2-20020a05622a130200b004181d1cee13mr3519970qtk.56.1697835041501; Fri, 20 Oct 2023 13:50:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835041; cv=none; d=google.com; s=arc-20160816; b=WkVgaEbtAhYSpSrOJew72m+p9ewftL1EKCmbM2n21vA9yw8prvmSdzbwlbAbY9VZ0i Efcj75IB+lUW7RynzkGXJc79Os8DBlT5JmHAtxxjLXLb9699Cznyk8HtQDSxGGTrYJwE nGU4XE7OfJ5M80gvxIPdB+LxeSCvTu+gLIkP5+zn/b0HM2LcMgwFXvbUD+yY6IlM2gqU aHWGNPhWBmwq97WBgh93v/wezP7mSkaOr04ePhkjHapailWpIgOtqRb+i54kjzNuSrTF E4y+XR5XEpCsfU4QvC0Gwy0GvuPioFzl4qdIPMps2nJ6l7xo1Ml2Js9g6rMZfLiJn4Y2 NvkQ== 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=Kpdf7cOB1galYRUWIQJoZgm3BMmx0l8/le6WtehZMVk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=rtZHE+i8gifOZzAKCiuITuZRRwY6GiM3FZsTfKmX3GhpNz0pTPyjsL6ZJlnXl14DiI uL/iCw3uIDKOMEwXLG9hULZ6Kq7cm5Jd5M287+4CJymO6/FvLLFfkenbeZZLKTF71UMq El9RIqtKsBQaDqjmPOv05sOmpgW+4gUTYnuumpuPZJTFZOdaVG7a9Oag7hWw/2in6bHX KVwI+My5sRJCxFUsFNUkXEQ1AHVj5QxbziTH3o8olVhlB1Rhvox8aiMATXLT1lEJahRU nmhvzI4xbcUkyhprxBtY7r6gq/wRIzJn60wnnjDDomm7qMKm/UD9hpRDmBsiGW/mXydH JUiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y5D79em5; 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 h1-20020ac87d41000000b0041b940923d7si1975731qtb.261.2023.10.20.13.50.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50:41 -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=y5D79em5; 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 1qtwOw-0001pO-Da; Fri, 20 Oct 2023 16:47:22 -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 1qtwOu-0001oe-SP for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:20 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOq-0001B0-VP for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:20 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5b5354da665so842065a12.2 for ; Fri, 20 Oct 2023 13:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834835; x=1698439635; 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=Kpdf7cOB1galYRUWIQJoZgm3BMmx0l8/le6WtehZMVk=; b=y5D79em5XkqR6Pqq7M00OM3UtGT4sd/u3Lte0Ss4t67kQgzdKIhmDP5MO86kivV6zc kJtUKFcSed9NfvuG+1K9q/X9gmHLp9m48ohyOt0YTKuY//3MYLUH98CAHGX+WT5YWgKd O3mEpACUyWXawB9CYM3iICFHFoveUWGCYgNEC4IvDdqZu1pBVSnWlLXg/0gbW7aG04a0 RScrCWGx3v4sttdMTjpYQz5eqCrPjz6vN11gsu32kxoThxJ6osM8Hh27FX7QZmxVrRlF QrXOeuhr5wYrmUYKJKG8sNM+M5cljqspFAQhni0nQcrmVEz6Gy+HlPTYEgNH/eqNdCxI SPHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834835; x=1698439635; 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=Kpdf7cOB1galYRUWIQJoZgm3BMmx0l8/le6WtehZMVk=; b=J1iMCIwNeS6Nqzq/IDVHMdtgWnfGBgF4X8+SRbaQeDZzf4nli+E7Ju1oFEORiGh9q9 YahRWFIW2UbOPfBVnD4p9bDaX4tT5n126L21NiYyB9wsp+EZQXG9C0Ehdp5KRklUaTeR GuBkxmuIqRpQwpnQMqQwadRsjmd6EN+OYApMthmF8Xxda8rB3YXkCBly9tU+r7oVyPJO gTpJ9Cq1x1J1KuERDy4iueGKoQ//yvq0VctGYx2orxq1NWMgGH+NuNO5g+rKM/+lGEHr tQS1HBiJaIo1UcvCHUe2fa2mFQo5nCZpFvf9zLvIQCtfEMFfjaQyHp3f77+QtyQBzGGQ +9pg== X-Gm-Message-State: AOJu0YzwbajKHRwdReTtjDGfxWHOKlXTtjxhLKIo5dM1HFKGBtOfIKgu DgYbZsHeCg/C46YKx2h63wQRiY50d5zdoOaQeVM= X-Received: by 2002:a05:6a20:7489:b0:161:ffbf:d949 with SMTP id p9-20020a056a20748900b00161ffbfd949mr3132410pzd.3.1697834835271; Fri, 20 Oct 2023 13:47:15 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 47/65] target/hppa: Remove TARGET_REGISTER_BITS Date: Fri, 20 Oct 2023 13:43:13 -0700 Message-Id: <20231020204331.139847-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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 Rely only on TARGET_LONG_BITS, fixed at 64, and hppa_is_pa20. Signed-off-by: Richard Henderson --- target/hppa/cpu-param.h | 1 - target/hppa/cpu.h | 50 ++++------- target/hppa/helper.h | 49 +++++------ target/hppa/cpu.c | 2 +- target/hppa/helper.c | 34 +++----- target/hppa/int_helper.c | 17 ++-- target/hppa/machine.c | 9 -- target/hppa/mem_helper.c | 10 +-- target/hppa/op_helper.c | 30 +++---- target/hppa/sys_helper.c | 4 +- target/hppa/translate.c | 184 ++++++++------------------------------- 11 files changed, 119 insertions(+), 271 deletions(-) diff --git a/target/hppa/cpu-param.h b/target/hppa/cpu-param.h index 2fb8e7924b..6746869a3b 100644 --- a/target/hppa/cpu-param.h +++ b/target/hppa/cpu-param.h @@ -9,7 +9,6 @@ #define HPPA_CPU_PARAM_H #define TARGET_LONG_BITS 64 -#define TARGET_REGISTER_BITS 64 #if defined(CONFIG_USER_ONLY) && defined(TARGET_ABI32) # define TARGET_PHYS_ADDR_SPACE_BITS 32 diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 8320f82464..c9a9b9d3be 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -141,22 +141,10 @@ #define CR_IPSW 22 #define CR_EIRR 23 -#if TARGET_REGISTER_BITS == 32 -typedef uint32_t target_ureg; -typedef int32_t target_sreg; -#define TREG_FMT_lx "%08"PRIx32 -#define TREG_FMT_ld "%"PRId32 -#else -typedef uint64_t target_ureg; -typedef int64_t target_sreg; -#define TREG_FMT_lx "%016"PRIx64 -#define TREG_FMT_ld "%"PRId64 -#endif - typedef struct { uint64_t va_b; uint64_t va_e; - target_ureg pa; + target_ulong pa; unsigned u : 1; unsigned t : 1; unsigned d : 1; @@ -170,16 +158,16 @@ typedef struct { } hppa_tlb_entry; typedef struct CPUArchState { - target_ureg iaoq_f; /* front */ - target_ureg iaoq_b; /* back, aka next instruction */ + target_ulong iaoq_f; /* front */ + target_ulong iaoq_b; /* back, aka next instruction */ - target_ureg gr[32]; + target_ulong gr[32]; uint64_t fr[32]; uint64_t sr[8]; /* stored shifted into place for gva */ - target_ureg psw; /* All psw bits except the following: */ - target_ureg psw_n; /* boolean */ - target_sreg psw_v; /* in most significant bit */ + target_ulong psw; /* All psw bits except the following: */ + target_ulong psw_n; /* boolean */ + target_long psw_v; /* in most significant bit */ /* Splitting the carry-borrow field into the MSB and "the rest", allows * for "the rest" to be deleted when it is unused, but the MSB is in use. @@ -188,8 +176,8 @@ typedef struct CPUArchState { * host has the appropriate add-with-carry insn to compute the msb). * Therefore the carry bits are stored as: cb_msb : cb & 0x11111110. */ - target_ureg psw_cb; /* in least significant bit of next nibble */ - target_ureg psw_cb_msb; /* boolean */ + target_ulong psw_cb; /* in least significant bit of next nibble */ + target_ulong psw_cb_msb; /* boolean */ uint64_t iasq_f; uint64_t iasq_b; @@ -197,9 +185,9 @@ typedef struct CPUArchState { uint32_t fr0_shadow; /* flags, c, ca/cq, rm, d, enables */ float_status fp_status; - target_ureg cr[32]; /* control registers */ - target_ureg cr_back[2]; /* back of cr17/cr18 */ - target_ureg shadow[7]; /* shadow registers */ + target_ulong cr[32]; /* control registers */ + target_ulong cr_back[2]; /* back of cr17/cr18 */ + target_ulong shadow[7]; /* shadow registers */ /* * ??? The number of entries isn't specified by the architecture. @@ -258,8 +246,8 @@ void hppa_translate_init(void); #define CPU_RESOLVING_TYPE TYPE_HPPA_CPU -static inline target_ulong hppa_form_gva_psw(target_ureg psw, uint64_t spc, - target_ureg off) +static inline target_ulong hppa_form_gva_psw(target_ulong psw, uint64_t spc, + target_ulong off) { #ifdef CONFIG_USER_ONLY return off; @@ -270,7 +258,7 @@ static inline target_ulong hppa_form_gva_psw(target_ureg psw, uint64_t spc, } static inline target_ulong hppa_form_gva(CPUHPPAState *env, uint64_t spc, - target_ureg off) + target_ulong off) { return hppa_form_gva_psw(env->psw, spc, off); } @@ -314,8 +302,8 @@ static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, which is the primary case we care about -- using goto_tb within a page. Failure is indicated by a zero difference. */ if (env->iasq_f == env->iasq_b) { - target_sreg diff = env->iaoq_b - env->iaoq_f; - if (TARGET_REGISTER_BITS == 32 || diff == (int32_t)diff) { + target_long diff = env->iaoq_b - env->iaoq_f; + if (diff == (int32_t)diff) { *cs_base |= (uint32_t)diff; } } @@ -329,8 +317,8 @@ static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, *pflags = flags; } -target_ureg cpu_hppa_get_psw(CPUHPPAState *env); -void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg); +target_ulong cpu_hppa_get_psw(CPUHPPAState *env); +void cpu_hppa_put_psw(CPUHPPAState *env, target_ulong); void cpu_hppa_loaded_fr0(CPUHPPAState *env); #ifdef CONFIG_USER_ONLY diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 58b6754dbe..4b2c66316f 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -1,29 +1,20 @@ -#if TARGET_REGISTER_BITS == 64 -# define dh_alias_tr i64 -# define dh_typecode_tr dh_typecode_i64 -#else -# define dh_alias_tr i32 -# define dh_typecode_tr dh_typecode_i32 -#endif -#define dh_ctype_tr target_ureg - DEF_HELPER_2(excp, noreturn, env, int) -DEF_HELPER_FLAGS_2(tsv, TCG_CALL_NO_WG, void, env, tr) -DEF_HELPER_FLAGS_2(tcond, TCG_CALL_NO_WG, void, env, tr) +DEF_HELPER_FLAGS_2(tsv, TCG_CALL_NO_WG, void, env, tl) +DEF_HELPER_FLAGS_2(tcond, TCG_CALL_NO_WG, void, env, tl) -DEF_HELPER_FLAGS_3(stby_b, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stby_b, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tl) -DEF_HELPER_FLAGS_3(stdby_b, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stdby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stdby_e, TCG_CALL_NO_WG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(stdby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_3(stdby_b, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stdby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stdby_e, TCG_CALL_NO_WG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(stdby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tl) DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) -DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32) +DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tl, env, tl, i32, i32) DEF_HELPER_FLAGS_1(loaded_fr0, TCG_CALL_NO_RWG, void, env) @@ -82,7 +73,7 @@ DEF_HELPER_FLAGS_4(fmpynfadd_s, TCG_CALL_NO_RWG, i32, env, i32, i32, i32) DEF_HELPER_FLAGS_4(fmpyfadd_d, TCG_CALL_NO_RWG, i64, env, i64, i64, i64) DEF_HELPER_FLAGS_4(fmpynfadd_d, TCG_CALL_NO_RWG, i64, env, i64, i64, i64) -DEF_HELPER_FLAGS_0(read_interval_timer, TCG_CALL_NO_RWG, tr) +DEF_HELPER_FLAGS_0(read_interval_timer, TCG_CALL_NO_RWG, tl) #ifndef CONFIG_USER_ONLY DEF_HELPER_1(halt, noreturn, env) @@ -90,16 +81,16 @@ DEF_HELPER_1(reset, noreturn, env) DEF_HELPER_1(getshadowregs, void, env) DEF_HELPER_1(rfi, void, env) DEF_HELPER_1(rfi_r, void, env) -DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tr) -DEF_HELPER_FLAGS_2(write_eirr, TCG_CALL_NO_RWG, void, env, tr) -DEF_HELPER_FLAGS_2(write_eiem, TCG_CALL_NO_RWG, void, env, tr) -DEF_HELPER_FLAGS_2(swap_system_mask, TCG_CALL_NO_RWG, tr, env, tr) -DEF_HELPER_FLAGS_3(itlba_pa11, TCG_CALL_NO_RWG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(itlbp_pa11, TCG_CALL_NO_RWG, void, env, tl, tr) -DEF_HELPER_FLAGS_3(itlbt_pa20, TCG_CALL_NO_RWG, void, env, tr, tr) +DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tl) +DEF_HELPER_FLAGS_2(write_eirr, TCG_CALL_NO_RWG, void, env, tl) +DEF_HELPER_FLAGS_2(write_eiem, TCG_CALL_NO_RWG, void, env, tl) +DEF_HELPER_FLAGS_2(swap_system_mask, TCG_CALL_NO_RWG, tl, env, tl) +DEF_HELPER_FLAGS_3(itlba_pa11, TCG_CALL_NO_RWG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(itlbp_pa11, TCG_CALL_NO_RWG, void, env, tl, tl) +DEF_HELPER_FLAGS_3(itlbt_pa20, TCG_CALL_NO_RWG, void, env, tl, tl) DEF_HELPER_FLAGS_2(ptlb, TCG_CALL_NO_RWG, void, env, tl) DEF_HELPER_FLAGS_1(ptlbe, TCG_CALL_NO_RWG, void, env) -DEF_HELPER_FLAGS_2(lpa, TCG_CALL_NO_WG, tr, env, tl) +DEF_HELPER_FLAGS_2(lpa, TCG_CALL_NO_WG, tl, env, tl) DEF_HELPER_FLAGS_1(change_prot_id, TCG_CALL_NO_RWG, void, env) DEF_HELPER_1(diag_btlb, void, env) #endif diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 36875a6a1a..95abe1ff17 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -77,7 +77,7 @@ static void hppa_restore_state_to_opc(CPUState *cs, HPPACPU *cpu = HPPA_CPU(cs); cpu->env.iaoq_f = data[0]; - if (data[1] != (target_ureg)-1) { + if (data[1] != (target_ulong)-1) { cpu->env.iaoq_b = data[1]; } /* diff --git a/target/hppa/helper.c b/target/hppa/helper.c index a2ae7aca30..fe7d8c2664 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -25,31 +25,25 @@ #include "exec/helper-proto.h" #include "qemu/qemu-print.h" -target_ureg cpu_hppa_get_psw(CPUHPPAState *env) +target_ulong cpu_hppa_get_psw(CPUHPPAState *env) { - target_ureg psw; - target_ureg mask1 = (target_ureg)-1 / 0xf; - target_ureg maskf = (target_ureg)-1 / 0xffff * 0xf; + target_ulong psw; + target_ulong mask1 = (target_ulong)-1 / 0xf; + target_ulong maskf = (target_ulong)-1 / 0xffff * 0xf; /* Fold carry bits down to 8 consecutive bits. */ /* ^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^i^^^j^^^k^^^l^^^m^^^n^^^o^^^p^^^^ */ - /* ^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^^ */ psw = (env->psw_cb >> 4) & mask1; /* .......b...c...d...e...f...g...h...i...j...k...l...m...n...o...p */ - /* .......b...c...d...e...f...g...h */ psw |= psw >> 3; /* .......b..bc..cd..de..ef..fg..gh..hi..ij..jk..kl..lm..mn..no..op */ - /* .......b..bc..cd..de..ef..fg..gh */ psw |= psw >> 6; psw &= maskf; /* .............bcd............efgh............ijkl............mnop */ - /* .............bcd............efgh */ psw |= psw >> 12; /* .............bcd.........bcdefgh........efghijkl........ijklmnop */ - /* .............bcd.........bcdefgh */ - psw |= env->psw_cb_msb << (TARGET_REGISTER_BITS == 64 ? 39 : 7); + psw |= env->psw_cb_msb << 39; /* .............bcd........abcdefgh........efghijkl........ijklmnop */ - /* .............bcd........abcdefgh */ /* For hppa64, the two 8-bit fields are discontiguous. */ if (hppa_is_pa20(env)) { @@ -65,11 +59,11 @@ target_ureg cpu_hppa_get_psw(CPUHPPAState *env) return psw; } -void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) +void cpu_hppa_put_psw(CPUHPPAState *env, target_ulong psw) { uint64_t reserved; - target_ureg old_psw = env->psw; - target_ureg cb = 0; + target_ulong old_psw = env->psw; + target_ulong cb = 0; /* Do not allow reserved bits to be set. */ if (hppa_is_pa20(env)) { @@ -87,9 +81,6 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) env->psw_n = (psw / PSW_N) & 1; env->psw_v = -((psw / PSW_V) & 1); -#if TARGET_REGISTER_BITS == 32 - env->psw_cb_msb = (psw >> 15) & 1; -#else env->psw_cb_msb = (psw >> 39) & 1; cb |= ((psw >> 38) & 1) << 60; cb |= ((psw >> 37) & 1) << 56; @@ -99,7 +90,6 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) cb |= ((psw >> 33) & 1) << 40; cb |= ((psw >> 32) & 1) << 36; cb |= ((psw >> 15) & 1) << 32; -#endif cb |= ((psw >> 14) & 1) << 28; cb |= ((psw >> 13) & 1) << 24; cb |= ((psw >> 12) & 1) << 20; @@ -120,8 +110,8 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) { CPUHPPAState *env = cpu_env(cs); - target_ureg psw = cpu_hppa_get_psw(env); - target_ureg psw_cb; + target_ulong psw = cpu_hppa_get_psw(env); + target_ulong psw_cb; char psw_c[20]; int i, w; uint64_t m; @@ -159,8 +149,8 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) psw_c[16] = (psw & PSW_D ? 'D' : '-'); psw_c[17] = (psw & PSW_I ? 'I' : '-'); psw_c[18] = '\0'; - psw_cb = ((env->psw_cb >> 4) & ((target_ureg)-1 / 0xf)) - | (env->psw_cb_msb << (TARGET_REGISTER_BITS - 4)); + psw_cb = ((env->psw_cb >> 4) & 0x1111111111111111ull) + | (env->psw_cb_msb << 60); qemu_fprintf(f, "PSW %0*" PRIx64 " CB %0*" PRIx64 " %s\n", w, m & psw, w, m & psw_cb, psw_c); diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index 3ab9934a1d..f355c4c76b 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -52,9 +52,9 @@ static void io_eir_write(void *opaque, hwaddr addr, uint64_t data, unsigned size) { HPPACPU *cpu = opaque; - int le_bit = ~data & (TARGET_REGISTER_BITS - 1); + int le_bit = ~data & 31; - cpu->env.cr[CR_EIRR] |= (target_ureg)1 << le_bit; + cpu->env.cr[CR_EIRR] |= (target_ulong)1 << le_bit; eval_interrupt(cpu); } @@ -73,7 +73,7 @@ void hppa_cpu_alarm_timer(void *opaque) io_eir_write(opaque, 0, 0, 4); } -void HELPER(write_eirr)(CPUHPPAState *env, target_ureg val) +void HELPER(write_eirr)(CPUHPPAState *env, target_ulong val) { env->cr[CR_EIRR] &= ~val; qemu_mutex_lock_iothread(); @@ -81,7 +81,7 @@ void HELPER(write_eirr)(CPUHPPAState *env, target_ureg val) qemu_mutex_unlock_iothread(); } -void HELPER(write_eiem)(CPUHPPAState *env, target_ureg val) +void HELPER(write_eiem)(CPUHPPAState *env, target_ulong val) { env->cr[CR_EIEM] = val; qemu_mutex_lock_iothread(); @@ -94,12 +94,11 @@ void hppa_cpu_do_interrupt(CPUState *cs) HPPACPU *cpu = HPPA_CPU(cs); CPUHPPAState *env = &cpu->env; int i = cs->exception_index; - target_ureg iaoq_f = env->iaoq_f; - target_ureg iaoq_b = env->iaoq_b; + target_ulong iaoq_f = env->iaoq_f; + target_ulong iaoq_b = env->iaoq_b; uint64_t iasq_f = env->iasq_f; uint64_t iasq_b = env->iasq_b; - - target_ureg old_psw; + target_ulong old_psw; /* As documented in pa2.0 -- interruption handling. */ /* step 1 */ @@ -240,7 +239,7 @@ void hppa_cpu_do_interrupt(CPUState *cs) name = unknown; } qemu_log("INT %6d: %s @ " TARGET_FMT_lx "," TARGET_FMT_lx - " -> " TREG_FMT_lx " " TARGET_FMT_lx "\n", + " -> " TARGET_FMT_lx " " TARGET_FMT_lx "\n", ++count, name, hppa_form_gva(env, iasq_f, iaoq_f), hppa_form_gva(env, iasq_b, iaoq_b), diff --git a/target/hppa/machine.c b/target/hppa/machine.c index 0c0bba68c0..ab34b72910 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -21,21 +21,12 @@ #include "cpu.h" #include "migration/cpu.h" -#if TARGET_REGISTER_BITS == 64 #define qemu_put_betr qemu_put_be64 #define qemu_get_betr qemu_get_be64 #define VMSTATE_UINTTR_V(_f, _s, _v) \ VMSTATE_UINT64_V(_f, _s, _v) #define VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, _v) \ VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) -#else -#define qemu_put_betr qemu_put_be32 -#define qemu_get_betr qemu_get_be32 -#define VMSTATE_UINTTR_V(_f, _s, _v) \ - VMSTATE_UINT32_V(_f, _s, _v) -#define VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, _v) \ - VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v) -#endif #define VMSTATE_UINTTR(_f, _s) \ VMSTATE_UINTTR_V(_f, _s, 0) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 356746654c..8aa94bb266 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -312,7 +312,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, } /* Insert (Insn/Data) TLB Address. Note this is PA 1.1 only. */ -void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) +void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ulong reg) { hppa_tlb_entry *empty = NULL; int i; @@ -343,7 +343,7 @@ void HELPER(itlba_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) } static void set_access_bits_pa11(CPUHPPAState *env, hppa_tlb_entry *ent, - target_ureg reg) + target_ulong reg) { ent->access_id = extract32(reg, 1, 18); ent->u = extract32(reg, 19, 1); @@ -359,7 +359,7 @@ static void set_access_bits_pa11(CPUHPPAState *env, hppa_tlb_entry *ent, } /* Insert (Insn/Data) TLB Protection. Note this is PA 1.1 only. */ -void HELPER(itlbp_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) +void HELPER(itlbp_pa11)(CPUHPPAState *env, target_ulong addr, target_ulong reg) { hppa_tlb_entry *ent = hppa_find_tlb(env, addr); @@ -370,7 +370,7 @@ void HELPER(itlbp_pa11)(CPUHPPAState *env, target_ulong addr, target_ureg reg) set_access_bits_pa11(env, ent, reg); } -void HELPER(itlbt_pa20)(CPUHPPAState *env, target_ureg r1, target_ureg r2) +void HELPER(itlbt_pa20)(CPUHPPAState *env, target_ulong r1, target_ulong r2) { hppa_tlb_entry *ent, *empty = NULL; vaddr va_b, va_e; @@ -471,7 +471,7 @@ void HELPER(change_prot_id)(CPUHPPAState *env) cpu_hppa_change_prot_id(env); } -target_ureg HELPER(lpa)(CPUHPPAState *env, target_ulong addr) +target_ulong HELPER(lpa)(CPUHPPAState *env, target_ulong addr) { hwaddr phys; int prot, excp; diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 94c9ca5858..0bccca1e11 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -42,14 +42,14 @@ G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t ra) cpu_loop_exit_restore(cs, ra); } -void HELPER(tsv)(CPUHPPAState *env, target_ureg cond) +void HELPER(tsv)(CPUHPPAState *env, target_ulong cond) { - if (unlikely((target_sreg)cond < 0)) { + if (unlikely((target_long)cond < 0)) { hppa_dynamic_excp(env, EXCP_OVERFLOW, GETPC()); } } -void HELPER(tcond)(CPUHPPAState *env, target_ureg cond) +void HELPER(tcond)(CPUHPPAState *env, target_ulong cond) { if (unlikely(cond)) { hppa_dynamic_excp(env, EXCP_COND, GETPC()); @@ -110,7 +110,7 @@ static void atomic_store_mask64(CPUHPPAState *env, target_ulong addr, #endif } -static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ureg val, +static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ulong val, bool parallel, uintptr_t ra) { switch (addr & 3) { @@ -191,29 +191,29 @@ static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val, } } -void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ureg val) +void HELPER(stby_b)(CPUHPPAState *env, target_ulong addr, target_ulong val) { do_stby_b(env, addr, val, false, GETPC()); } void HELPER(stby_b_parallel)(CPUHPPAState *env, target_ulong addr, - target_ureg val) + target_ulong val) { do_stby_b(env, addr, val, true, GETPC()); } -void HELPER(stdby_b)(CPUHPPAState *env, target_ulong addr, target_ureg val) +void HELPER(stdby_b)(CPUHPPAState *env, target_ulong addr, target_ulong val) { do_stdby_b(env, addr, val, false, GETPC()); } void HELPER(stdby_b_parallel)(CPUHPPAState *env, target_ulong addr, - target_ureg val) + target_ulong val) { do_stdby_b(env, addr, val, true, GETPC()); } -static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ureg val, +static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ulong val, bool parallel, uintptr_t ra) { switch (addr & 3) { @@ -301,24 +301,24 @@ static void do_stdby_e(CPUHPPAState *env, target_ulong addr, uint64_t val, } } -void HELPER(stby_e)(CPUHPPAState *env, target_ulong addr, target_ureg val) +void HELPER(stby_e)(CPUHPPAState *env, target_ulong addr, target_ulong val) { do_stby_e(env, addr, val, false, GETPC()); } void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr, - target_ureg val) + target_ulong val) { do_stby_e(env, addr, val, true, GETPC()); } -void HELPER(stdby_e)(CPUHPPAState *env, target_ulong addr, target_ureg val) +void HELPER(stdby_e)(CPUHPPAState *env, target_ulong addr, target_ulong val) { do_stdby_e(env, addr, val, false, GETPC()); } void HELPER(stdby_e_parallel)(CPUHPPAState *env, target_ulong addr, - target_ureg val) + target_ulong val) { do_stdby_e(env, addr, val, true, GETPC()); } @@ -332,7 +332,7 @@ void HELPER(ldc_check)(target_ulong addr) } } -target_ureg HELPER(probe)(CPUHPPAState *env, target_ulong addr, +target_ulong HELPER(probe)(CPUHPPAState *env, target_ulong addr, uint32_t level, uint32_t want) { #ifdef CONFIG_USER_ONLY @@ -364,7 +364,7 @@ target_ureg HELPER(probe)(CPUHPPAState *env, target_ulong addr, #endif } -target_ureg HELPER(read_interval_timer)(void) +target_ulong HELPER(read_interval_timer)(void) { #ifdef CONFIG_USER_ONLY /* In user-mode, QEMU_CLOCK_VIRTUAL doesn't exist. diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index f0dd5a08e7..bb57413199 100644 --- a/target/hppa/sys_helper.c +++ b/target/hppa/sys_helper.c @@ -24,7 +24,7 @@ #include "qemu/timer.h" #include "sysemu/runstate.h" -void HELPER(write_interval_timer)(CPUHPPAState *env, target_ureg val) +void HELPER(write_interval_timer)(CPUHPPAState *env, target_ulong val) { HPPACPU *cpu = env_archcpu(env); uint64_t current = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); @@ -58,7 +58,7 @@ void HELPER(reset)(CPUHPPAState *env) helper_excp(env, EXCP_HLT); } -target_ureg HELPER(swap_system_mask)(CPUHPPAState *env, target_ureg nsm) +target_ulong HELPER(swap_system_mask)(CPUHPPAState *env, target_ulong nsm) { target_ulong psw = env->psw; /* diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2a09e1cdad..96082d1a9c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -40,21 +40,10 @@ #undef tcg_temp_new #undef tcg_global_mem_new -#if TARGET_LONG_BITS == 64 #define TCGv_tl TCGv_i64 #define tcg_temp_new_tl tcg_temp_new_i64 -#if TARGET_REGISTER_BITS == 64 #define tcg_gen_extu_reg_tl tcg_gen_mov_i64 -#else -#define tcg_gen_extu_reg_tl tcg_gen_extu_i32_i64 -#endif -#else -#define TCGv_tl TCGv_i32 -#define tcg_temp_new_tl tcg_temp_new_i32 -#define tcg_gen_extu_reg_tl tcg_gen_mov_i32 -#endif -#if TARGET_REGISTER_BITS == 64 #define TCGv_reg TCGv_i64 #define tcg_temp_new tcg_temp_new_i64 @@ -147,98 +136,6 @@ #define tcg_gen_qemu_st_reg tcg_gen_qemu_st_i64 #define tcg_gen_atomic_xchg_reg tcg_gen_atomic_xchg_i64 #define tcg_gen_trunc_reg_ptr tcg_gen_trunc_i64_ptr -#else -#define TCGv_reg TCGv_i32 -#define tcg_temp_new tcg_temp_new_i32 -#define tcg_global_mem_new tcg_global_mem_new_i32 - -#define tcg_gen_movi_reg tcg_gen_movi_i32 -#define tcg_gen_mov_reg tcg_gen_mov_i32 -#define tcg_gen_ld8u_reg tcg_gen_ld8u_i32 -#define tcg_gen_ld8s_reg tcg_gen_ld8s_i32 -#define tcg_gen_ld16u_reg tcg_gen_ld16u_i32 -#define tcg_gen_ld16s_reg tcg_gen_ld16s_i32 -#define tcg_gen_ld32u_reg tcg_gen_ld_i32 -#define tcg_gen_ld32s_reg tcg_gen_ld_i32 -#define tcg_gen_ld_reg tcg_gen_ld_i32 -#define tcg_gen_st8_reg tcg_gen_st8_i32 -#define tcg_gen_st16_reg tcg_gen_st16_i32 -#define tcg_gen_st32_reg tcg_gen_st32_i32 -#define tcg_gen_st_reg tcg_gen_st_i32 -#define tcg_gen_add_reg tcg_gen_add_i32 -#define tcg_gen_addi_reg tcg_gen_addi_i32 -#define tcg_gen_sub_reg tcg_gen_sub_i32 -#define tcg_gen_neg_reg tcg_gen_neg_i32 -#define tcg_gen_subfi_reg tcg_gen_subfi_i32 -#define tcg_gen_subi_reg tcg_gen_subi_i32 -#define tcg_gen_and_reg tcg_gen_and_i32 -#define tcg_gen_andi_reg tcg_gen_andi_i32 -#define tcg_gen_or_reg tcg_gen_or_i32 -#define tcg_gen_ori_reg tcg_gen_ori_i32 -#define tcg_gen_xor_reg tcg_gen_xor_i32 -#define tcg_gen_xori_reg tcg_gen_xori_i32 -#define tcg_gen_not_reg tcg_gen_not_i32 -#define tcg_gen_shl_reg tcg_gen_shl_i32 -#define tcg_gen_shli_reg tcg_gen_shli_i32 -#define tcg_gen_shr_reg tcg_gen_shr_i32 -#define tcg_gen_shri_reg tcg_gen_shri_i32 -#define tcg_gen_sar_reg tcg_gen_sar_i32 -#define tcg_gen_sari_reg tcg_gen_sari_i32 -#define tcg_gen_brcond_reg tcg_gen_brcond_i32 -#define tcg_gen_brcondi_reg tcg_gen_brcondi_i32 -#define tcg_gen_setcond_reg tcg_gen_setcond_i32 -#define tcg_gen_setcondi_reg tcg_gen_setcondi_i32 -#define tcg_gen_mul_reg tcg_gen_mul_i32 -#define tcg_gen_muli_reg tcg_gen_muli_i32 -#define tcg_gen_div_reg tcg_gen_div_i32 -#define tcg_gen_rem_reg tcg_gen_rem_i32 -#define tcg_gen_divu_reg tcg_gen_divu_i32 -#define tcg_gen_remu_reg tcg_gen_remu_i32 -#define tcg_gen_discard_reg tcg_gen_discard_i32 -#define tcg_gen_trunc_reg_i32 tcg_gen_mov_i32 -#define tcg_gen_trunc_i64_reg tcg_gen_extrl_i64_i32 -#define tcg_gen_extu_i32_reg tcg_gen_mov_i32 -#define tcg_gen_ext_i32_reg tcg_gen_mov_i32 -#define tcg_gen_extu_reg_i64 tcg_gen_extu_i32_i64 -#define tcg_gen_ext_reg_i64 tcg_gen_ext_i32_i64 -#define tcg_gen_ext8u_reg tcg_gen_ext8u_i32 -#define tcg_gen_ext8s_reg tcg_gen_ext8s_i32 -#define tcg_gen_ext16u_reg tcg_gen_ext16u_i32 -#define tcg_gen_ext16s_reg tcg_gen_ext16s_i32 -#define tcg_gen_ext32u_reg tcg_gen_mov_i32 -#define tcg_gen_ext32s_reg tcg_gen_mov_i32 -#define tcg_gen_bswap16_reg tcg_gen_bswap16_i32 -#define tcg_gen_bswap32_reg tcg_gen_bswap32_i32 -#define tcg_gen_concat_reg_i64 tcg_gen_concat_i32_i64 -#define tcg_gen_andc_reg tcg_gen_andc_i32 -#define tcg_gen_eqv_reg tcg_gen_eqv_i32 -#define tcg_gen_nand_reg tcg_gen_nand_i32 -#define tcg_gen_nor_reg tcg_gen_nor_i32 -#define tcg_gen_orc_reg tcg_gen_orc_i32 -#define tcg_gen_clz_reg tcg_gen_clz_i32 -#define tcg_gen_ctz_reg tcg_gen_ctz_i32 -#define tcg_gen_clzi_reg tcg_gen_clzi_i32 -#define tcg_gen_ctzi_reg tcg_gen_ctzi_i32 -#define tcg_gen_clrsb_reg tcg_gen_clrsb_i32 -#define tcg_gen_ctpop_reg tcg_gen_ctpop_i32 -#define tcg_gen_rotl_reg tcg_gen_rotl_i32 -#define tcg_gen_rotli_reg tcg_gen_rotli_i32 -#define tcg_gen_rotr_reg tcg_gen_rotr_i32 -#define tcg_gen_rotri_reg tcg_gen_rotri_i32 -#define tcg_gen_deposit_reg tcg_gen_deposit_i32 -#define tcg_gen_deposit_z_reg tcg_gen_deposit_z_i32 -#define tcg_gen_extract_reg tcg_gen_extract_i32 -#define tcg_gen_sextract_reg tcg_gen_sextract_i32 -#define tcg_gen_extract2_reg tcg_gen_extract2_i32 -#define tcg_constant_reg tcg_constant_i32 -#define tcg_gen_movcond_reg tcg_gen_movcond_i32 -#define tcg_gen_add2_reg tcg_gen_add2_i32 -#define tcg_gen_sub2_reg tcg_gen_sub2_i32 -#define tcg_gen_qemu_ld_reg tcg_gen_qemu_ld_i32 -#define tcg_gen_qemu_st_reg tcg_gen_qemu_st_i32 -#define tcg_gen_atomic_xchg_reg tcg_gen_atomic_xchg_i32 -#define tcg_gen_trunc_reg_ptr tcg_gen_ext_i32_ptr -#endif /* TARGET_REGISTER_BITS */ typedef struct DisasCond { TCGCond c; @@ -249,9 +146,9 @@ typedef struct DisasContext { DisasContextBase base; CPUState *cs; - target_ureg iaoq_f; - target_ureg iaoq_b; - target_ureg iaoq_n; + uint64_t iaoq_f; + uint64_t iaoq_b; + uint64_t iaoq_n; TCGv_reg iaoq_n_var; DisasCond null_cond; @@ -727,7 +624,7 @@ static bool nullify_end(DisasContext *ctx) return true; } -static void copy_iaoq_entry(TCGv_reg dest, target_ureg ival, TCGv_reg vval) +static void copy_iaoq_entry(TCGv_reg dest, uint64_t ival, TCGv_reg vval) { if (unlikely(ival == -1)) { tcg_gen_mov_reg(dest, vval); @@ -736,7 +633,7 @@ static void copy_iaoq_entry(TCGv_reg dest, target_ureg ival, TCGv_reg vval) } } -static inline target_ureg iaoq_dest(DisasContext *ctx, target_sreg disp) +static inline uint64_t iaoq_dest(DisasContext *ctx, int64_t disp) { return ctx->iaoq_f + disp + 8; } @@ -781,14 +678,14 @@ static bool gen_illegal(DisasContext *ctx) } while (0) #endif -static target_ureg gva_offset_mask(DisasContext *ctx) +static uint64_t gva_offset_mask(DisasContext *ctx) { return (ctx->tb_flags & PSW_W ? MAKE_64BIT_MASK(0, 62) : MAKE_64BIT_MASK(0, 32)); } -static bool use_goto_tb(DisasContext *ctx, target_ureg dest) +static bool use_goto_tb(DisasContext *ctx, uint64_t dest) { return translator_use_goto_tb(&ctx->base, dest); } @@ -804,7 +701,7 @@ static bool use_nullify_skip(DisasContext *ctx) } static void gen_goto_tb(DisasContext *ctx, int which, - target_ureg f, target_ureg b) + uint64_t f, uint64_t b) { if (f != -1 && b != -1 && use_goto_tb(ctx, f)) { tcg_gen_goto_tb(which); @@ -831,7 +728,7 @@ static bool cond_need_cb(int c) /* Need extensions from TCGv_i32 to TCGv_reg. */ static bool cond_need_ext(DisasContext *ctx, bool d) { - return TARGET_REGISTER_BITS == 64 && !(ctx->is_pa20 && d); + return !(ctx->is_pa20 && d); } /* @@ -882,7 +779,7 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, tcg_gen_and_reg(tmp, tmp, res); tcg_gen_ext32u_reg(tmp, tmp); } else { - tcg_gen_sari_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); + tcg_gen_sari_reg(tmp, tmp, 63); tcg_gen_and_reg(tmp, tmp, res); } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); @@ -1078,7 +975,7 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, { DisasCond cond; TCGv_reg tmp, cb = NULL; - target_ureg d_repl = d ? 0x0000000100000001ull : 1; + uint64_t d_repl = d ? 0x0000000100000001ull : 1; if (cf & 8) { /* Since we want to test lots of carry-out bits all at once, do not @@ -1509,7 +1406,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) #endif static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, - unsigned rb, unsigned rx, int scale, target_sreg disp, + unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, bool is_phys) { TCGv_reg base = load_gpr(ctx, rb); @@ -1545,7 +1442,7 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, * = 0 for no base register update. */ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg ofs; @@ -1563,7 +1460,7 @@ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb, } static void do_load_64(DisasContext *ctx, TCGv_i64 dest, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg ofs; @@ -1581,7 +1478,7 @@ static void do_load_64(DisasContext *ctx, TCGv_i64 dest, unsigned rb, } static void do_store_32(DisasContext *ctx, TCGv_i32 src, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg ofs; @@ -1599,7 +1496,7 @@ static void do_store_32(DisasContext *ctx, TCGv_i32 src, unsigned rb, } static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg ofs; @@ -1616,16 +1513,11 @@ static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb, } } -#if TARGET_REGISTER_BITS == 64 #define do_load_reg do_load_64 #define do_store_reg do_store_64 -#else -#define do_load_reg do_load_32 -#define do_store_reg do_store_32 -#endif static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { TCGv_reg dest; @@ -1646,7 +1538,7 @@ static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, } static bool do_floadw(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify) { TCGv_i32 tmp; @@ -1671,7 +1563,7 @@ static bool trans_fldw(DisasContext *ctx, arg_ldst *a) } static bool do_floadd(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify) { TCGv_i64 tmp; @@ -1696,7 +1588,7 @@ static bool trans_fldd(DisasContext *ctx, arg_ldst *a) } static bool do_store(DisasContext *ctx, unsigned rt, unsigned rb, - target_sreg disp, unsigned sp, + int64_t disp, unsigned sp, int modify, MemOp mop) { nullify_over(ctx); @@ -1705,7 +1597,7 @@ static bool do_store(DisasContext *ctx, unsigned rt, unsigned rb, } static bool do_fstorew(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify) { TCGv_i32 tmp; @@ -1725,7 +1617,7 @@ static bool trans_fstw(DisasContext *ctx, arg_ldst *a) } static bool do_fstored(DisasContext *ctx, unsigned rt, unsigned rb, - unsigned rx, int scale, target_sreg disp, + unsigned rx, int scale, int64_t disp, unsigned sp, int modify) { TCGv_i64 tmp; @@ -1838,7 +1730,7 @@ static bool do_fop_dedd(DisasContext *ctx, unsigned rt, /* Emit an unconditional branch to a direct target, which may or may not have already had nullification handled. */ -static bool do_dbranch(DisasContext *ctx, target_ureg dest, +static bool do_dbranch(DisasContext *ctx, uint64_t dest, unsigned link, bool is_n) { if (ctx->null_cond.c == TCG_COND_NEVER && ctx->null_lab == NULL) { @@ -1875,10 +1767,10 @@ static bool do_dbranch(DisasContext *ctx, target_ureg dest, /* Emit a conditional branch to a direct target. If the branch itself is nullified, we should have already used nullify_over. */ -static bool do_cbranch(DisasContext *ctx, target_sreg disp, bool is_n, +static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, DisasCond *cond) { - target_ureg dest = iaoq_dest(ctx, disp); + uint64_t dest = iaoq_dest(ctx, disp); TCGLabel *taken = NULL; TCGCond c = cond->c; bool n; @@ -2839,7 +2731,7 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) if (!is_i) { tcg_gen_not_reg(tmp, tmp); } - tcg_gen_andi_reg(tmp, tmp, (target_ureg)0x1111111111111111ull); + tcg_gen_andi_reg(tmp, tmp, (uint64_t)0x1111111111111111ull); tcg_gen_muli_reg(tmp, tmp, 6); do_unit(ctx, a->t, load_gpr(ctx, a->r), tmp, a->cf, a->d, false, is_i ? tcg_gen_add_reg : tcg_gen_sub_reg); @@ -2961,22 +2853,20 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf_d *a) static bool trans_ld(DisasContext *ctx, arg_ldst *a) { - if (unlikely(TARGET_REGISTER_BITS == 32 && a->size > MO_32)) { + if (!ctx->is_pa20 && a->size > MO_32) { return gen_illegal(ctx); - } else { - return do_load(ctx, a->t, a->b, a->x, a->scale ? a->size : 0, - a->disp, a->sp, a->m, a->size | MO_TE); } + return do_load(ctx, a->t, a->b, a->x, a->scale ? a->size : 0, + a->disp, a->sp, a->m, a->size | MO_TE); } static bool trans_st(DisasContext *ctx, arg_ldst *a) { assert(a->x == 0 && a->scale == 0); - if (unlikely(TARGET_REGISTER_BITS == 32 && a->size > MO_32)) { + if (!ctx->is_pa20 && a->size > MO_32) { return gen_illegal(ctx); - } else { - return do_store(ctx, a->t, a->b, a->disp, a->sp, a->m, a->size | MO_TE); } + return do_store(ctx, a->t, a->b, a->disp, a->sp, a->m, a->size | MO_TE); } static bool trans_ldc(DisasContext *ctx, arg_ldst *a) @@ -2985,7 +2875,7 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) TCGv_reg zero, dest, ofs; TCGv_tl addr; - if (unlikely(TARGET_REGISTER_BITS == 32 && a->size > MO_32)) { + if (!ctx->is_pa20 && a->size > MO_32) { return gen_illegal(ctx); } @@ -3394,7 +3284,7 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) t2 = load_gpr(ctx, a->r2); if (a->r1 == 0) { tcg_gen_extract_reg(dest, t2, sa, width - sa); - } else if (width == TARGET_REGISTER_BITS) { + } else if (width == TARGET_LONG_BITS) { tcg_gen_extract2_reg(dest, t2, cpu_gr[a->r1], sa); } else { assert(!a->d); @@ -3496,7 +3386,7 @@ static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) { unsigned len, width; - target_sreg mask0, mask1; + uint64_t mask0, mask1; TCGv_reg dest; if (!ctx->is_pa20 && a->d) { @@ -3575,7 +3465,7 @@ static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, unsigned rs = nz ? rt : 0; unsigned widthm1 = d ? 63 : 31; TCGv_reg mask, tmp, shift, dest; - target_ureg msb = 1ULL << (len - 1); + uint64_t msb = 1ULL << (len - 1); dest = dest_gpr(ctx, rt); shift = tcg_temp_new(); @@ -3691,7 +3581,7 @@ static bool trans_bl(DisasContext *ctx, arg_bl *a) static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) { - target_ureg dest = iaoq_dest(ctx, a->disp); + uint64_t dest = iaoq_dest(ctx, a->disp); nullify_over(ctx); @@ -3819,7 +3709,7 @@ static bool trans_fid_f(DisasContext *ctx, arg_fid_f *a) { uint64_t ret; - if (TARGET_REGISTER_BITS == 64) { + if (ctx->is_pa20) { ret = 0x13080000000000ULL; /* PA8700 (PCX-W2) */ } else { ret = 0x0f080000000000ULL; /* PA7300LC (PCX-L2) */ From patchwork Fri Oct 20 20:43:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736329 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502837wrl; Fri, 20 Oct 2023 13:51:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2ANa+MqKLrAnfB+ThNfHoCZvIorNYh1mo8gOP7TOZvoxq1/0nDCMzltbUc+9Pw0haA7Fq X-Received: by 2002:a67:c187:0:b0:457:c49c:bc63 with SMTP id h7-20020a67c187000000b00457c49cbc63mr3509372vsj.6.1697835080133; Fri, 20 Oct 2023 13:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835080; cv=none; d=google.com; s=arc-20160816; b=bAyX+FDMUGlDZencKB5FMomm2oJNztFR/YlI+ooqrzX5V0yFiKlortxHUIl1Elsa+5 +iCuh3f5p3WJmUBgO+rU5YDTrSNioq+mUSq5Ng7obE4Hh9v1wTZTes445ozGUbVkcP4x 2hcQyuhEVHXuQqhR0mtS1+qCTUOYfiG45rP4/Q50ar885bYkYiE08EZ9cght7mpMSTUM z8XAOU85/54ffLfYhCrl6BHdfNxU5DPa3G8vdbh+L1J1VwfZNWAdN2U7Om0wdS0Gfaoc DY9feHN1n4aVIKh6mP7ihvMFSsJQPovMBMAEwpkl5F+ItVDwQSBgAO8yfXdvUB1lpggS DhnQ== 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=7bkVAzjRQljffeKZVdpz1fr9I9jbCd/N9DGSdds6v4Y=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=LfRmAZ2cYTTIwHAq12RRxSuRgK3kakCc+Vc34f5lRK2gZn3eCMLQyx2F/38BTa0fmX YauJoUYBLO7ap0A1wysjMxXUb7/kCkve2l+Jm3hkPJTwnNnE96hOMJt+L553BFXC5Bsk 330WeEQcKLHmNlHWXnASiYJMw5D1bH5d9769J93Rm3s7FgJMuOfe7wj3WXjRHNEUf0/X 9OJxF7ywaEJShvyPMrjlohhDnCGveslh46QYv4IXhJKx8Z//hghqxG2yYRcZ5xTMQZP8 8P3cl9mLsVKUlePP5PDQ2M/hX6k0FSGx+8OO20p4+HRQkC1n1BddONb7d2uuo3FJTWeu gDsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CR8zQQXB; 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 w16-20020a05622a135000b004178eb52789si1782498qtk.316.2023.10.20.13.51.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:20 -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=CR8zQQXB; 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 1qtwOy-0001ws-Ln; Fri, 20 Oct 2023 16:47:24 -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 1qtwOw-0001pV-JQ for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:22 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOs-0001BJ-20 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:22 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b709048f32so1138100b3a.0 for ; Fri, 20 Oct 2023 13:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834837; x=1698439637; 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=7bkVAzjRQljffeKZVdpz1fr9I9jbCd/N9DGSdds6v4Y=; b=CR8zQQXBwy0xqkv7QJjGCBeWKxxLbF/v0D5tnx77kkc/xsufwpIyPc0rSm8PCtFduG q72Sc2GOtb0Sw5IIJb5SBc5pJqS/8XZos6/rp9647ORhfeApKJ/LT4Jf1w1ElMQhjqrY h7encq+BLPqTQEux4gsbBtZipNXW9s+Qm7qKuOECRLcAGs4/J6QzQ59L+kNzqainQ+aW J2zFBvxqS55BE5mchou76Y91zGlGMrESVZ/IwQyIFlebD3mptVKocboHsqFXHMkKm/BB wZEVK/fbgVVPmAKwPKmmI2OL/q65jKmuaNFYiJD+VF1Xn0D2a4TYZKUipurUdtmsyFr+ opOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834837; x=1698439637; 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=7bkVAzjRQljffeKZVdpz1fr9I9jbCd/N9DGSdds6v4Y=; b=a3w3BGVyP488NHrGYdW/fqDnqFPekpbkB83dPwAjnAoy89AHqrKPytbg0CspQDIB2r 7g/CRCJljxFA8gi/1ZDO9Hen3DlfcfwKUSznmHiufS4fDr4n5zCz7EAXMakDf+SRz4kX bbu0qGrw70HZL0/h2e840py+gYXQ1aMdXkQzqyYaa7OuoZCP7m10wGhp1sGdLW0ci/cZ p+edbLYwCIbTYz3lncElb6kP2abv/lB/aB5aE4/Z56wNZnAPLuU6g5OAGxxRjzjdH71H DhgIZXI1xdqkzBCppq4XutNtauVfOwW+e82lccS5VorwPCoeliYwRYbXCv/DEXQmwXob CJcw== X-Gm-Message-State: AOJu0YybTfIefgiimY0ErQIwYk9hCaWPTUOFPb4cUjZ0R+8Il5JNQQNK sD4t2ugZr+13zD8HhoWYp0vT0KRSTX7m5WakwBs= X-Received: by 2002:a05:6a00:c93:b0:6b3:81ee:9bc with SMTP id a19-20020a056a000c9300b006b381ee09bcmr2921083pfv.27.1697834836131; Fri, 20 Oct 2023 13:47:16 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 48/65] target/hppa: Remove most of the TARGET_REGISTER_BITS redirections Date: Fri, 20 Oct 2023 13:43:14 -0700 Message-Id: <20231020204331.139847-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Remove all but those intended to change type to or from i64. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 914 ++++++++++++++++++---------------------- 1 file changed, 408 insertions(+), 506 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 96082d1a9c..1a57ccc49b 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -36,110 +36,15 @@ /* Since we have a distinction between register size and address size, we need to redefine all of these. */ -#undef TCGv -#undef tcg_temp_new -#undef tcg_global_mem_new - -#define TCGv_tl TCGv_i64 -#define tcg_temp_new_tl tcg_temp_new_i64 #define tcg_gen_extu_reg_tl tcg_gen_mov_i64 - -#define TCGv_reg TCGv_i64 - -#define tcg_temp_new tcg_temp_new_i64 -#define tcg_global_mem_new tcg_global_mem_new_i64 - -#define tcg_gen_movi_reg tcg_gen_movi_i64 -#define tcg_gen_mov_reg tcg_gen_mov_i64 -#define tcg_gen_ld8u_reg tcg_gen_ld8u_i64 -#define tcg_gen_ld8s_reg tcg_gen_ld8s_i64 -#define tcg_gen_ld16u_reg tcg_gen_ld16u_i64 -#define tcg_gen_ld16s_reg tcg_gen_ld16s_i64 -#define tcg_gen_ld32u_reg tcg_gen_ld32u_i64 -#define tcg_gen_ld32s_reg tcg_gen_ld32s_i64 -#define tcg_gen_ld_reg tcg_gen_ld_i64 -#define tcg_gen_st8_reg tcg_gen_st8_i64 -#define tcg_gen_st16_reg tcg_gen_st16_i64 -#define tcg_gen_st32_reg tcg_gen_st32_i64 -#define tcg_gen_st_reg tcg_gen_st_i64 -#define tcg_gen_add_reg tcg_gen_add_i64 -#define tcg_gen_addi_reg tcg_gen_addi_i64 -#define tcg_gen_sub_reg tcg_gen_sub_i64 -#define tcg_gen_neg_reg tcg_gen_neg_i64 -#define tcg_gen_subfi_reg tcg_gen_subfi_i64 -#define tcg_gen_subi_reg tcg_gen_subi_i64 -#define tcg_gen_and_reg tcg_gen_and_i64 -#define tcg_gen_andi_reg tcg_gen_andi_i64 -#define tcg_gen_or_reg tcg_gen_or_i64 -#define tcg_gen_ori_reg tcg_gen_ori_i64 -#define tcg_gen_xor_reg tcg_gen_xor_i64 -#define tcg_gen_xori_reg tcg_gen_xori_i64 -#define tcg_gen_not_reg tcg_gen_not_i64 -#define tcg_gen_shl_reg tcg_gen_shl_i64 -#define tcg_gen_shli_reg tcg_gen_shli_i64 -#define tcg_gen_shr_reg tcg_gen_shr_i64 -#define tcg_gen_shri_reg tcg_gen_shri_i64 -#define tcg_gen_sar_reg tcg_gen_sar_i64 -#define tcg_gen_sari_reg tcg_gen_sari_i64 -#define tcg_gen_brcond_reg tcg_gen_brcond_i64 -#define tcg_gen_brcondi_reg tcg_gen_brcondi_i64 -#define tcg_gen_setcond_reg tcg_gen_setcond_i64 -#define tcg_gen_setcondi_reg tcg_gen_setcondi_i64 -#define tcg_gen_mul_reg tcg_gen_mul_i64 -#define tcg_gen_muli_reg tcg_gen_muli_i64 -#define tcg_gen_div_reg tcg_gen_div_i64 -#define tcg_gen_rem_reg tcg_gen_rem_i64 -#define tcg_gen_divu_reg tcg_gen_divu_i64 -#define tcg_gen_remu_reg tcg_gen_remu_i64 -#define tcg_gen_discard_reg tcg_gen_discard_i64 -#define tcg_gen_trunc_reg_i32 tcg_gen_extrl_i64_i32 #define tcg_gen_trunc_i64_reg tcg_gen_mov_i64 -#define tcg_gen_extu_i32_reg tcg_gen_extu_i32_i64 -#define tcg_gen_ext_i32_reg tcg_gen_ext_i32_i64 #define tcg_gen_extu_reg_i64 tcg_gen_mov_i64 #define tcg_gen_ext_reg_i64 tcg_gen_mov_i64 -#define tcg_gen_ext8u_reg tcg_gen_ext8u_i64 -#define tcg_gen_ext8s_reg tcg_gen_ext8s_i64 -#define tcg_gen_ext16u_reg tcg_gen_ext16u_i64 -#define tcg_gen_ext16s_reg tcg_gen_ext16s_i64 -#define tcg_gen_ext32u_reg tcg_gen_ext32u_i64 -#define tcg_gen_ext32s_reg tcg_gen_ext32s_i64 -#define tcg_gen_bswap16_reg tcg_gen_bswap16_i64 -#define tcg_gen_bswap32_reg tcg_gen_bswap32_i64 -#define tcg_gen_bswap64_reg tcg_gen_bswap64_i64 -#define tcg_gen_concat_reg_i64 tcg_gen_concat32_i64 -#define tcg_gen_andc_reg tcg_gen_andc_i64 -#define tcg_gen_eqv_reg tcg_gen_eqv_i64 -#define tcg_gen_nand_reg tcg_gen_nand_i64 -#define tcg_gen_nor_reg tcg_gen_nor_i64 -#define tcg_gen_orc_reg tcg_gen_orc_i64 -#define tcg_gen_clz_reg tcg_gen_clz_i64 -#define tcg_gen_ctz_reg tcg_gen_ctz_i64 -#define tcg_gen_clzi_reg tcg_gen_clzi_i64 -#define tcg_gen_ctzi_reg tcg_gen_ctzi_i64 -#define tcg_gen_clrsb_reg tcg_gen_clrsb_i64 -#define tcg_gen_ctpop_reg tcg_gen_ctpop_i64 -#define tcg_gen_rotl_reg tcg_gen_rotl_i64 -#define tcg_gen_rotli_reg tcg_gen_rotli_i64 -#define tcg_gen_rotr_reg tcg_gen_rotr_i64 -#define tcg_gen_rotri_reg tcg_gen_rotri_i64 -#define tcg_gen_deposit_reg tcg_gen_deposit_i64 -#define tcg_gen_deposit_z_reg tcg_gen_deposit_z_i64 -#define tcg_gen_extract_reg tcg_gen_extract_i64 -#define tcg_gen_sextract_reg tcg_gen_sextract_i64 -#define tcg_gen_extract2_reg tcg_gen_extract2_i64 -#define tcg_constant_reg tcg_constant_i64 -#define tcg_gen_movcond_reg tcg_gen_movcond_i64 -#define tcg_gen_add2_reg tcg_gen_add2_i64 -#define tcg_gen_sub2_reg tcg_gen_sub2_i64 -#define tcg_gen_qemu_ld_reg tcg_gen_qemu_ld_i64 -#define tcg_gen_qemu_st_reg tcg_gen_qemu_st_i64 -#define tcg_gen_atomic_xchg_reg tcg_gen_atomic_xchg_i64 -#define tcg_gen_trunc_reg_ptr tcg_gen_trunc_i64_ptr + typedef struct DisasCond { TCGCond c; - TCGv_reg a0, a1; + TCGv_i64 a0, a1; } DisasCond; typedef struct DisasContext { @@ -149,7 +54,7 @@ typedef struct DisasContext { uint64_t iaoq_f; uint64_t iaoq_b; uint64_t iaoq_n; - TCGv_reg iaoq_n_var; + TCGv_i64 iaoq_n_var; DisasCond null_cond; TCGLabel *null_lab; @@ -261,24 +166,24 @@ static int cmpbid_c(DisasContext *ctx, int val) #define DISAS_EXIT DISAS_TARGET_3 /* global register indexes */ -static TCGv_reg cpu_gr[32]; +static TCGv_i64 cpu_gr[32]; static TCGv_i64 cpu_sr[4]; static TCGv_i64 cpu_srH; -static TCGv_reg cpu_iaoq_f; -static TCGv_reg cpu_iaoq_b; +static TCGv_i64 cpu_iaoq_f; +static TCGv_i64 cpu_iaoq_b; static TCGv_i64 cpu_iasq_f; static TCGv_i64 cpu_iasq_b; -static TCGv_reg cpu_sar; -static TCGv_reg cpu_psw_n; -static TCGv_reg cpu_psw_v; -static TCGv_reg cpu_psw_cb; -static TCGv_reg cpu_psw_cb_msb; +static TCGv_i64 cpu_sar; +static TCGv_i64 cpu_psw_n; +static TCGv_i64 cpu_psw_v; +static TCGv_i64 cpu_psw_cb; +static TCGv_i64 cpu_psw_cb_msb; void hppa_translate_init(void) { #define DEF_VAR(V) { &cpu_##V, #V, offsetof(CPUHPPAState, V) } - typedef struct { TCGv_reg *var; const char *name; int ofs; } GlobalVar; + typedef struct { TCGv_i64 *var; const char *name; int ofs; } GlobalVar; static const GlobalVar vars[] = { { &cpu_sar, "sar", offsetof(CPUHPPAState, cr[CR_SAR]) }, DEF_VAR(psw_n), @@ -356,35 +261,35 @@ static DisasCond cond_make_n(void) return (DisasCond){ .c = TCG_COND_NE, .a0 = cpu_psw_n, - .a1 = tcg_constant_reg(0) + .a1 = tcg_constant_i64(0) }; } -static DisasCond cond_make_tmp(TCGCond c, TCGv_reg a0, TCGv_reg a1) +static DisasCond cond_make_tmp(TCGCond c, TCGv_i64 a0, TCGv_i64 a1) { assert (c != TCG_COND_NEVER && c != TCG_COND_ALWAYS); return (DisasCond){ .c = c, .a0 = a0, .a1 = a1 }; } -static DisasCond cond_make_0_tmp(TCGCond c, TCGv_reg a0) +static DisasCond cond_make_0_tmp(TCGCond c, TCGv_i64 a0) { - return cond_make_tmp(c, a0, tcg_constant_reg(0)); + return cond_make_tmp(c, a0, tcg_constant_i64(0)); } -static DisasCond cond_make_0(TCGCond c, TCGv_reg a0) +static DisasCond cond_make_0(TCGCond c, TCGv_i64 a0) { - TCGv_reg tmp = tcg_temp_new(); - tcg_gen_mov_reg(tmp, a0); + TCGv_i64 tmp = tcg_temp_new(); + tcg_gen_mov_i64(tmp, a0); return cond_make_0_tmp(c, tmp); } -static DisasCond cond_make(TCGCond c, TCGv_reg a0, TCGv_reg a1) +static DisasCond cond_make(TCGCond c, TCGv_i64 a0, TCGv_i64 a1) { - TCGv_reg t0 = tcg_temp_new(); - TCGv_reg t1 = tcg_temp_new(); + TCGv_i64 t0 = tcg_temp_new(); + TCGv_i64 t1 = tcg_temp_new(); - tcg_gen_mov_reg(t0, a0); - tcg_gen_mov_reg(t1, a1); + tcg_gen_mov_i64(t0, a0); + tcg_gen_mov_i64(t1, a1); return cond_make_tmp(c, t0, t1); } @@ -403,18 +308,18 @@ static void cond_free(DisasCond *cond) } } -static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) +static TCGv_i64 load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { - TCGv_reg t = tcg_temp_new(); - tcg_gen_movi_reg(t, 0); + TCGv_i64 t = tcg_temp_new(); + tcg_gen_movi_i64(t, 0); return t; } else { return cpu_gr[reg]; } } -static TCGv_reg dest_gpr(DisasContext *ctx, unsigned reg) +static TCGv_i64 dest_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0 || ctx->null_cond.c != TCG_COND_NEVER) { return tcg_temp_new(); @@ -423,17 +328,17 @@ static TCGv_reg dest_gpr(DisasContext *ctx, unsigned reg) } } -static void save_or_nullify(DisasContext *ctx, TCGv_reg dest, TCGv_reg t) +static void save_or_nullify(DisasContext *ctx, TCGv_i64 dest, TCGv_i64 t) { if (ctx->null_cond.c != TCG_COND_NEVER) { - tcg_gen_movcond_reg(ctx->null_cond.c, dest, ctx->null_cond.a0, + tcg_gen_movcond_i64(ctx->null_cond.c, dest, ctx->null_cond.a0, ctx->null_cond.a1, dest, t); } else { - tcg_gen_mov_reg(dest, t); + tcg_gen_mov_i64(dest, t); } } -static void save_gpr(DisasContext *ctx, unsigned reg, TCGv_reg t) +static void save_gpr(DisasContext *ctx, unsigned reg, TCGv_i64 t) { if (reg != 0) { save_or_nullify(ctx, cpu_gr[reg], t); @@ -542,17 +447,17 @@ static void nullify_over(DisasContext *ctx) /* If we're using PSW[N], copy it to a temp because... */ if (ctx->null_cond.a0 == cpu_psw_n) { ctx->null_cond.a0 = tcg_temp_new(); - tcg_gen_mov_reg(ctx->null_cond.a0, cpu_psw_n); + tcg_gen_mov_i64(ctx->null_cond.a0, cpu_psw_n); } /* ... we clear it before branching over the implementation, so that (1) it's clear after nullifying this insn and (2) if this insn nullifies the next, PSW[N] is valid. */ if (ctx->psw_n_nonzero) { ctx->psw_n_nonzero = false; - tcg_gen_movi_reg(cpu_psw_n, 0); + tcg_gen_movi_i64(cpu_psw_n, 0); } - tcg_gen_brcond_reg(ctx->null_cond.c, ctx->null_cond.a0, + tcg_gen_brcond_i64(ctx->null_cond.c, ctx->null_cond.a0, ctx->null_cond.a1, ctx->null_lab); cond_free(&ctx->null_cond); } @@ -563,12 +468,12 @@ static void nullify_save(DisasContext *ctx) { if (ctx->null_cond.c == TCG_COND_NEVER) { if (ctx->psw_n_nonzero) { - tcg_gen_movi_reg(cpu_psw_n, 0); + tcg_gen_movi_i64(cpu_psw_n, 0); } return; } if (ctx->null_cond.a0 != cpu_psw_n) { - tcg_gen_setcond_reg(ctx->null_cond.c, cpu_psw_n, + tcg_gen_setcond_i64(ctx->null_cond.c, cpu_psw_n, ctx->null_cond.a0, ctx->null_cond.a1); ctx->psw_n_nonzero = true; } @@ -581,7 +486,7 @@ static void nullify_save(DisasContext *ctx) static void nullify_set(DisasContext *ctx, bool x) { if (ctx->psw_n_nonzero || x) { - tcg_gen_movi_reg(cpu_psw_n, x); + tcg_gen_movi_i64(cpu_psw_n, x); } } @@ -624,12 +529,12 @@ static bool nullify_end(DisasContext *ctx) return true; } -static void copy_iaoq_entry(TCGv_reg dest, uint64_t ival, TCGv_reg vval) +static void copy_iaoq_entry(TCGv_i64 dest, uint64_t ival, TCGv_i64 vval) { if (unlikely(ival == -1)) { - tcg_gen_mov_reg(dest, vval); + tcg_gen_mov_i64(dest, vval); } else { - tcg_gen_movi_reg(dest, ival); + tcg_gen_movi_i64(dest, ival); } } @@ -655,7 +560,7 @@ static void gen_excp(DisasContext *ctx, int exception) static bool gen_excp_iir(DisasContext *ctx, int exc) { nullify_over(ctx); - tcg_gen_st_reg(tcg_constant_reg(ctx->insn), + tcg_gen_st_i64(tcg_constant_i64(ctx->insn), tcg_env, offsetof(CPUHPPAState, cr[CR_IIR])); gen_excp(ctx, exc); return nullify_end(ctx); @@ -705,8 +610,8 @@ static void gen_goto_tb(DisasContext *ctx, int which, { if (f != -1 && b != -1 && use_goto_tb(ctx, f)) { tcg_gen_goto_tb(which); - tcg_gen_movi_reg(cpu_iaoq_f, f); - tcg_gen_movi_reg(cpu_iaoq_b, b); + tcg_gen_movi_i64(cpu_iaoq_f, f); + tcg_gen_movi_i64(cpu_iaoq_b, b); tcg_gen_exit_tb(ctx->base.tb, which); } else { copy_iaoq_entry(cpu_iaoq_f, f, cpu_iaoq_b); @@ -725,7 +630,7 @@ static bool cond_need_cb(int c) return c == 4 || c == 5; } -/* Need extensions from TCGv_i32 to TCGv_reg. */ +/* Need extensions from TCGv_i32 to TCGv_i64. */ static bool cond_need_ext(DisasContext *ctx, bool d) { return !(ctx->is_pa20 && d); @@ -737,10 +642,10 @@ static bool cond_need_ext(DisasContext *ctx, bool d) */ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, - TCGv_reg res, TCGv_reg cb_msb, TCGv_reg sv) + TCGv_i64 res, TCGv_i64 cb_msb, TCGv_i64 sv) { DisasCond cond; - TCGv_reg tmp; + TCGv_i64 tmp; switch (cf >> 1) { case 0: /* Never / TR (0 / 1) */ @@ -749,16 +654,16 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, case 1: /* = / <> (Z / !Z) */ if (cond_need_ext(ctx, d)) { tmp = tcg_temp_new(); - tcg_gen_ext32u_reg(tmp, res); + tcg_gen_ext32u_i64(tmp, res); res = tmp; } cond = cond_make_0(TCG_COND_EQ, res); break; case 2: /* < / >= (N ^ V / !(N ^ V) */ tmp = tcg_temp_new(); - tcg_gen_xor_reg(tmp, res, sv); + tcg_gen_xor_i64(tmp, res, sv); if (cond_need_ext(ctx, d)) { - tcg_gen_ext32s_reg(tmp, tmp); + tcg_gen_ext32s_i64(tmp, tmp); } cond = cond_make_0_tmp(TCG_COND_LT, tmp); break; @@ -773,14 +678,14 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, * !(~(res ^ sv) >> 31 & res) */ tmp = tcg_temp_new(); - tcg_gen_eqv_reg(tmp, res, sv); + tcg_gen_eqv_i64(tmp, res, sv); if (cond_need_ext(ctx, d)) { - tcg_gen_sextract_reg(tmp, tmp, 31, 1); - tcg_gen_and_reg(tmp, tmp, res); - tcg_gen_ext32u_reg(tmp, tmp); + tcg_gen_sextract_i64(tmp, tmp, 31, 1); + tcg_gen_and_i64(tmp, tmp, res); + tcg_gen_ext32u_i64(tmp, tmp); } else { - tcg_gen_sari_reg(tmp, tmp, 63); - tcg_gen_and_reg(tmp, tmp, res); + tcg_gen_sari_i64(tmp, tmp, 63); + tcg_gen_and_i64(tmp, tmp, res); } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); break; @@ -790,24 +695,24 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, break; case 5: /* ZNV / VNZ (!C | Z / C & !Z) */ tmp = tcg_temp_new(); - tcg_gen_neg_reg(tmp, cb_msb); - tcg_gen_and_reg(tmp, tmp, res); + tcg_gen_neg_i64(tmp, cb_msb); + tcg_gen_and_i64(tmp, tmp, res); if (cond_need_ext(ctx, d)) { - tcg_gen_ext32u_reg(tmp, tmp); + tcg_gen_ext32u_i64(tmp, tmp); } cond = cond_make_0_tmp(TCG_COND_EQ, tmp); break; case 6: /* SV / NSV (V / !V) */ if (cond_need_ext(ctx, d)) { tmp = tcg_temp_new(); - tcg_gen_ext32s_reg(tmp, sv); + tcg_gen_ext32s_i64(tmp, sv); sv = tmp; } cond = cond_make_0(TCG_COND_LT, sv); break; case 7: /* OD / EV */ tmp = tcg_temp_new(); - tcg_gen_andi_reg(tmp, res, 1); + tcg_gen_andi_i64(tmp, res, 1); cond = cond_make_0_tmp(TCG_COND_NE, tmp); break; default: @@ -825,8 +730,8 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, deleted as unused. */ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, - TCGv_reg res, TCGv_reg in1, - TCGv_reg in2, TCGv_reg sv) + TCGv_i64 res, TCGv_i64 in1, + TCGv_i64 in2, TCGv_i64 sv) { TCGCond tc; bool ext_uns; @@ -860,15 +765,15 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, tc = tcg_invert_cond(tc); } if (cond_need_ext(ctx, d)) { - TCGv_reg t1 = tcg_temp_new(); - TCGv_reg t2 = tcg_temp_new(); + TCGv_i64 t1 = tcg_temp_new(); + TCGv_i64 t2 = tcg_temp_new(); if (ext_uns) { - tcg_gen_ext32u_reg(t1, in1); - tcg_gen_ext32u_reg(t2, in2); + tcg_gen_ext32u_i64(t1, in1); + tcg_gen_ext32u_i64(t2, in2); } else { - tcg_gen_ext32s_reg(t1, in1); - tcg_gen_ext32s_reg(t2, in2); + tcg_gen_ext32s_i64(t1, in1); + tcg_gen_ext32s_i64(t2, in2); } return cond_make_tmp(tc, t1, t2); } @@ -885,7 +790,7 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, */ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, - TCGv_reg res) + TCGv_i64 res) { TCGCond tc; bool ext_uns; @@ -937,12 +842,12 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, } if (cond_need_ext(ctx, d)) { - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); if (ext_uns) { - tcg_gen_ext32u_reg(tmp, res); + tcg_gen_ext32u_i64(tmp, res); } else { - tcg_gen_ext32s_reg(tmp, res); + tcg_gen_ext32s_i64(tmp, res); } return cond_make_0_tmp(tc, tmp); } @@ -952,7 +857,7 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, /* Similar, but for shift/extract/deposit conditions. */ static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d, - TCGv_reg res) + TCGv_i64 res) { unsigned c, f; @@ -970,11 +875,11 @@ static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d, /* Similar, but for unit conditions. */ -static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, - TCGv_reg in1, TCGv_reg in2) +static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, + TCGv_i64 in1, TCGv_i64 in2) { DisasCond cond; - TCGv_reg tmp, cb = NULL; + TCGv_i64 tmp, cb = NULL; uint64_t d_repl = d ? 0x0000000100000001ull : 1; if (cf & 8) { @@ -984,10 +889,10 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, */ cb = tcg_temp_new(); tmp = tcg_temp_new(); - tcg_gen_or_reg(cb, in1, in2); - tcg_gen_and_reg(tmp, in1, in2); - tcg_gen_andc_reg(cb, cb, res); - tcg_gen_or_reg(cb, cb, tmp); + tcg_gen_or_i64(cb, in1, in2); + tcg_gen_and_i64(tmp, in1, in2); + tcg_gen_andc_i64(cb, cb, res); + tcg_gen_or_i64(cb, cb, tmp); } switch (cf >> 1) { @@ -1002,32 +907,32 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, * https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord */ tmp = tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, d_repl * 0x01010101u); - tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80808080u); + tcg_gen_subi_i64(tmp, res, d_repl * 0x01010101u); + tcg_gen_andc_i64(tmp, tmp, res); + tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, tmp); break; case 3: /* SHZ / NHZ */ tmp = tcg_temp_new(); - tcg_gen_subi_reg(tmp, res, d_repl * 0x00010001u); - tcg_gen_andc_reg(tmp, tmp, res); - tcg_gen_andi_reg(tmp, tmp, d_repl * 0x80008000u); + tcg_gen_subi_i64(tmp, res, d_repl * 0x00010001u); + tcg_gen_andc_i64(tmp, tmp, res); + tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80008000u); cond = cond_make_0(TCG_COND_NE, tmp); break; case 4: /* SDC / NDC */ - tcg_gen_andi_reg(cb, cb, d_repl * 0x88888888u); + tcg_gen_andi_i64(cb, cb, d_repl * 0x88888888u); cond = cond_make_0(TCG_COND_NE, cb); break; case 6: /* SBC / NBC */ - tcg_gen_andi_reg(cb, cb, d_repl * 0x80808080u); + tcg_gen_andi_i64(cb, cb, d_repl * 0x80808080u); cond = cond_make_0(TCG_COND_NE, cb); break; case 7: /* SHC / NHC */ - tcg_gen_andi_reg(cb, cb, d_repl * 0x80008000u); + tcg_gen_andi_i64(cb, cb, d_repl * 0x80008000u); cond = cond_make_0(TCG_COND_NE, cb); break; @@ -1041,55 +946,55 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_reg res, return cond; } -static TCGv_reg get_carry(DisasContext *ctx, bool d, - TCGv_reg cb, TCGv_reg cb_msb) +static TCGv_i64 get_carry(DisasContext *ctx, bool d, + TCGv_i64 cb, TCGv_i64 cb_msb) { if (cond_need_ext(ctx, d)) { - TCGv_reg t = tcg_temp_new(); - tcg_gen_extract_reg(t, cb, 32, 1); + TCGv_i64 t = tcg_temp_new(); + tcg_gen_extract_i64(t, cb, 32, 1); return t; } return cb_msb; } -static TCGv_reg get_psw_carry(DisasContext *ctx, bool d) +static TCGv_i64 get_psw_carry(DisasContext *ctx, bool d) { return get_carry(ctx, d, cpu_psw_cb, cpu_psw_cb_msb); } /* Compute signed overflow for addition. */ -static TCGv_reg do_add_sv(DisasContext *ctx, TCGv_reg res, - TCGv_reg in1, TCGv_reg in2) +static TCGv_i64 do_add_sv(DisasContext *ctx, TCGv_i64 res, + TCGv_i64 in1, TCGv_i64 in2) { - TCGv_reg sv = tcg_temp_new(); - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 sv = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); - tcg_gen_xor_reg(sv, res, in1); - tcg_gen_xor_reg(tmp, in1, in2); - tcg_gen_andc_reg(sv, sv, tmp); + tcg_gen_xor_i64(sv, res, in1); + tcg_gen_xor_i64(tmp, in1, in2); + tcg_gen_andc_i64(sv, sv, tmp); return sv; } /* Compute signed overflow for subtraction. */ -static TCGv_reg do_sub_sv(DisasContext *ctx, TCGv_reg res, - TCGv_reg in1, TCGv_reg in2) +static TCGv_i64 do_sub_sv(DisasContext *ctx, TCGv_i64 res, + TCGv_i64 in1, TCGv_i64 in2) { - TCGv_reg sv = tcg_temp_new(); - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 sv = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); - tcg_gen_xor_reg(sv, res, in1); - tcg_gen_xor_reg(tmp, in1, in2); - tcg_gen_and_reg(sv, sv, tmp); + tcg_gen_xor_i64(sv, res, in1); + tcg_gen_xor_i64(tmp, in1, in2); + tcg_gen_and_i64(sv, sv, tmp); return sv; } -static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned shift, bool is_l, +static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, unsigned shift, bool is_l, bool is_tsv, bool is_tc, bool is_c, unsigned cf, bool d) { - TCGv_reg dest, cb, cb_msb, cb_cond, sv, tmp; + TCGv_i64 dest, cb, cb_msb, cb_cond, sv, tmp; unsigned c = cf >> 1; DisasCond cond; @@ -1100,29 +1005,29 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, if (shift) { tmp = tcg_temp_new(); - tcg_gen_shli_reg(tmp, in1, shift); + tcg_gen_shli_i64(tmp, in1, shift); in1 = tmp; } if (!is_l || cond_need_cb(c)) { - TCGv_reg zero = tcg_constant_reg(0); + TCGv_i64 zero = tcg_constant_i64(0); cb_msb = tcg_temp_new(); cb = tcg_temp_new(); - tcg_gen_add2_reg(dest, cb_msb, in1, zero, in2, zero); + tcg_gen_add2_i64(dest, cb_msb, in1, zero, in2, zero); if (is_c) { - tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, + tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, get_psw_carry(ctx, d), zero); } - tcg_gen_xor_reg(cb, in1, in2); - tcg_gen_xor_reg(cb, cb, dest); + tcg_gen_xor_i64(cb, in1, in2); + tcg_gen_xor_i64(cb, cb, dest); if (cond_need_cb(c)) { cb_cond = get_carry(ctx, d, cb, cb_msb); } } else { - tcg_gen_add_reg(dest, in1, in2); + tcg_gen_add_i64(dest, in1, in2); if (is_c) { - tcg_gen_add_reg(dest, dest, get_psw_carry(ctx, d)); + tcg_gen_add_i64(dest, dest, get_psw_carry(ctx, d)); } } @@ -1140,7 +1045,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, cond = do_cond(ctx, cf, d, dest, cb_cond, sv); if (is_tc) { tmp = tcg_temp_new(); - tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); + tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1159,7 +1064,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_reg in1, static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_d_sh *a, bool is_l, bool is_tsv, bool is_tc, bool is_c) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); @@ -1174,23 +1079,23 @@ static bool do_add_reg(DisasContext *ctx, arg_rrr_cf_d_sh *a, static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv, bool is_tc) { - TCGv_reg tcg_im, tcg_r2; + TCGv_i64 tcg_im, tcg_r2; if (a->cf) { nullify_over(ctx); } - tcg_im = tcg_constant_reg(a->i); + tcg_im = tcg_constant_i64(a->i); tcg_r2 = load_gpr(ctx, a->r); /* All ADDI conditions are 32-bit. */ do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf, false); return nullify_end(ctx); } -static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, bool is_tsv, bool is_b, +static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, bool is_tsv, bool is_b, bool is_tc, unsigned cf, bool d) { - TCGv_reg dest, sv, cb, cb_msb, zero, tmp; + TCGv_i64 dest, sv, cb, cb_msb, zero, tmp; unsigned c = cf >> 1; DisasCond cond; @@ -1198,23 +1103,23 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, cb = tcg_temp_new(); cb_msb = tcg_temp_new(); - zero = tcg_constant_reg(0); + zero = tcg_constant_i64(0); if (is_b) { /* DEST,C = IN1 + ~IN2 + C. */ - tcg_gen_not_reg(cb, in2); - tcg_gen_add2_reg(dest, cb_msb, in1, zero, get_psw_carry(ctx, d), zero); - tcg_gen_add2_reg(dest, cb_msb, dest, cb_msb, cb, zero); - tcg_gen_xor_reg(cb, cb, in1); - tcg_gen_xor_reg(cb, cb, dest); + tcg_gen_not_i64(cb, in2); + tcg_gen_add2_i64(dest, cb_msb, in1, zero, get_psw_carry(ctx, d), zero); + tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, cb, zero); + tcg_gen_xor_i64(cb, cb, in1); + tcg_gen_xor_i64(cb, cb, dest); } else { /* * DEST,C = IN1 + ~IN2 + 1. We can produce the same result in fewer * operations by seeding the high word with 1 and subtracting. */ - TCGv_reg one = tcg_constant_reg(1); - tcg_gen_sub2_reg(dest, cb_msb, in1, one, in2, zero); - tcg_gen_eqv_reg(cb, in1, in2); - tcg_gen_xor_reg(cb, cb, dest); + TCGv_i64 one = tcg_constant_i64(1); + tcg_gen_sub2_i64(dest, cb_msb, in1, one, in2, zero); + tcg_gen_eqv_i64(cb, in1, in2); + tcg_gen_xor_i64(cb, cb, dest); } /* Compute signed overflow if required. */ @@ -1236,7 +1141,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, /* Emit any conditional trap before any writeback. */ if (is_tc) { tmp = tcg_temp_new(); - tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); + tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1253,7 +1158,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tsv, bool is_b, bool is_tc) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); @@ -1266,26 +1171,26 @@ static bool do_sub_reg(DisasContext *ctx, arg_rrr_cf_d *a, static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) { - TCGv_reg tcg_im, tcg_r2; + TCGv_i64 tcg_im, tcg_r2; if (a->cf) { nullify_over(ctx); } - tcg_im = tcg_constant_reg(a->i); + tcg_im = tcg_constant_i64(a->i); tcg_r2 = load_gpr(ctx, a->r); /* All SUBI conditions are 32-bit. */ do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf, false); return nullify_end(ctx); } -static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, bool d) +static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, unsigned cf, bool d) { - TCGv_reg dest, sv; + TCGv_i64 dest, sv; DisasCond cond; dest = tcg_temp_new(); - tcg_gen_sub_reg(dest, in1, in2); + tcg_gen_sub_i64(dest, in1, in2); /* Compute signed overflow if required. */ sv = NULL; @@ -1297,7 +1202,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, cond = do_sub_cond(ctx, cf, d, dest, in1, in2, sv); /* Clear. */ - tcg_gen_movi_reg(dest, 0); + tcg_gen_movi_i64(dest, 0); save_gpr(ctx, rt, dest); /* Install the new nullification. */ @@ -1305,11 +1210,11 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_reg in1, ctx->null_cond = cond; } -static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, bool d, - void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) +static void do_log(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, unsigned cf, bool d, + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64)) { - TCGv_reg dest = dest_gpr(ctx, rt); + TCGv_i64 dest = dest_gpr(ctx, rt); /* Perform the operation, and writeback. */ fn(dest, in1, in2); @@ -1323,9 +1228,9 @@ static void do_log(DisasContext *ctx, unsigned rt, TCGv_reg in1, } static bool do_log_reg(DisasContext *ctx, arg_rrr_cf_d *a, - void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64)) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); @@ -1336,11 +1241,11 @@ static bool do_log_reg(DisasContext *ctx, arg_rrr_cf_d *a, return nullify_end(ctx); } -static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, - TCGv_reg in2, unsigned cf, bool d, bool is_tc, - void (*fn)(TCGv_reg, TCGv_reg, TCGv_reg)) +static void do_unit(DisasContext *ctx, unsigned rt, TCGv_i64 in1, + TCGv_i64 in2, unsigned cf, bool d, bool is_tc, + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64)) { - TCGv_reg dest; + TCGv_i64 dest; DisasCond cond; if (cf == 0) { @@ -1355,8 +1260,8 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, cond = do_unit_cond(cf, d, dest, in1, in2); if (is_tc) { - TCGv_reg tmp = tcg_temp_new(); - tcg_gen_setcond_reg(cond.c, tmp, cond.a0, cond.a1); + TCGv_i64 tmp = tcg_temp_new(); + tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } save_gpr(ctx, rt, dest); @@ -1371,17 +1276,17 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_reg in1, from the top 2 bits of the base register. There are a few system instructions that have a 3-bit space specifier, for which SR0 is not special. To handle this, pass ~SP. */ -static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) +static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_i64 base) { TCGv_ptr ptr; - TCGv_reg tmp; + TCGv_i64 tmp; TCGv_i64 spc; if (sp != 0) { if (sp < 0) { sp = ~sp; } - spc = tcg_temp_new_tl(); + spc = tcg_temp_new_i64(); load_spr(ctx, spc, sp); return spc; } @@ -1391,12 +1296,12 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) ptr = tcg_temp_new_ptr(); tmp = tcg_temp_new(); - spc = tcg_temp_new_tl(); + spc = tcg_temp_new_i64(); /* Extract top 2 bits of the address, shift left 3 for uint64_t index. */ - tcg_gen_shri_reg(tmp, base, (ctx->tb_flags & PSW_W ? 64 : 32) - 5); - tcg_gen_andi_reg(tmp, tmp, 030); - tcg_gen_trunc_reg_ptr(ptr, tmp); + tcg_gen_shri_i64(tmp, base, (ctx->tb_flags & PSW_W ? 64 : 32) - 5); + tcg_gen_andi_i64(tmp, tmp, 030); + tcg_gen_trunc_i64_ptr(ptr, tmp); tcg_gen_add_ptr(ptr, ptr, tcg_env); tcg_gen_ld_i64(spc, ptr, offsetof(CPUHPPAState, sr[4])); @@ -1405,28 +1310,28 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base) } #endif -static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs, +static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, bool is_phys) { - TCGv_reg base = load_gpr(ctx, rb); - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 base = load_gpr(ctx, rb); + TCGv_i64 ofs; + TCGv_i64 addr; /* Note that RX is mutually exclusive with DISP. */ if (rx) { ofs = tcg_temp_new(); - tcg_gen_shli_reg(ofs, cpu_gr[rx], scale); - tcg_gen_add_reg(ofs, ofs, base); + tcg_gen_shli_i64(ofs, cpu_gr[rx], scale); + tcg_gen_add_i64(ofs, ofs, base); } else if (disp || modify) { ofs = tcg_temp_new(); - tcg_gen_addi_reg(ofs, base, disp); + tcg_gen_addi_i64(ofs, base, disp); } else { ofs = base; } *pofs = ofs; - *pgva = addr = tcg_temp_new_tl(); + *pgva = addr = tcg_temp_new_i64(); tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); tcg_gen_andi_tl(addr, addr, gva_offset_mask(ctx)); #ifndef CONFIG_USER_ONLY @@ -1445,8 +1350,8 @@ static void do_load_32(DisasContext *ctx, TCGv_i32 dest, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 ofs; + TCGv_i64 addr; /* Caller uses nullify_over/nullify_end. */ assert(ctx->null_cond.c == TCG_COND_NEVER); @@ -1463,8 +1368,8 @@ static void do_load_64(DisasContext *ctx, TCGv_i64 dest, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 ofs; + TCGv_i64 addr; /* Caller uses nullify_over/nullify_end. */ assert(ctx->null_cond.c == TCG_COND_NEVER); @@ -1481,8 +1386,8 @@ static void do_store_32(DisasContext *ctx, TCGv_i32 src, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 ofs; + TCGv_i64 addr; /* Caller uses nullify_over/nullify_end. */ assert(ctx->null_cond.c == TCG_COND_NEVER); @@ -1499,8 +1404,8 @@ static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg ofs; - TCGv_tl addr; + TCGv_i64 ofs; + TCGv_i64 addr; /* Caller uses nullify_over/nullify_end. */ assert(ctx->null_cond.c == TCG_COND_NEVER); @@ -1513,14 +1418,11 @@ static void do_store_64(DisasContext *ctx, TCGv_i64 src, unsigned rb, } } -#define do_load_reg do_load_64 -#define do_store_reg do_store_64 - static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, unsigned rx, int scale, int64_t disp, unsigned sp, int modify, MemOp mop) { - TCGv_reg dest; + TCGv_i64 dest; nullify_over(ctx); @@ -1531,7 +1433,7 @@ static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, /* Make sure if RT == RB, we see the result of the load. */ dest = tcg_temp_new(); } - do_load_reg(ctx, dest, rb, rx, scale, disp, sp, modify, mop); + do_load_64(ctx, dest, rb, rx, scale, disp, sp, modify, mop); save_gpr(ctx, rt, dest); return nullify_end(ctx); @@ -1592,7 +1494,7 @@ static bool do_store(DisasContext *ctx, unsigned rt, unsigned rb, int modify, MemOp mop) { nullify_over(ctx); - do_store_reg(ctx, load_gpr(ctx, rt), rb, 0, 0, disp, sp, modify, mop); + do_store_64(ctx, load_gpr(ctx, rt), rb, 0, 0, disp, sp, modify, mop); return nullify_end(ctx); } @@ -1786,7 +1688,7 @@ static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, } taken = gen_new_label(); - tcg_gen_brcond_reg(c, cond->a0, cond->a1, taken); + tcg_gen_brcond_i64(c, cond->a0, cond->a1, taken); cond_free(cond); /* Not taken: Condition not satisfied; nullify on backward branches. */ @@ -1803,7 +1705,7 @@ static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, if (ctx->iaoq_n == -1) { /* The temporary iaoq_n_var died at the branch above. Regenerate it here instead of saving it. */ - tcg_gen_addi_reg(ctx->iaoq_n_var, cpu_iaoq_b, 4); + tcg_gen_addi_i64(ctx->iaoq_n_var, cpu_iaoq_b, 4); } gen_goto_tb(ctx, 0, ctx->iaoq_b, ctx->iaoq_n); } @@ -1833,10 +1735,10 @@ static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, /* Emit an unconditional branch to an indirect target. This handles nullification of the branch itself. */ -static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, +static bool do_ibranch(DisasContext *ctx, TCGv_i64 dest, unsigned link, bool is_n) { - TCGv_reg a0, a1, next, tmp; + TCGv_i64 a0, a1, next, tmp; TCGCond c; assert(ctx->null_lab == NULL); @@ -1846,11 +1748,11 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, copy_iaoq_entry(cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } next = tcg_temp_new(); - tcg_gen_mov_reg(next, dest); + tcg_gen_mov_i64(next, dest); if (is_n) { if (use_nullify_skip(ctx)) { - tcg_gen_mov_reg(cpu_iaoq_f, next); - tcg_gen_addi_reg(cpu_iaoq_b, next, 4); + tcg_gen_mov_i64(cpu_iaoq_f, next); + tcg_gen_addi_i64(cpu_iaoq_b, next, 4); nullify_set(ctx, 0); ctx->base.is_jmp = DISAS_IAQ_N_UPDATED; return true; @@ -1872,12 +1774,12 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, /* We do have to handle the non-local temporary, DEST, before branching. Since IOAQ_F is not really live at this point, we can simply store DEST optimistically. Similarly with IAOQ_B. */ - tcg_gen_mov_reg(cpu_iaoq_f, dest); - tcg_gen_addi_reg(cpu_iaoq_b, dest, 4); + tcg_gen_mov_i64(cpu_iaoq_f, dest); + tcg_gen_addi_i64(cpu_iaoq_b, dest, 4); nullify_over(ctx); if (link != 0) { - tcg_gen_movi_reg(cpu_gr[link], ctx->iaoq_n); + tcg_gen_movi_i64(cpu_gr[link], ctx->iaoq_n); } tcg_gen_lookup_and_goto_ptr(); return nullify_end(ctx); @@ -1890,19 +1792,19 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, next = tcg_temp_new(); copy_iaoq_entry(tmp, ctx->iaoq_n, ctx->iaoq_n_var); - tcg_gen_movcond_reg(c, next, a0, a1, tmp, dest); + tcg_gen_movcond_i64(c, next, a0, a1, tmp, dest); ctx->iaoq_n = -1; ctx->iaoq_n_var = next; if (link != 0) { - tcg_gen_movcond_reg(c, cpu_gr[link], a0, a1, cpu_gr[link], tmp); + tcg_gen_movcond_i64(c, cpu_gr[link], a0, a1, cpu_gr[link], tmp); } if (is_n) { /* The branch nullifies the next insn, which means the state of N after the branch is the inverse of the state of N that applied to the branch. */ - tcg_gen_setcond_reg(tcg_invert_cond(c), cpu_psw_n, a0, a1); + tcg_gen_setcond_i64(tcg_invert_cond(c), cpu_psw_n, a0, a1); cond_free(&ctx->null_cond); ctx->null_cond = cond_make_n(); ctx->psw_n_nonzero = true; @@ -1920,9 +1822,9 @@ static bool do_ibranch(DisasContext *ctx, TCGv_reg dest, * IAOQ_Next{30..31} ← IAOQ_Front{30..31}; * which keeps the privilege level from being increased. */ -static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) +static TCGv_i64 do_ibranch_priv(DisasContext *ctx, TCGv_i64 offset) { - TCGv_reg dest; + TCGv_i64 dest; switch (ctx->privilege) { case 0: /* Privilege 0 is maximum and is allowed to decrease. */ @@ -1930,13 +1832,13 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) case 3: /* Privilege 3 is minimum and is never allowed to increase. */ dest = tcg_temp_new(); - tcg_gen_ori_reg(dest, offset, 3); + tcg_gen_ori_i64(dest, offset, 3); break; default: dest = tcg_temp_new(); - tcg_gen_andi_reg(dest, offset, -4); - tcg_gen_ori_reg(dest, dest, ctx->privilege); - tcg_gen_movcond_reg(TCG_COND_GTU, dest, dest, offset, dest, offset); + tcg_gen_andi_i64(dest, offset, -4); + tcg_gen_ori_i64(dest, dest, ctx->privilege); + tcg_gen_movcond_i64(TCG_COND_GTU, dest, dest, offset, dest, offset); break; } return dest; @@ -1959,7 +1861,7 @@ static void do_page_zero(DisasContext *ctx) case TCG_COND_NEVER: break; case TCG_COND_ALWAYS: - tcg_gen_movi_reg(cpu_psw_n, 0); + tcg_gen_movi_i64(cpu_psw_n, 0); goto do_sigill; default: /* Since this is always the first (and only) insn within the @@ -1987,9 +1889,9 @@ static void do_page_zero(DisasContext *ctx) break; case 0xe0: /* SET_THREAD_POINTER */ - tcg_gen_st_reg(cpu_gr[26], tcg_env, offsetof(CPUHPPAState, cr[27])); - tcg_gen_ori_reg(cpu_iaoq_f, cpu_gr[31], 3); - tcg_gen_addi_reg(cpu_iaoq_b, cpu_iaoq_f, 4); + tcg_gen_st_i64(cpu_gr[26], tcg_env, offsetof(CPUHPPAState, cr[27])); + tcg_gen_ori_i64(cpu_iaoq_f, cpu_gr[31], 3); + tcg_gen_addi_i64(cpu_iaoq_b, cpu_iaoq_f, 4); ctx->base.is_jmp = DISAS_IAQ_N_UPDATED; break; @@ -2030,8 +1932,8 @@ static bool trans_sync(DisasContext *ctx, arg_sync *a) static bool trans_mfia(DisasContext *ctx, arg_mfia *a) { unsigned rt = a->t; - TCGv_reg tmp = dest_gpr(ctx, rt); - tcg_gen_movi_reg(tmp, ctx->iaoq_f); + TCGv_i64 tmp = dest_gpr(ctx, rt); + tcg_gen_movi_i64(tmp, ctx->iaoq_f); save_gpr(ctx, rt, tmp); cond_free(&ctx->null_cond); @@ -2043,7 +1945,7 @@ static bool trans_mfsp(DisasContext *ctx, arg_mfsp *a) unsigned rt = a->t; unsigned rs = a->sp; TCGv_i64 t0 = tcg_temp_new_i64(); - TCGv_reg t1 = tcg_temp_new(); + TCGv_i64 t1 = tcg_temp_new(); load_spr(ctx, t0, rs); tcg_gen_shri_i64(t0, t0, 32); @@ -2059,14 +1961,14 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) { unsigned rt = a->t; unsigned ctl = a->r; - TCGv_reg tmp; + TCGv_i64 tmp; switch (ctl) { case CR_SAR: if (a->e == 0) { /* MFSAR without ,W masks low 5 bits. */ tmp = dest_gpr(ctx, rt); - tcg_gen_andi_reg(tmp, cpu_sar, 31); + tcg_gen_andi_i64(tmp, cpu_sar, 31); save_gpr(ctx, rt, tmp); goto done; } @@ -2094,7 +1996,7 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) } tmp = tcg_temp_new(); - tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); + tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); save_gpr(ctx, rt, tmp); done: @@ -2130,13 +2032,13 @@ static bool trans_mtsp(DisasContext *ctx, arg_mtsp *a) static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) { unsigned ctl = a->t; - TCGv_reg reg; - TCGv_reg tmp; + TCGv_i64 reg; + TCGv_i64 tmp; if (ctl == CR_SAR) { reg = load_gpr(ctx, a->r); tmp = tcg_temp_new(); - tcg_gen_andi_reg(tmp, reg, ctx->is_pa20 ? 63 : 31); + tcg_gen_andi_i64(tmp, reg, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); @@ -2167,10 +2069,10 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) /* FIXME: Respect PSW_Q bit */ /* The write advances the queue and stores to the back element. */ tmp = tcg_temp_new(); - tcg_gen_ld_reg(tmp, tcg_env, + tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr_back[ctl - CR_IIASQ])); - tcg_gen_st_reg(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); - tcg_gen_st_reg(reg, tcg_env, + tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); + tcg_gen_st_i64(reg, tcg_env, offsetof(CPUHPPAState, cr_back[ctl - CR_IIASQ])); break; @@ -2178,14 +2080,14 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) case CR_PID2: case CR_PID3: case CR_PID4: - tcg_gen_st_reg(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); + tcg_gen_st_i64(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); #ifndef CONFIG_USER_ONLY gen_helper_change_prot_id(tcg_env); #endif break; default: - tcg_gen_st_reg(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); + tcg_gen_st_i64(reg, tcg_env, offsetof(CPUHPPAState, cr[ctl])); break; } return nullify_end(ctx); @@ -2194,10 +2096,10 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) { - TCGv_reg tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new(); - tcg_gen_not_reg(tmp, load_gpr(ctx, a->r)); - tcg_gen_andi_reg(tmp, tmp, ctx->is_pa20 ? 63 : 31); + tcg_gen_not_i64(tmp, load_gpr(ctx, a->r)); + tcg_gen_andi_i64(tmp, tmp, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); @@ -2206,11 +2108,11 @@ static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) static bool trans_ldsid(DisasContext *ctx, arg_ldsid *a) { - TCGv_reg dest = dest_gpr(ctx, a->t); + TCGv_i64 dest = dest_gpr(ctx, a->t); #ifdef CONFIG_USER_ONLY /* We don't implement space registers in user mode. */ - tcg_gen_movi_reg(dest, 0); + tcg_gen_movi_i64(dest, 0); #else TCGv_i64 t0 = tcg_temp_new_i64(); @@ -2228,13 +2130,13 @@ static bool trans_rsm(DisasContext *ctx, arg_rsm *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_reg tmp; + TCGv_i64 tmp; nullify_over(ctx); tmp = tcg_temp_new(); - tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, psw)); - tcg_gen_andi_reg(tmp, tmp, ~a->i); + tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, psw)); + tcg_gen_andi_i64(tmp, tmp, ~a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); save_gpr(ctx, a->t, tmp); @@ -2248,13 +2150,13 @@ static bool trans_ssm(DisasContext *ctx, arg_ssm *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_reg tmp; + TCGv_i64 tmp; nullify_over(ctx); tmp = tcg_temp_new(); - tcg_gen_ld_reg(tmp, tcg_env, offsetof(CPUHPPAState, psw)); - tcg_gen_ori_reg(tmp, tmp, a->i); + tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, psw)); + tcg_gen_ori_i64(tmp, tmp, a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); save_gpr(ctx, a->t, tmp); @@ -2268,7 +2170,7 @@ static bool trans_mtsm(DisasContext *ctx, arg_mtsm *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_reg tmp, reg; + TCGv_i64 tmp, reg; nullify_over(ctx); reg = load_gpr(ctx, a->r); @@ -2345,12 +2247,12 @@ static bool trans_getshadowregs(DisasContext *ctx, arg_getshadowregs *a) static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a) { if (a->m) { - TCGv_reg dest = dest_gpr(ctx, a->b); - TCGv_reg src1 = load_gpr(ctx, a->b); - TCGv_reg src2 = load_gpr(ctx, a->x); + TCGv_i64 dest = dest_gpr(ctx, a->b); + TCGv_i64 src1 = load_gpr(ctx, a->b); + TCGv_i64 src2 = load_gpr(ctx, a->x); /* The only thing we need to do is the base register modification. */ - tcg_gen_add_reg(dest, src1, src2); + tcg_gen_add_i64(dest, src1, src2); save_gpr(ctx, a->b, dest); } cond_free(&ctx->null_cond); @@ -2359,9 +2261,9 @@ static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a) static bool trans_probe(DisasContext *ctx, arg_probe *a) { - TCGv_reg dest, ofs; + TCGv_i64 dest, ofs; TCGv_i32 level, want; - TCGv_tl addr; + TCGv_i64 addr; nullify_over(ctx); @@ -2372,7 +2274,7 @@ static bool trans_probe(DisasContext *ctx, arg_probe *a) level = tcg_constant_i32(a->ri); } else { level = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(level, load_gpr(ctx, a->ri)); + tcg_gen_extrl_i64_i32(level, load_gpr(ctx, a->ri)); tcg_gen_andi_i32(level, level, 3); } want = tcg_constant_i32(a->write ? PAGE_WRITE : PAGE_READ); @@ -2390,8 +2292,8 @@ static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) } CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_tl addr; - TCGv_reg ofs, reg; + TCGv_i64 addr; + TCGv_i64 ofs, reg; nullify_over(ctx); @@ -2415,8 +2317,8 @@ static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlbx *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_tl addr; - TCGv_reg ofs; + TCGv_i64 addr; + TCGv_i64 ofs; nullify_over(ctx); @@ -2451,8 +2353,8 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) } CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_tl addr, atl, stl; - TCGv_reg reg; + TCGv_i64 addr, atl, stl; + TCGv_i64 reg; nullify_over(ctx); @@ -2462,9 +2364,9 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) * return gen_illegal(ctx); */ - atl = tcg_temp_new_tl(); - stl = tcg_temp_new_tl(); - addr = tcg_temp_new_tl(); + atl = tcg_temp_new_i64(); + stl = tcg_temp_new_i64(); + addr = tcg_temp_new_i64(); tcg_gen_ld32u_i64(stl, tcg_env, a->data ? offsetof(CPUHPPAState, cr[CR_ISR]) @@ -2513,8 +2415,8 @@ static bool trans_lpa(DisasContext *ctx, arg_ldst *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - TCGv_tl vaddr; - TCGv_reg ofs, paddr; + TCGv_i64 vaddr; + TCGv_i64 ofs, paddr; nullify_over(ctx); @@ -2541,7 +2443,7 @@ static bool trans_lci(DisasContext *ctx, arg_lci *a) physical address. Two addresses with the same CI have a coherent view of the cache. Our implementation is to return 0 for all, since the entire address space is coherent. */ - save_gpr(ctx, a->t, tcg_constant_reg(0)); + save_gpr(ctx, a->t, tcg_constant_i64(0)); cond_free(&ctx->null_cond); return true; @@ -2604,12 +2506,12 @@ static bool trans_sub_b_tsv(DisasContext *ctx, arg_rrr_cf_d *a) static bool trans_andcm(DisasContext *ctx, arg_rrr_cf_d *a) { - return do_log_reg(ctx, a, tcg_gen_andc_reg); + return do_log_reg(ctx, a, tcg_gen_andc_i64); } static bool trans_and(DisasContext *ctx, arg_rrr_cf_d *a) { - return do_log_reg(ctx, a, tcg_gen_and_reg); + return do_log_reg(ctx, a, tcg_gen_and_i64); } static bool trans_or(DisasContext *ctx, arg_rrr_cf_d *a) @@ -2625,8 +2527,8 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf_d *a) } if (r2 == 0) { /* COPY */ if (r1 == 0) { - TCGv_reg dest = dest_gpr(ctx, rt); - tcg_gen_movi_reg(dest, 0); + TCGv_i64 dest = dest_gpr(ctx, rt); + tcg_gen_movi_i64(dest, 0); save_gpr(ctx, rt, dest); } else { save_gpr(ctx, rt, cpu_gr[r1]); @@ -2661,17 +2563,17 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf_d *a) } #endif } - return do_log_reg(ctx, a, tcg_gen_or_reg); + return do_log_reg(ctx, a, tcg_gen_or_i64); } static bool trans_xor(DisasContext *ctx, arg_rrr_cf_d *a) { - return do_log_reg(ctx, a, tcg_gen_xor_reg); + return do_log_reg(ctx, a, tcg_gen_xor_i64); } static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf_d *a) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); @@ -2684,20 +2586,20 @@ static bool trans_cmpclr(DisasContext *ctx, arg_rrr_cf_d *a) static bool trans_uxor(DisasContext *ctx, arg_rrr_cf_d *a) { - TCGv_reg tcg_r1, tcg_r2; + TCGv_i64 tcg_r1, tcg_r2; if (a->cf) { nullify_over(ctx); } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - do_unit(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d, false, tcg_gen_xor_reg); + do_unit(ctx, a->t, tcg_r1, tcg_r2, a->cf, a->d, false, tcg_gen_xor_i64); return nullify_end(ctx); } static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tc) { - TCGv_reg tcg_r1, tcg_r2, tmp; + TCGv_i64 tcg_r1, tcg_r2, tmp; if (a->cf) { nullify_over(ctx); @@ -2705,8 +2607,8 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tc) tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); tmp = tcg_temp_new(); - tcg_gen_not_reg(tmp, tcg_r2); - do_unit(ctx, a->t, tcg_r1, tmp, a->cf, a->d, is_tc, tcg_gen_add_reg); + tcg_gen_not_i64(tmp, tcg_r2); + do_unit(ctx, a->t, tcg_r1, tmp, a->cf, a->d, is_tc, tcg_gen_add_i64); return nullify_end(ctx); } @@ -2722,19 +2624,19 @@ static bool trans_uaddcm_tc(DisasContext *ctx, arg_rrr_cf_d *a) static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) { - TCGv_reg tmp; + TCGv_i64 tmp; nullify_over(ctx); tmp = tcg_temp_new(); - tcg_gen_shri_reg(tmp, cpu_psw_cb, 3); + tcg_gen_shri_i64(tmp, cpu_psw_cb, 3); if (!is_i) { - tcg_gen_not_reg(tmp, tmp); + tcg_gen_not_i64(tmp, tmp); } - tcg_gen_andi_reg(tmp, tmp, (uint64_t)0x1111111111111111ull); - tcg_gen_muli_reg(tmp, tmp, 6); + tcg_gen_andi_i64(tmp, tmp, (uint64_t)0x1111111111111111ull); + tcg_gen_muli_i64(tmp, tmp, 6); do_unit(ctx, a->t, load_gpr(ctx, a->r), tmp, a->cf, a->d, false, - is_i ? tcg_gen_add_reg : tcg_gen_sub_reg); + is_i ? tcg_gen_add_i64 : tcg_gen_sub_i64); return nullify_end(ctx); } @@ -2750,8 +2652,8 @@ static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf_d *a) static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) { - TCGv_reg dest, add1, add2, addc, zero, in1, in2; - TCGv_reg cout; + TCGv_i64 dest, add1, add2, addc, zero, in1, in2; + TCGv_i64 cout; nullify_over(ctx); @@ -2762,11 +2664,11 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) add2 = tcg_temp_new(); addc = tcg_temp_new(); dest = tcg_temp_new(); - zero = tcg_constant_reg(0); + zero = tcg_constant_i64(0); /* Form R1 << 1 | PSW[CB]{8}. */ - tcg_gen_add_reg(add1, in1, in1); - tcg_gen_add_reg(add1, add1, get_psw_carry(ctx, false)); + tcg_gen_add_i64(add1, in1, in1); + tcg_gen_add_i64(add1, add1, get_psw_carry(ctx, false)); /* * Add or subtract R2, depending on PSW[V]. Proper computation of @@ -2774,28 +2676,28 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) * the manual. By extracting and masking V, we can produce the * proper inputs to the addition without movcond. */ - tcg_gen_sextract_reg(addc, cpu_psw_v, 31, 1); - tcg_gen_xor_reg(add2, in2, addc); - tcg_gen_andi_reg(addc, addc, 1); + tcg_gen_sextract_i64(addc, cpu_psw_v, 31, 1); + tcg_gen_xor_i64(add2, in2, addc); + tcg_gen_andi_i64(addc, addc, 1); - tcg_gen_add2_reg(dest, cpu_psw_cb_msb, add1, zero, add2, zero); - tcg_gen_add2_reg(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); + tcg_gen_add2_i64(dest, cpu_psw_cb_msb, add1, zero, add2, zero); + tcg_gen_add2_i64(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); /* Write back the result register. */ save_gpr(ctx, a->t, dest); /* Write back PSW[CB]. */ - tcg_gen_xor_reg(cpu_psw_cb, add1, add2); - tcg_gen_xor_reg(cpu_psw_cb, cpu_psw_cb, dest); + tcg_gen_xor_i64(cpu_psw_cb, add1, add2); + tcg_gen_xor_i64(cpu_psw_cb, cpu_psw_cb, dest); /* Write back PSW[V] for the division step. */ cout = get_psw_carry(ctx, false); - tcg_gen_neg_reg(cpu_psw_v, cout); - tcg_gen_xor_reg(cpu_psw_v, cpu_psw_v, in2); + tcg_gen_neg_i64(cpu_psw_v, cout); + tcg_gen_xor_i64(cpu_psw_v, cpu_psw_v, in2); /* Install the new nullification. */ if (a->cf) { - TCGv_reg sv = NULL; + TCGv_i64 sv = NULL; if (cond_need_sv(a->cf >> 1)) { /* ??? The lshift is supposed to contribute to overflow. */ sv = do_add_sv(ctx, dest, add1, add2); @@ -2838,13 +2740,13 @@ static bool trans_subi_tsv(DisasContext *ctx, arg_rri_cf *a) static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf_d *a) { - TCGv_reg tcg_im, tcg_r2; + TCGv_i64 tcg_im, tcg_r2; if (a->cf) { nullify_over(ctx); } - tcg_im = tcg_constant_reg(a->i); + tcg_im = tcg_constant_i64(a->i); tcg_r2 = load_gpr(ctx, a->r); do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf, a->d); @@ -2872,8 +2774,8 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a) static bool trans_ldc(DisasContext *ctx, arg_ldst *a) { MemOp mop = MO_TE | MO_ALIGN | a->size; - TCGv_reg zero, dest, ofs; - TCGv_tl addr; + TCGv_i64 zero, dest, ofs; + TCGv_i64 addr; if (!ctx->is_pa20 && a->size > MO_32) { return gen_illegal(ctx); @@ -2902,8 +2804,8 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) */ gen_helper_ldc_check(addr); - zero = tcg_constant_reg(0); - tcg_gen_atomic_xchg_reg(dest, addr, zero, ctx->mmu_idx, mop); + zero = tcg_constant_i64(0); + tcg_gen_atomic_xchg_i64(dest, addr, zero, ctx->mmu_idx, mop); if (a->m) { save_gpr(ctx, a->b, ofs); @@ -2915,8 +2817,8 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) static bool trans_stby(DisasContext *ctx, arg_stby *a) { - TCGv_reg ofs, val; - TCGv_tl addr; + TCGv_i64 ofs, val; + TCGv_i64 addr; nullify_over(ctx); @@ -2937,7 +2839,7 @@ static bool trans_stby(DisasContext *ctx, arg_stby *a) } } if (a->m) { - tcg_gen_andi_reg(ofs, ofs, ~3); + tcg_gen_andi_i64(ofs, ofs, ~3); save_gpr(ctx, a->b, ofs); } @@ -2946,8 +2848,8 @@ static bool trans_stby(DisasContext *ctx, arg_stby *a) static bool trans_stdby(DisasContext *ctx, arg_stby *a) { - TCGv_reg ofs, val; - TCGv_tl addr; + TCGv_i64 ofs, val; + TCGv_i64 addr; nullify_over(ctx); @@ -2968,7 +2870,7 @@ static bool trans_stdby(DisasContext *ctx, arg_stby *a) } } if (a->m) { - tcg_gen_andi_reg(ofs, ofs, ~7); + tcg_gen_andi_i64(ofs, ofs, ~7); save_gpr(ctx, a->b, ofs); } @@ -2999,9 +2901,9 @@ static bool trans_sta(DisasContext *ctx, arg_ldst *a) static bool trans_ldil(DisasContext *ctx, arg_ldil *a) { - TCGv_reg tcg_rt = dest_gpr(ctx, a->t); + TCGv_i64 tcg_rt = dest_gpr(ctx, a->t); - tcg_gen_movi_reg(tcg_rt, a->i); + tcg_gen_movi_i64(tcg_rt, a->i); save_gpr(ctx, a->t, tcg_rt); cond_free(&ctx->null_cond); return true; @@ -3009,10 +2911,10 @@ static bool trans_ldil(DisasContext *ctx, arg_ldil *a) static bool trans_addil(DisasContext *ctx, arg_addil *a) { - TCGv_reg tcg_rt = load_gpr(ctx, a->r); - TCGv_reg tcg_r1 = dest_gpr(ctx, 1); + TCGv_i64 tcg_rt = load_gpr(ctx, a->r); + TCGv_i64 tcg_r1 = dest_gpr(ctx, 1); - tcg_gen_addi_reg(tcg_r1, tcg_rt, a->i); + tcg_gen_addi_i64(tcg_r1, tcg_rt, a->i); save_gpr(ctx, 1, tcg_r1); cond_free(&ctx->null_cond); return true; @@ -3020,30 +2922,30 @@ static bool trans_addil(DisasContext *ctx, arg_addil *a) static bool trans_ldo(DisasContext *ctx, arg_ldo *a) { - TCGv_reg tcg_rt = dest_gpr(ctx, a->t); + TCGv_i64 tcg_rt = dest_gpr(ctx, a->t); /* Special case rb == 0, for the LDI pseudo-op. The COPY pseudo-op is handled for free within tcg_gen_addi_tl. */ if (a->b == 0) { - tcg_gen_movi_reg(tcg_rt, a->i); + tcg_gen_movi_i64(tcg_rt, a->i); } else { - tcg_gen_addi_reg(tcg_rt, cpu_gr[a->b], a->i); + tcg_gen_addi_i64(tcg_rt, cpu_gr[a->b], a->i); } save_gpr(ctx, a->t, tcg_rt); cond_free(&ctx->null_cond); return true; } -static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, +static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_i64 in1, unsigned c, unsigned f, bool d, unsigned n, int disp) { - TCGv_reg dest, in2, sv; + TCGv_i64 dest, in2, sv; DisasCond cond; in2 = load_gpr(ctx, r); dest = tcg_temp_new(); - tcg_gen_sub_reg(dest, in1, in2); + tcg_gen_sub_i64(dest, in1, in2); sv = NULL; if (cond_need_sv(c)) { @@ -3070,14 +2972,14 @@ static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) return false; } nullify_over(ctx); - return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), + return do_cmpb(ctx, a->r, tcg_constant_i64(a->i), a->c, a->f, a->d, a->n, a->disp); } -static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, +static bool do_addb(DisasContext *ctx, unsigned r, TCGv_i64 in1, unsigned c, unsigned f, unsigned n, int disp) { - TCGv_reg dest, in2, sv, cb_cond; + TCGv_i64 dest, in2, sv, cb_cond; DisasCond cond; bool d = false; @@ -3098,16 +3000,16 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, cb_cond = NULL; if (cond_need_cb(c)) { - TCGv_reg cb = tcg_temp_new(); - TCGv_reg cb_msb = tcg_temp_new(); + TCGv_i64 cb = tcg_temp_new(); + TCGv_i64 cb_msb = tcg_temp_new(); - tcg_gen_movi_reg(cb_msb, 0); - tcg_gen_add2_reg(dest, cb_msb, in1, cb_msb, in2, cb_msb); - tcg_gen_xor_reg(cb, in1, in2); - tcg_gen_xor_reg(cb, cb, dest); + tcg_gen_movi_i64(cb_msb, 0); + tcg_gen_add2_i64(dest, cb_msb, in1, cb_msb, in2, cb_msb); + tcg_gen_xor_i64(cb, in1, in2); + tcg_gen_xor_i64(cb, cb, dest); cb_cond = get_carry(ctx, d, cb, cb_msb); } else { - tcg_gen_add_reg(dest, in1, in2); + tcg_gen_add_i64(dest, in1, in2); } if (cond_need_sv(c)) { sv = do_add_sv(ctx, dest, in1, in2); @@ -3127,12 +3029,12 @@ static bool trans_addb(DisasContext *ctx, arg_addb *a) static bool trans_addbi(DisasContext *ctx, arg_addbi *a) { nullify_over(ctx); - return do_addb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); + return do_addb(ctx, a->r, tcg_constant_i64(a->i), a->c, a->f, a->n, a->disp); } static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) { - TCGv_reg tmp, tcg_r; + TCGv_i64 tmp, tcg_r; DisasCond cond; nullify_over(ctx); @@ -3141,10 +3043,10 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) tcg_r = load_gpr(ctx, a->r); if (cond_need_ext(ctx, a->d)) { /* Force shift into [32,63] */ - tcg_gen_ori_reg(tmp, cpu_sar, 32); - tcg_gen_shl_reg(tmp, tcg_r, tmp); + tcg_gen_ori_i64(tmp, cpu_sar, 32); + tcg_gen_shl_i64(tmp, tcg_r, tmp); } else { - tcg_gen_shl_reg(tmp, tcg_r, cpu_sar); + tcg_gen_shl_i64(tmp, tcg_r, cpu_sar); } cond = cond_make_0_tmp(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); @@ -3153,7 +3055,7 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) { - TCGv_reg tmp, tcg_r; + TCGv_i64 tmp, tcg_r; DisasCond cond; int p; @@ -3162,7 +3064,7 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); p = a->p | (cond_need_ext(ctx, a->d) ? 32 : 0); - tcg_gen_shli_reg(tmp, tcg_r, p); + tcg_gen_shli_i64(tmp, tcg_r, p); cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); return do_cbranch(ctx, a->disp, a->n, &cond); @@ -3170,16 +3072,16 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) static bool trans_movb(DisasContext *ctx, arg_movb *a) { - TCGv_reg dest; + TCGv_i64 dest; DisasCond cond; nullify_over(ctx); dest = dest_gpr(ctx, a->r2); if (a->r1 == 0) { - tcg_gen_movi_reg(dest, 0); + tcg_gen_movi_i64(dest, 0); } else { - tcg_gen_mov_reg(dest, cpu_gr[a->r1]); + tcg_gen_mov_i64(dest, cpu_gr[a->r1]); } /* All MOVB conditions are 32-bit. */ @@ -3189,13 +3091,13 @@ static bool trans_movb(DisasContext *ctx, arg_movb *a) static bool trans_movbi(DisasContext *ctx, arg_movbi *a) { - TCGv_reg dest; + TCGv_i64 dest; DisasCond cond; nullify_over(ctx); dest = dest_gpr(ctx, a->r); - tcg_gen_movi_reg(dest, a->i); + tcg_gen_movi_i64(dest, a->i); /* All MOVBI conditions are 32-bit. */ cond = do_sed_cond(ctx, a->c, false, dest); @@ -3204,7 +3106,7 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a) static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) { - TCGv_reg dest, tmp; + TCGv_i64 dest, tmp; if (!ctx->is_pa20 && a->d) { return false; @@ -3216,40 +3118,40 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) dest = dest_gpr(ctx, a->t); if (a->r1 == 0) { if (a->d) { - tcg_gen_shr_reg(dest, dest, cpu_sar); + tcg_gen_shr_i64(dest, dest, cpu_sar); } else { - tcg_gen_ext32u_reg(dest, load_gpr(ctx, a->r2)); + tcg_gen_ext32u_i64(dest, load_gpr(ctx, a->r2)); tmp = tcg_temp_new(); - tcg_gen_andi_reg(tmp, cpu_sar, 31); - tcg_gen_shr_reg(dest, dest, tmp); + tcg_gen_andi_i64(tmp, cpu_sar, 31); + tcg_gen_shr_i64(dest, dest, tmp); } } else if (a->r1 == a->r2) { if (a->d) { - tcg_gen_rotr_reg(dest, load_gpr(ctx, a->r2), cpu_sar); + tcg_gen_rotr_i64(dest, load_gpr(ctx, a->r2), cpu_sar); } else { TCGv_i32 t32 = tcg_temp_new_i32(); TCGv_i32 s32 = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(t32, load_gpr(ctx, a->r2)); - tcg_gen_trunc_reg_i32(s32, cpu_sar); + tcg_gen_extrl_i64_i32(t32, load_gpr(ctx, a->r2)); + tcg_gen_extrl_i64_i32(s32, cpu_sar); tcg_gen_andi_i32(s32, s32, 31); tcg_gen_rotr_i32(t32, t32, s32); - tcg_gen_extu_i32_reg(dest, t32); + tcg_gen_extu_i32_i64(dest, t32); } } else if (a->d) { - TCGv_reg t = tcg_temp_new(); - TCGv_reg n = tcg_temp_new(); + TCGv_i64 t = tcg_temp_new(); + TCGv_i64 n = tcg_temp_new(); - tcg_gen_xori_reg(n, cpu_sar, 63); - tcg_gen_shl_reg(t, load_gpr(ctx, a->r2), n); - tcg_gen_shli_reg(t, t, 1); - tcg_gen_shr_reg(dest, load_gpr(ctx, a->r1), cpu_sar); - tcg_gen_or_reg(dest, dest, t); + tcg_gen_xori_i64(n, cpu_sar, 63); + tcg_gen_shl_i64(t, load_gpr(ctx, a->r2), n); + tcg_gen_shli_i64(t, t, 1); + tcg_gen_shr_i64(dest, load_gpr(ctx, a->r1), cpu_sar); + tcg_gen_or_i64(dest, dest, t); } else { TCGv_i64 t = tcg_temp_new_i64(); TCGv_i64 s = tcg_temp_new_i64(); - tcg_gen_concat_reg_i64(t, load_gpr(ctx, a->r2), load_gpr(ctx, a->r1)); + tcg_gen_concat32_i64(t, load_gpr(ctx, a->r2), load_gpr(ctx, a->r1)); tcg_gen_extu_reg_i64(s, cpu_sar); tcg_gen_andi_i64(s, s, 31); tcg_gen_shr_i64(t, t, s); @@ -3268,7 +3170,7 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) { unsigned width, sa; - TCGv_reg dest, t2; + TCGv_i64 dest, t2; if (!ctx->is_pa20 && a->d) { return false; @@ -3283,19 +3185,19 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) dest = dest_gpr(ctx, a->t); t2 = load_gpr(ctx, a->r2); if (a->r1 == 0) { - tcg_gen_extract_reg(dest, t2, sa, width - sa); + tcg_gen_extract_i64(dest, t2, sa, width - sa); } else if (width == TARGET_LONG_BITS) { - tcg_gen_extract2_reg(dest, t2, cpu_gr[a->r1], sa); + tcg_gen_extract2_i64(dest, t2, cpu_gr[a->r1], sa); } else { assert(!a->d); if (a->r1 == a->r2) { TCGv_i32 t32 = tcg_temp_new_i32(); - tcg_gen_trunc_reg_i32(t32, t2); + tcg_gen_extrl_i64_i32(t32, t2); tcg_gen_rotri_i32(t32, t32, sa); - tcg_gen_extu_i32_reg(dest, t32); + tcg_gen_extu_i32_i64(dest, t32); } else { TCGv_i64 t64 = tcg_temp_new_i64(); - tcg_gen_concat_reg_i64(t64, t2, cpu_gr[a->r1]); + tcg_gen_concat32_i64(t64, t2, cpu_gr[a->r1]); tcg_gen_shri_i64(t64, t64, sa); tcg_gen_trunc_i64_reg(dest, t64); } @@ -3313,7 +3215,7 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) { unsigned widthm1 = a->d ? 63 : 31; - TCGv_reg dest, src, tmp; + TCGv_i64 dest, src, tmp; if (!ctx->is_pa20 && a->d) { return false; @@ -3327,15 +3229,15 @@ static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) tmp = tcg_temp_new(); /* Recall that SAR is using big-endian bit numbering. */ - tcg_gen_andi_reg(tmp, cpu_sar, widthm1); - tcg_gen_xori_reg(tmp, tmp, widthm1); + tcg_gen_andi_i64(tmp, cpu_sar, widthm1); + tcg_gen_xori_i64(tmp, tmp, widthm1); if (a->se) { - tcg_gen_sar_reg(dest, src, tmp); - tcg_gen_sextract_reg(dest, dest, 0, a->len); + tcg_gen_sar_i64(dest, src, tmp); + tcg_gen_sextract_i64(dest, dest, 0, a->len); } else { - tcg_gen_shr_reg(dest, src, tmp); - tcg_gen_extract_reg(dest, dest, 0, a->len); + tcg_gen_shr_i64(dest, src, tmp); + tcg_gen_extract_i64(dest, dest, 0, a->len); } save_gpr(ctx, a->t, dest); @@ -3350,7 +3252,7 @@ static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) { unsigned len, cpos, width; - TCGv_reg dest, src; + TCGv_i64 dest, src; if (!ctx->is_pa20 && a->d) { return false; @@ -3369,9 +3271,9 @@ static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) dest = dest_gpr(ctx, a->t); src = load_gpr(ctx, a->r); if (a->se) { - tcg_gen_sextract_reg(dest, src, cpos, len); + tcg_gen_sextract_i64(dest, src, cpos, len); } else { - tcg_gen_extract_reg(dest, src, cpos, len); + tcg_gen_extract_i64(dest, src, cpos, len); } save_gpr(ctx, a->t, dest); @@ -3387,7 +3289,7 @@ static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) { unsigned len, width; uint64_t mask0, mask1; - TCGv_reg dest; + TCGv_i64 dest; if (!ctx->is_pa20 && a->d) { return false; @@ -3407,11 +3309,11 @@ static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) mask1 = deposit64(-1, a->cpos, len, a->i); if (a->nz) { - TCGv_reg src = load_gpr(ctx, a->t); - tcg_gen_andi_reg(dest, src, mask1); - tcg_gen_ori_reg(dest, dest, mask0); + TCGv_i64 src = load_gpr(ctx, a->t); + tcg_gen_andi_i64(dest, src, mask1); + tcg_gen_ori_i64(dest, dest, mask0); } else { - tcg_gen_movi_reg(dest, mask0); + tcg_gen_movi_i64(dest, mask0); } save_gpr(ctx, a->t, dest); @@ -3427,7 +3329,7 @@ static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) { unsigned rs = a->nz ? a->t : 0; unsigned len, width; - TCGv_reg dest, val; + TCGv_i64 dest, val; if (!ctx->is_pa20 && a->d) { return false; @@ -3445,9 +3347,9 @@ static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) dest = dest_gpr(ctx, a->t); val = load_gpr(ctx, a->r); if (rs == 0) { - tcg_gen_deposit_z_reg(dest, val, a->cpos, len); + tcg_gen_deposit_z_i64(dest, val, a->cpos, len); } else { - tcg_gen_deposit_reg(dest, cpu_gr[rs], val, a->cpos, len); + tcg_gen_deposit_i64(dest, cpu_gr[rs], val, a->cpos, len); } save_gpr(ctx, a->t, dest); @@ -3460,11 +3362,11 @@ static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) } static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, - bool d, bool nz, unsigned len, TCGv_reg val) + bool d, bool nz, unsigned len, TCGv_i64 val) { unsigned rs = nz ? rt : 0; unsigned widthm1 = d ? 63 : 31; - TCGv_reg mask, tmp, shift, dest; + TCGv_i64 mask, tmp, shift, dest; uint64_t msb = 1ULL << (len - 1); dest = dest_gpr(ctx, rt); @@ -3472,19 +3374,19 @@ static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, tmp = tcg_temp_new(); /* Convert big-endian bit numbering in SAR to left-shift. */ - tcg_gen_andi_reg(shift, cpu_sar, widthm1); - tcg_gen_xori_reg(shift, shift, widthm1); + tcg_gen_andi_i64(shift, cpu_sar, widthm1); + tcg_gen_xori_i64(shift, shift, widthm1); mask = tcg_temp_new(); - tcg_gen_movi_reg(mask, msb + (msb - 1)); - tcg_gen_and_reg(tmp, val, mask); + tcg_gen_movi_i64(mask, msb + (msb - 1)); + tcg_gen_and_i64(tmp, val, mask); if (rs) { - tcg_gen_shl_reg(mask, mask, shift); - tcg_gen_shl_reg(tmp, tmp, shift); - tcg_gen_andc_reg(dest, cpu_gr[rs], mask); - tcg_gen_or_reg(dest, dest, tmp); + tcg_gen_shl_i64(mask, mask, shift); + tcg_gen_shl_i64(tmp, tmp, shift); + tcg_gen_andc_i64(dest, cpu_gr[rs], mask); + tcg_gen_or_i64(dest, dest, tmp); } else { - tcg_gen_shl_reg(dest, tmp, shift); + tcg_gen_shl_i64(dest, tmp, shift); } save_gpr(ctx, rt, dest); @@ -3517,12 +3419,12 @@ static bool trans_depi_sar(DisasContext *ctx, arg_depi_sar *a) nullify_over(ctx); } return do_dep_sar(ctx, a->t, a->c, a->d, a->nz, a->len, - tcg_constant_reg(a->i)); + tcg_constant_i64(a->i)); } static bool trans_be(DisasContext *ctx, arg_be *a) { - TCGv_reg tmp; + TCGv_i64 tmp; #ifdef CONFIG_USER_ONLY /* ??? It seems like there should be a good way of using @@ -3541,7 +3443,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) #endif tmp = tcg_temp_new(); - tcg_gen_addi_reg(tmp, load_gpr(ctx, a->b), a->disp); + tcg_gen_addi_i64(tmp, load_gpr(ctx, a->b), a->disp); tmp = do_ibranch_priv(ctx, tmp); #ifdef CONFIG_USER_ONLY @@ -3555,8 +3457,8 @@ static bool trans_be(DisasContext *ctx, arg_be *a) tcg_gen_mov_i64(cpu_sr[0], cpu_iasq_f); } if (a->n && use_nullify_skip(ctx)) { - tcg_gen_mov_reg(cpu_iaoq_f, tmp); - tcg_gen_addi_reg(cpu_iaoq_b, cpu_iaoq_f, 4); + tcg_gen_mov_i64(cpu_iaoq_f, tmp); + tcg_gen_addi_i64(cpu_iaoq_b, cpu_iaoq_f, 4); tcg_gen_mov_i64(cpu_iasq_f, new_spc); tcg_gen_mov_i64(cpu_iasq_b, cpu_iasq_f); } else { @@ -3564,7 +3466,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) if (ctx->iaoq_b == -1) { tcg_gen_mov_i64(cpu_iasq_f, cpu_iasq_b); } - tcg_gen_mov_reg(cpu_iaoq_b, tmp); + tcg_gen_mov_i64(cpu_iaoq_b, tmp); tcg_gen_mov_i64(cpu_iasq_b, new_spc); nullify_set(ctx, a->n); } @@ -3623,11 +3525,11 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) #endif if (a->l) { - TCGv_reg tmp = dest_gpr(ctx, a->l); + TCGv_i64 tmp = dest_gpr(ctx, a->l); if (ctx->privilege < 3) { - tcg_gen_andi_reg(tmp, tmp, -4); + tcg_gen_andi_i64(tmp, tmp, -4); } - tcg_gen_ori_reg(tmp, tmp, ctx->privilege); + tcg_gen_ori_i64(tmp, tmp, ctx->privilege); save_gpr(ctx, a->l, tmp); } @@ -3637,9 +3539,9 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) static bool trans_blr(DisasContext *ctx, arg_blr *a) { if (a->x) { - TCGv_reg tmp = tcg_temp_new(); - tcg_gen_shli_reg(tmp, load_gpr(ctx, a->x), 3); - tcg_gen_addi_reg(tmp, tmp, ctx->iaoq_f + 8); + TCGv_i64 tmp = tcg_temp_new(); + tcg_gen_shli_i64(tmp, load_gpr(ctx, a->x), 3); + tcg_gen_addi_i64(tmp, tmp, ctx->iaoq_f + 8); /* The computation here never changes privilege level. */ return do_ibranch(ctx, tmp, a->l, a->n); } else { @@ -3650,14 +3552,14 @@ static bool trans_blr(DisasContext *ctx, arg_blr *a) static bool trans_bv(DisasContext *ctx, arg_bv *a) { - TCGv_reg dest; + TCGv_i64 dest; if (a->x == 0) { dest = load_gpr(ctx, a->b); } else { dest = tcg_temp_new(); - tcg_gen_shli_reg(dest, load_gpr(ctx, a->x), 3); - tcg_gen_add_reg(dest, dest, load_gpr(ctx, a->b)); + tcg_gen_shli_i64(dest, load_gpr(ctx, a->x), 3); + tcg_gen_add_i64(dest, dest, load_gpr(ctx, a->b)); } dest = do_ibranch_priv(ctx, dest); return do_ibranch(ctx, dest, 0, a->n); @@ -3665,7 +3567,7 @@ static bool trans_bv(DisasContext *ctx, arg_bv *a) static bool trans_bve(DisasContext *ctx, arg_bve *a) { - TCGv_reg dest; + TCGv_i64 dest; #ifdef CONFIG_USER_ONLY dest = do_ibranch_priv(ctx, load_gpr(ctx, a->b)); @@ -3988,12 +3890,12 @@ static bool trans_fcmp_d(DisasContext *ctx, arg_fclass2 *a) static bool trans_ftest(DisasContext *ctx, arg_ftest *a) { - TCGv_reg t; + TCGv_i64 t; nullify_over(ctx); t = tcg_temp_new(); - tcg_gen_ld32u_reg(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); + tcg_gen_ld32u_i64(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); if (a->y == 1) { int mask; @@ -4001,7 +3903,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) switch (a->c) { case 0: /* simple */ - tcg_gen_andi_reg(t, t, 0x4000000); + tcg_gen_andi_i64(t, t, 0x4000000); ctx->null_cond = cond_make_0(TCG_COND_NE, t); goto done; case 2: /* rej */ @@ -4030,17 +3932,17 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) return true; } if (inv) { - TCGv_reg c = tcg_constant_reg(mask); - tcg_gen_or_reg(t, t, c); + TCGv_i64 c = tcg_constant_i64(mask); + tcg_gen_or_i64(t, t, c); ctx->null_cond = cond_make(TCG_COND_EQ, t, c); } else { - tcg_gen_andi_reg(t, t, mask); + tcg_gen_andi_i64(t, t, mask); ctx->null_cond = cond_make_0(TCG_COND_EQ, t); } } else { unsigned cbit = (a->y ^ 1) - 1; - tcg_gen_extract_reg(t, t, 21 - cbit, 1); + tcg_gen_extract_i64(t, t, 21 - cbit, 1); ctx->null_cond = cond_make_0(TCG_COND_NE, t); } @@ -4294,7 +4196,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) if (ctx->iaoq_b == -1) { ctx->iaoq_n = -1; ctx->iaoq_n_var = tcg_temp_new(); - tcg_gen_addi_reg(ctx->iaoq_n_var, cpu_iaoq_b, 4); + tcg_gen_addi_i64(ctx->iaoq_n_var, cpu_iaoq_b, 4); } else { ctx->iaoq_n = ctx->iaoq_b + 4; ctx->iaoq_n_var = NULL; @@ -4340,7 +4242,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) case DISAS_IAQ_N_STALE: case DISAS_IAQ_N_STALE_EXIT: if (ctx->iaoq_f == -1) { - tcg_gen_mov_reg(cpu_iaoq_f, cpu_iaoq_b); + tcg_gen_mov_i64(cpu_iaoq_f, cpu_iaoq_b); copy_iaoq_entry(cpu_iaoq_b, ctx->iaoq_n, ctx->iaoq_n_var); #ifndef CONFIG_USER_ONLY tcg_gen_mov_i64(cpu_iasq_f, cpu_iasq_b); @@ -4350,7 +4252,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) ? DISAS_EXIT : DISAS_IAQ_N_UPDATED); } else if (ctx->iaoq_b == -1) { - tcg_gen_mov_reg(cpu_iaoq_b, ctx->iaoq_n_var); + tcg_gen_mov_i64(cpu_iaoq_b, ctx->iaoq_n_var); } break; From patchwork Fri Oct 20 20:43:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736345 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503684wrl; Fri, 20 Oct 2023 13:54:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBwZr/+yBaBaj5X3KGphYZ5zAKHTmxX7xDDus32IxdRM/Vqu6fC9juFmp0ibu5KjAcFy3c X-Received: by 2002:a1f:1dcf:0:b0:49a:7a5b:dab2 with SMTP id d198-20020a1f1dcf000000b0049a7a5bdab2mr2762274vkd.16.1697835268650; Fri, 20 Oct 2023 13:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835268; cv=none; d=google.com; s=arc-20160816; b=GlkE4X3ae0w+XuN4H0JPdoXQgtMRTtBgvUpZEuayqoVtopENznhw+d8mN1JB0lBl0p 9COu6M4tnru8OgyZbGqLxQ2H9OcGSgqWDxpb8VO4enY+4RMlYLzBt4sgMi10zmza5whw 8aSev/AYw3NPOeUbLWe8NxuLhSfx0Z4G/RQO84CMyQCN2G8R2gTEOoCkWFcX21qf0nYq 2vpRt3apcmpylIs22QfPzYVQxd0HPDYq/+Er3X0SUY/O/xQ4x2tjmkYvr6E+d/rcb9ot 5/aKqQXwsHDMGlehL6lhUlTltT3ephXSPgmXfZrqnYgBEg3MG/k2LCXvwTMn8g7pQVVR MXXw== 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=V27FJvCyTyLJjGiSkXiFejIZCBYVGBoOukmrhWxyTiU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=bgfTQVus2yL2hUnyBl4qGonyzF+JbDEsKQ4pvBWng6fBXyEhxAjWj0D73c+xU5lOeh P05TgVRdKetVnjhOrXNFtQFto7fyDx8a6nswngkS3sp+hRfA9OU5q3S/8k7h/BbVL33r Y+vxqMBzBkZyBNWNuGRxTRQAw2mRqWSwVVegl1/8mKQR5cSyD5yd2UdVD/sw4CqaL5A2 vpA1pbHWJnWyS730lyYgd5lHv+gSpJak6BDwbph/7HJMIXOb04SLLcLxlNh6yeT9rZ2g CX7kgQiNkit6T7gj6/gIpk5Ni7pHS1pdO0ayDCe1HmtCAIbybHd5sNidVcekMyji7DNp Doew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vrxX/vsx"; 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 m17-20020a05622a055100b004180387dcc0si1938864qtx.605.2023.10.20.13.54.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:28 -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="vrxX/vsx"; 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 1qtwOx-0001tW-MX; Fri, 20 Oct 2023 16:47:23 -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 1qtwOw-0001pD-5s for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:22 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOs-0001BM-Bp for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:21 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6bd96cfb99cso1114366b3a.2 for ; Fri, 20 Oct 2023 13:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834837; x=1698439637; 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=V27FJvCyTyLJjGiSkXiFejIZCBYVGBoOukmrhWxyTiU=; b=vrxX/vsxWXZe1a3JJfHObxma8tiIJIsdTWBhPPc0sAd7Et0qffMcKxU32cuCZxs7Lr pSkSOPjsr4h+10ymw04HNKBcqlZojFvyQdxnwnKMXA6T9LwE7c7AXymorhct82+8hoSQ HH2kuXUDPD5bR5sbfCmJTv40wDHdZkDyB7jdI3vFFvEgqcskPyirtSxsXP78q7Tx4T+C 5AUm2R8Co1bkhidzsKo6y+uBX/6TNaZkN6UQiZ1hGik+6QLjRWjnDhZ4/GqlOm3MQ/qP XjdtIfuzg86mFYRUMVO32Dtt7xfTIjQBwjSdQObXniioTCp8XTg7vpcUwzsCKtYoQ3Ly KXSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834837; x=1698439637; 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=V27FJvCyTyLJjGiSkXiFejIZCBYVGBoOukmrhWxyTiU=; b=mQuxHE4E3gw0pfLnfkeWpRzBdDOB5aDDNwYoLFv8sSfkNGpglBQyRiLi4BysE64gee c/SFah6DgHnpvHkqvjeyfDYQKRFicBBxFDIvXxG3M0atG2SXifCn0jfQP3hkcSEIkeSS q5qdtDmbPQ8es0VipAfMxkzmwGdLtwtCf2T425RTk6xivhDDWI63ZfP6PkY6F93LCJCw ZrfbRti2h8pPureGUjHsw69XS4v4Pd3NSMgTmBE7oAuC3z0gSdF9r2zj3IvgenLfn3iG PXEVSDVW4GMqAk62+edT0RjMNj6Mpg/gQb1WTh8DBAworlFccITd4D03Ld8fkI+nT6yH Yk8g== X-Gm-Message-State: AOJu0Yw9497EstPnHJaozlQzp/+L54KaDqoOX7wlJgpVduYnRXzR2oxv ZO5TO1dGc20hAY7NqT0+H+yUDVQtKOhFeMgXUBY= X-Received: by 2002:a05:6a00:1913:b0:6be:26c1:be48 with SMTP id y19-20020a056a00191300b006be26c1be48mr3170962pfi.33.1697834836903; Fri, 20 Oct 2023 13:47:16 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 49/65] target/hppa: Remove remaining TARGET_REGISTER_BITS redirections Date: Fri, 20 Oct 2023 13:43:15 -0700 Message-Id: <20231020204331.139847-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 conversions to/from i64 can be eliminated entirely, folding computation into adjacent operations. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 46 ++++++++++++----------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 1a57ccc49b..95de007c69 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -33,15 +33,6 @@ #undef HELPER_H -/* Since we have a distinction between register size and address size, - we need to redefine all of these. */ - -#define tcg_gen_extu_reg_tl tcg_gen_mov_i64 -#define tcg_gen_trunc_i64_reg tcg_gen_mov_i64 -#define tcg_gen_extu_reg_i64 tcg_gen_mov_i64 -#define tcg_gen_ext_reg_i64 tcg_gen_mov_i64 - - typedef struct DisasCond { TCGCond c; TCGv_i64 a0, a1; @@ -1332,8 +1323,7 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, *pofs = ofs; *pgva = addr = tcg_temp_new_i64(); - tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); - tcg_gen_andi_tl(addr, addr, gva_offset_mask(ctx)); + tcg_gen_andi_tl(addr, modify <= 0 ? ofs : base, gva_offset_mask(ctx)); #ifndef CONFIG_USER_ONLY if (!is_phys) { tcg_gen_or_tl(addr, addr, space_select(ctx, sp, base)); @@ -1945,13 +1935,11 @@ static bool trans_mfsp(DisasContext *ctx, arg_mfsp *a) unsigned rt = a->t; unsigned rs = a->sp; TCGv_i64 t0 = tcg_temp_new_i64(); - TCGv_i64 t1 = tcg_temp_new(); load_spr(ctx, t0, rs); tcg_gen_shri_i64(t0, t0, 32); - tcg_gen_trunc_i64_reg(t1, t0); - save_gpr(ctx, rt, t1); + save_gpr(ctx, rt, t0); cond_free(&ctx->null_cond); return true; @@ -2008,22 +1996,21 @@ static bool trans_mtsp(DisasContext *ctx, arg_mtsp *a) { unsigned rr = a->r; unsigned rs = a->sp; - TCGv_i64 t64; + TCGv_i64 tmp; if (rs >= 5) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_REG); } nullify_over(ctx); - t64 = tcg_temp_new_i64(); - tcg_gen_extu_reg_i64(t64, load_gpr(ctx, rr)); - tcg_gen_shli_i64(t64, t64, 32); + tmp = tcg_temp_new_i64(); + tcg_gen_shli_i64(tmp, load_gpr(ctx, rr), 32); if (rs >= 4) { - tcg_gen_st_i64(t64, tcg_env, offsetof(CPUHPPAState, sr[rs])); + tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUHPPAState, sr[rs])); ctx->tb_flags &= ~TB_FLAG_SR_SAME; } else { - tcg_gen_mov_i64(cpu_sr[rs], t64); + tcg_gen_mov_i64(cpu_sr[rs], tmp); } return nullify_end(ctx); @@ -2114,11 +2101,8 @@ static bool trans_ldsid(DisasContext *ctx, arg_ldsid *a) /* We don't implement space registers in user mode. */ tcg_gen_movi_i64(dest, 0); #else - TCGv_i64 t0 = tcg_temp_new_i64(); - - tcg_gen_mov_i64(t0, space_select(ctx, a->sp, load_gpr(ctx, a->b))); - tcg_gen_shri_i64(t0, t0, 32); - tcg_gen_trunc_i64_reg(dest, t0); + tcg_gen_mov_i64(dest, space_select(ctx, a->sp, load_gpr(ctx, a->b))); + tcg_gen_shri_i64(dest, dest, 32); #endif save_gpr(ctx, a->t, dest); @@ -3152,10 +3136,8 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) TCGv_i64 s = tcg_temp_new_i64(); tcg_gen_concat32_i64(t, load_gpr(ctx, a->r2), load_gpr(ctx, a->r1)); - tcg_gen_extu_reg_i64(s, cpu_sar); - tcg_gen_andi_i64(s, s, 31); - tcg_gen_shr_i64(t, t, s); - tcg_gen_trunc_i64_reg(dest, t); + tcg_gen_andi_i64(s, cpu_sar, 31); + tcg_gen_shr_i64(dest, t, s); } save_gpr(ctx, a->t, dest); @@ -3196,10 +3178,8 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) tcg_gen_rotri_i32(t32, t32, sa); tcg_gen_extu_i32_i64(dest, t32); } else { - TCGv_i64 t64 = tcg_temp_new_i64(); - tcg_gen_concat32_i64(t64, t2, cpu_gr[a->r1]); - tcg_gen_shri_i64(t64, t64, sa); - tcg_gen_trunc_i64_reg(dest, t64); + tcg_gen_concat32_i64(dest, t2, cpu_gr[a->r1]); + tcg_gen_extract_i64(dest, dest, sa, 32); } } save_gpr(ctx, a->t, dest); From patchwork Fri Oct 20 20:43:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736307 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502090wrl; Fri, 20 Oct 2023 13:48:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6uWXFokhF4r/I4kGDBmYYUa2PVY/FjQOL7dAje2lIKw6+V8ujZoYLPsp33GB0wKsYGxHd X-Received: by 2002:a05:622a:344:b0:417:97b3:6cc8 with SMTP id r4-20020a05622a034400b0041797b36cc8mr3145072qtw.41.1697834909132; Fri, 20 Oct 2023 13:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834909; cv=none; d=google.com; s=arc-20160816; b=LmJ1IYD3mbv63tomgWHDdvGdVmIOofLdFyUZzGj2LMM37JHL20d/YatH3bjG0IaK0x fLhhO2D5dCv1NqK1cTeuvzDjdMIjwraPrtV3dnNoM0d1gbkoapoC01VyYPKILmj3sfzf OtE2gOXlEqNeZPTdQfBBk3gbo8q3bM1rozadQKq8JY53g6eJPF6lSnSkhM8nJOxxPZLG GXXcuevy8+/EvhWrkltjafaPIG9+e9HEtTD6LX2DBscsnsXClIhD5DztfvHW0jfQW0hN CICfTPwLsaX2YepWlL4s4rnG+Gj5qkIcus9iwt31eRZ6y0pkQgmAko+LuZhusVT+G7wK EpZg== 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=WKJ1rX2csZAHSD2ONgRe4DzUUuQ8vzDD7TOAEgOpleY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=dcYNQYWgDQqBEBUWC6n1TangkPgsBQMa/HShqZ3cMaSw609fvM+Q6nrb3fSYJ5ZXkz SYE329ZvUT6grlH/7aw6lm/Jc9hc4nYaQEtX3nhU3QBduH01maLGhCVbugoZ0EIrhIfT /rFSaIDU3E+QZ2qggNxg6H+1ygbXEFvdI/y/SWmcygC3NCzG7sIi72DdIbaBUd94bd43 FBICpA7L1m1EVKqUvnoygzjZMjAQyRj0cMckG8kmn9aP8ev7JeWFxiZEH6VnhWdyiJF1 X9YLzOtV2lTimo7GVdv9EKCLdwjByTzzuUgqpW61Ngnbxi3UA8r0DFOS5MO7YpKfB1CB DEDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rAjmMgi0; 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 i20-20020ac85c14000000b00417f590633esi1913002qti.519.2023.10.20.13.48.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:48:29 -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=rAjmMgi0; 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 1qtwP1-00020J-2e; Fri, 20 Oct 2023 16:47:27 -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 1qtwOx-0001tb-Kd for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:23 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOt-0001BT-3A for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:23 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6b9af7d41d2so1255577b3a.0 for ; Fri, 20 Oct 2023 13:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834838; x=1698439638; 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=WKJ1rX2csZAHSD2ONgRe4DzUUuQ8vzDD7TOAEgOpleY=; b=rAjmMgi02nusBKIjx7rqWgTtoNItKFVn2p3evcbznI+JPDhUdix3ANpebFbkCWuobA VmZ4lIa+HyrQMgYiNI3obbVWdqcvNh/A9p59ixMqdHqNcgsjjB/SYbF1ryPo9G8uj3Yh Co33WW3kpN29SgUCkOHes6xnen6YJux1Nuc1mL2rnuQH3ek+u3AND0+zutG0Vu2UJNsZ CItToZEXuYvnFT6fdXfJ4Y9YHhjMTlSB/Trwcx7AtscodfJ5cmDT8YU5jOYl933nYMx0 T99zz56Scv+lO5bMu6UIgx8+QIujRstO/EgunZVicQcGfNLBTwo56orcjpIhI5ciCA+i Y+BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834838; x=1698439638; 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=WKJ1rX2csZAHSD2ONgRe4DzUUuQ8vzDD7TOAEgOpleY=; b=RxV75TNvXVEEaujG0AWG8sB9BPqUDizC9Pk7sfAHh3l50gtsCuK5L1qTX+s/KAzcOq sMEWFZ6BfagSUh9CudveuMGgOYlm3mIF6DCPH5q3eLIutRFstw4be3DoepfR09hPoEHi S+ls41pX4+LOirWtcjPoGyExdwrS0pzKCqwIgfKH9OsmErkoSumnW/2NJ0w3h9EeA6GC djyC2PPJJ4g/MUEXdjeKDam8Ew07W/MZ2Kl4LyIZhRMq6Xbalr1mXEMTUllGUzwOV9ES KEltu6mQRIfvt0qttbvSiEv/R6OgV44fT9gbA1xehH9XAPh8PmQlSq8qEpoZjI3eDrnN XVnQ== X-Gm-Message-State: AOJu0Ywe+bu9eDROVChUPxnV/9HvGVKkS90gmdrJOd/3cIDW4Odk+9Q6 gKn3jIbF2LtIajWXkZGoJatu07mo0UDLW35R16k= X-Received: by 2002:a05:6a20:c19f:b0:14c:84e6:1ab4 with SMTP id bg31-20020a056a20c19f00b0014c84e61ab4mr3224071pzb.33.1697834837693; Fri, 20 Oct 2023 13:47:17 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 50/65] target/hppa: Use tcg_temp_new_i64 not tcg_temp_new Date: Fri, 20 Oct 2023 13:43:16 -0700 Message-Id: <20231020204331.139847-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 Signed-off-by: Richard Henderson --- target/hppa/translate.c | 158 ++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 78 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 95de007c69..fdd5fbdf0e 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -32,6 +32,8 @@ #include "exec/helper-info.c.inc" #undef HELPER_H +/* Choose to use explicit sizes within this file. */ +#undef tcg_temp_new typedef struct DisasCond { TCGCond c; @@ -269,15 +271,15 @@ static DisasCond cond_make_0_tmp(TCGCond c, TCGv_i64 a0) static DisasCond cond_make_0(TCGCond c, TCGv_i64 a0) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_mov_i64(tmp, a0); return cond_make_0_tmp(c, tmp); } static DisasCond cond_make(TCGCond c, TCGv_i64 a0, TCGv_i64 a1) { - TCGv_i64 t0 = tcg_temp_new(); - TCGv_i64 t1 = tcg_temp_new(); + TCGv_i64 t0 = tcg_temp_new_i64(); + TCGv_i64 t1 = tcg_temp_new_i64(); tcg_gen_mov_i64(t0, a0); tcg_gen_mov_i64(t1, a1); @@ -302,7 +304,7 @@ static void cond_free(DisasCond *cond) static TCGv_i64 load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { - TCGv_i64 t = tcg_temp_new(); + TCGv_i64 t = tcg_temp_new_i64(); tcg_gen_movi_i64(t, 0); return t; } else { @@ -313,7 +315,7 @@ static TCGv_i64 load_gpr(DisasContext *ctx, unsigned reg) static TCGv_i64 dest_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0 || ctx->null_cond.c != TCG_COND_NEVER) { - return tcg_temp_new(); + return tcg_temp_new_i64(); } else { return cpu_gr[reg]; } @@ -437,7 +439,7 @@ static void nullify_over(DisasContext *ctx) /* If we're using PSW[N], copy it to a temp because... */ if (ctx->null_cond.a0 == cpu_psw_n) { - ctx->null_cond.a0 = tcg_temp_new(); + ctx->null_cond.a0 = tcg_temp_new_i64(); tcg_gen_mov_i64(ctx->null_cond.a0, cpu_psw_n); } /* ... we clear it before branching over the implementation, @@ -644,14 +646,14 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, break; case 1: /* = / <> (Z / !Z) */ if (cond_need_ext(ctx, d)) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ext32u_i64(tmp, res); res = tmp; } cond = cond_make_0(TCG_COND_EQ, res); break; case 2: /* < / >= (N ^ V / !(N ^ V) */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_xor_i64(tmp, res, sv); if (cond_need_ext(ctx, d)) { tcg_gen_ext32s_i64(tmp, tmp); @@ -668,7 +670,7 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, * !(~(res ^ sv) >> 31) | !res * !(~(res ^ sv) >> 31 & res) */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_eqv_i64(tmp, res, sv); if (cond_need_ext(ctx, d)) { tcg_gen_sextract_i64(tmp, tmp, 31, 1); @@ -685,7 +687,7 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, cond = cond_make_0(TCG_COND_EQ, cb_msb); break; case 5: /* ZNV / VNZ (!C | Z / C & !Z) */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_neg_i64(tmp, cb_msb); tcg_gen_and_i64(tmp, tmp, res); if (cond_need_ext(ctx, d)) { @@ -695,14 +697,14 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf, bool d, break; case 6: /* SV / NSV (V / !V) */ if (cond_need_ext(ctx, d)) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ext32s_i64(tmp, sv); sv = tmp; } cond = cond_make_0(TCG_COND_LT, sv); break; case 7: /* OD / EV */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_andi_i64(tmp, res, 1); cond = cond_make_0_tmp(TCG_COND_NE, tmp); break; @@ -756,8 +758,8 @@ static DisasCond do_sub_cond(DisasContext *ctx, unsigned cf, bool d, tc = tcg_invert_cond(tc); } if (cond_need_ext(ctx, d)) { - TCGv_i64 t1 = tcg_temp_new(); - TCGv_i64 t2 = tcg_temp_new(); + TCGv_i64 t1 = tcg_temp_new_i64(); + TCGv_i64 t2 = tcg_temp_new_i64(); if (ext_uns) { tcg_gen_ext32u_i64(t1, in1); @@ -833,7 +835,7 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigned cf, bool d, } if (cond_need_ext(ctx, d)) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); if (ext_uns) { tcg_gen_ext32u_i64(tmp, res); @@ -878,8 +880,8 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, * do our normal thing and compute carry-in of bit B+1 since that * leaves us with carry bits spread across two words. */ - cb = tcg_temp_new(); - tmp = tcg_temp_new(); + cb = tcg_temp_new_i64(); + tmp = tcg_temp_new_i64(); tcg_gen_or_i64(cb, in1, in2); tcg_gen_and_i64(tmp, in1, in2); tcg_gen_andc_i64(cb, cb, res); @@ -897,7 +899,7 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, /* See hasless(v,1) from * https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_subi_i64(tmp, res, d_repl * 0x01010101u); tcg_gen_andc_i64(tmp, tmp, res); tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80808080u); @@ -905,7 +907,7 @@ static DisasCond do_unit_cond(unsigned cf, bool d, TCGv_i64 res, break; case 3: /* SHZ / NHZ */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_subi_i64(tmp, res, d_repl * 0x00010001u); tcg_gen_andc_i64(tmp, tmp, res); tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80008000u); @@ -941,7 +943,7 @@ static TCGv_i64 get_carry(DisasContext *ctx, bool d, TCGv_i64 cb, TCGv_i64 cb_msb) { if (cond_need_ext(ctx, d)) { - TCGv_i64 t = tcg_temp_new(); + TCGv_i64 t = tcg_temp_new_i64(); tcg_gen_extract_i64(t, cb, 32, 1); return t; } @@ -957,8 +959,8 @@ static TCGv_i64 get_psw_carry(DisasContext *ctx, bool d) static TCGv_i64 do_add_sv(DisasContext *ctx, TCGv_i64 res, TCGv_i64 in1, TCGv_i64 in2) { - TCGv_i64 sv = tcg_temp_new(); - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 sv = tcg_temp_new_i64(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_xor_i64(sv, res, in1); tcg_gen_xor_i64(tmp, in1, in2); @@ -971,8 +973,8 @@ static TCGv_i64 do_add_sv(DisasContext *ctx, TCGv_i64 res, static TCGv_i64 do_sub_sv(DisasContext *ctx, TCGv_i64 res, TCGv_i64 in1, TCGv_i64 in2) { - TCGv_i64 sv = tcg_temp_new(); - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 sv = tcg_temp_new_i64(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_xor_i64(sv, res, in1); tcg_gen_xor_i64(tmp, in1, in2); @@ -989,21 +991,21 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, unsigned c = cf >> 1; DisasCond cond; - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); cb = NULL; cb_msb = NULL; cb_cond = NULL; if (shift) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_shli_i64(tmp, in1, shift); in1 = tmp; } if (!is_l || cond_need_cb(c)) { TCGv_i64 zero = tcg_constant_i64(0); - cb_msb = tcg_temp_new(); - cb = tcg_temp_new(); + cb_msb = tcg_temp_new_i64(); + cb = tcg_temp_new_i64(); tcg_gen_add2_i64(dest, cb_msb, in1, zero, in2, zero); if (is_c) { @@ -1035,7 +1037,7 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, /* Emit any conditional trap before any writeback. */ cond = do_cond(ctx, cf, d, dest, cb_cond, sv); if (is_tc) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1090,9 +1092,9 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, unsigned c = cf >> 1; DisasCond cond; - dest = tcg_temp_new(); - cb = tcg_temp_new(); - cb_msb = tcg_temp_new(); + dest = tcg_temp_new_i64(); + cb = tcg_temp_new_i64(); + cb_msb = tcg_temp_new_i64(); zero = tcg_constant_i64(0); if (is_b) { @@ -1131,7 +1133,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, /* Emit any conditional trap before any writeback. */ if (is_tc) { - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1180,7 +1182,7 @@ static void do_cmpclr(DisasContext *ctx, unsigned rt, TCGv_i64 in1, TCGv_i64 dest, sv; DisasCond cond; - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_sub_i64(dest, in1, in2); /* Compute signed overflow if required. */ @@ -1245,13 +1247,13 @@ static void do_unit(DisasContext *ctx, unsigned rt, TCGv_i64 in1, save_gpr(ctx, rt, dest); cond_free(&ctx->null_cond); } else { - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); fn(dest, in1, in2); cond = do_unit_cond(cf, d, dest, in1, in2); if (is_tc) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_setcond_i64(cond.c, tmp, cond.a0, cond.a1); gen_helper_tcond(tcg_env, tmp); } @@ -1286,7 +1288,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_i64 base) } ptr = tcg_temp_new_ptr(); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); spc = tcg_temp_new_i64(); /* Extract top 2 bits of the address, shift left 3 for uint64_t index. */ @@ -1311,11 +1313,11 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, /* Note that RX is mutually exclusive with DISP. */ if (rx) { - ofs = tcg_temp_new(); + ofs = tcg_temp_new_i64(); tcg_gen_shli_i64(ofs, cpu_gr[rx], scale); tcg_gen_add_i64(ofs, ofs, base); } else if (disp || modify) { - ofs = tcg_temp_new(); + ofs = tcg_temp_new_i64(); tcg_gen_addi_i64(ofs, base, disp); } else { ofs = base; @@ -1421,7 +1423,7 @@ static bool do_load(DisasContext *ctx, unsigned rt, unsigned rb, dest = dest_gpr(ctx, rt); } else { /* Make sure if RT == RB, we see the result of the load. */ - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); } do_load_64(ctx, dest, rb, rx, scale, disp, sp, modify, mop); save_gpr(ctx, rt, dest); @@ -1737,7 +1739,7 @@ static bool do_ibranch(DisasContext *ctx, TCGv_i64 dest, if (link != 0) { copy_iaoq_entry(cpu_gr[link], ctx->iaoq_n, ctx->iaoq_n_var); } - next = tcg_temp_new(); + next = tcg_temp_new_i64(); tcg_gen_mov_i64(next, dest); if (is_n) { if (use_nullify_skip(ctx)) { @@ -1778,8 +1780,8 @@ static bool do_ibranch(DisasContext *ctx, TCGv_i64 dest, a0 = ctx->null_cond.a0; a1 = ctx->null_cond.a1; - tmp = tcg_temp_new(); - next = tcg_temp_new(); + tmp = tcg_temp_new_i64(); + next = tcg_temp_new_i64(); copy_iaoq_entry(tmp, ctx->iaoq_n, ctx->iaoq_n_var); tcg_gen_movcond_i64(c, next, a0, a1, tmp, dest); @@ -1821,11 +1823,11 @@ static TCGv_i64 do_ibranch_priv(DisasContext *ctx, TCGv_i64 offset) return offset; case 3: /* Privilege 3 is minimum and is never allowed to increase. */ - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_ori_i64(dest, offset, 3); break; default: - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_andi_i64(dest, offset, -4); tcg_gen_ori_i64(dest, dest, ctx->privilege); tcg_gen_movcond_i64(TCG_COND_GTU, dest, dest, offset, dest, offset); @@ -1983,7 +1985,7 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl *a) break; } - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); save_gpr(ctx, rt, tmp); @@ -2024,7 +2026,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) if (ctl == CR_SAR) { reg = load_gpr(ctx, a->r); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_andi_i64(tmp, reg, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); @@ -2055,7 +2057,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) case CR_IIAOQ: /* FIXME: Respect PSW_Q bit */ /* The write advances the queue and stores to the back element. */ - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr_back[ctl - CR_IIASQ])); tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUHPPAState, cr[ctl])); @@ -2083,7 +2085,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_not_i64(tmp, load_gpr(ctx, a->r)); tcg_gen_andi_i64(tmp, tmp, ctx->is_pa20 ? 63 : 31); @@ -2118,7 +2120,7 @@ static bool trans_rsm(DisasContext *ctx, arg_rsm *a) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, psw)); tcg_gen_andi_i64(tmp, tmp, ~a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); @@ -2138,7 +2140,7 @@ static bool trans_ssm(DisasContext *ctx, arg_ssm *a) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, tcg_env, offsetof(CPUHPPAState, psw)); tcg_gen_ori_i64(tmp, tmp, a->i); gen_helper_swap_system_mask(tmp, tcg_env, tmp); @@ -2158,7 +2160,7 @@ static bool trans_mtsm(DisasContext *ctx, arg_mtsm *a) nullify_over(ctx); reg = load_gpr(ctx, a->r); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); gen_helper_swap_system_mask(tmp, tcg_env, reg); /* Exit the TB to recognize new interrupts. */ @@ -2406,7 +2408,7 @@ static bool trans_lpa(DisasContext *ctx, arg_ldst *a) form_gva(ctx, &vaddr, &ofs, a->b, a->x, 0, 0, a->sp, a->m, false); - paddr = tcg_temp_new(); + paddr = tcg_temp_new_i64(); gen_helper_lpa(paddr, tcg_env, vaddr); /* Note that physical address result overrides base modification. */ @@ -2590,7 +2592,7 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d *a, bool is_tc) } tcg_r1 = load_gpr(ctx, a->r1); tcg_r2 = load_gpr(ctx, a->r2); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_not_i64(tmp, tcg_r2); do_unit(ctx, a->t, tcg_r1, tmp, a->cf, a->d, is_tc, tcg_gen_add_i64); return nullify_end(ctx); @@ -2612,7 +2614,7 @@ static bool do_dcor(DisasContext *ctx, arg_rr_cf_d *a, bool is_i) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_shri_i64(tmp, cpu_psw_cb, 3); if (!is_i) { tcg_gen_not_i64(tmp, tmp); @@ -2644,10 +2646,10 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) in1 = load_gpr(ctx, a->r1); in2 = load_gpr(ctx, a->r2); - add1 = tcg_temp_new(); - add2 = tcg_temp_new(); - addc = tcg_temp_new(); - dest = tcg_temp_new(); + add1 = tcg_temp_new_i64(); + add2 = tcg_temp_new_i64(); + addc = tcg_temp_new_i64(); + dest = tcg_temp_new_i64(); zero = tcg_constant_i64(0); /* Form R1 << 1 | PSW[CB]{8}. */ @@ -2770,7 +2772,7 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) if (a->m) { /* Base register modification. Make sure if RT == RB, we see the result of the load. */ - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); } else { dest = dest_gpr(ctx, a->t); } @@ -2927,7 +2929,7 @@ static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_i64 in1, DisasCond cond; in2 = load_gpr(ctx, r); - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_sub_i64(dest, in1, in2); @@ -2979,13 +2981,13 @@ static bool do_addb(DisasContext *ctx, unsigned r, TCGv_i64 in1, } in2 = load_gpr(ctx, r); - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); sv = NULL; cb_cond = NULL; if (cond_need_cb(c)) { - TCGv_i64 cb = tcg_temp_new(); - TCGv_i64 cb_msb = tcg_temp_new(); + TCGv_i64 cb = tcg_temp_new_i64(); + TCGv_i64 cb_msb = tcg_temp_new_i64(); tcg_gen_movi_i64(cb_msb, 0); tcg_gen_add2_i64(dest, cb_msb, in1, cb_msb, in2, cb_msb); @@ -3023,7 +3025,7 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_r = load_gpr(ctx, a->r); if (cond_need_ext(ctx, a->d)) { /* Force shift into [32,63] */ @@ -3045,7 +3047,7 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) nullify_over(ctx); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_r = load_gpr(ctx, a->r); p = a->p | (cond_need_ext(ctx, a->d) ? 32 : 0); tcg_gen_shli_i64(tmp, tcg_r, p); @@ -3105,7 +3107,7 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) tcg_gen_shr_i64(dest, dest, cpu_sar); } else { tcg_gen_ext32u_i64(dest, load_gpr(ctx, a->r2)); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_andi_i64(tmp, cpu_sar, 31); tcg_gen_shr_i64(dest, dest, tmp); } @@ -3123,8 +3125,8 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) tcg_gen_extu_i32_i64(dest, t32); } } else if (a->d) { - TCGv_i64 t = tcg_temp_new(); - TCGv_i64 n = tcg_temp_new(); + TCGv_i64 t = tcg_temp_new_i64(); + TCGv_i64 n = tcg_temp_new_i64(); tcg_gen_xori_i64(n, cpu_sar, 63); tcg_gen_shl_i64(t, load_gpr(ctx, a->r2), n); @@ -3206,7 +3208,7 @@ static bool trans_extr_sar(DisasContext *ctx, arg_extr_sar *a) dest = dest_gpr(ctx, a->t); src = load_gpr(ctx, a->r); - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); /* Recall that SAR is using big-endian bit numbering. */ tcg_gen_andi_i64(tmp, cpu_sar, widthm1); @@ -3350,14 +3352,14 @@ static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, uint64_t msb = 1ULL << (len - 1); dest = dest_gpr(ctx, rt); - shift = tcg_temp_new(); - tmp = tcg_temp_new(); + shift = tcg_temp_new_i64(); + tmp = tcg_temp_new_i64(); /* Convert big-endian bit numbering in SAR to left-shift. */ tcg_gen_andi_i64(shift, cpu_sar, widthm1); tcg_gen_xori_i64(shift, shift, widthm1); - mask = tcg_temp_new(); + mask = tcg_temp_new_i64(); tcg_gen_movi_i64(mask, msb + (msb - 1)); tcg_gen_and_i64(tmp, val, mask); if (rs) { @@ -3422,7 +3424,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a) nullify_over(ctx); #endif - tmp = tcg_temp_new(); + tmp = tcg_temp_new_i64(); tcg_gen_addi_i64(tmp, load_gpr(ctx, a->b), a->disp); tmp = do_ibranch_priv(ctx, tmp); @@ -3519,7 +3521,7 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) static bool trans_blr(DisasContext *ctx, arg_blr *a) { if (a->x) { - TCGv_i64 tmp = tcg_temp_new(); + TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_shli_i64(tmp, load_gpr(ctx, a->x), 3); tcg_gen_addi_i64(tmp, tmp, ctx->iaoq_f + 8); /* The computation here never changes privilege level. */ @@ -3537,7 +3539,7 @@ static bool trans_bv(DisasContext *ctx, arg_bv *a) if (a->x == 0) { dest = load_gpr(ctx, a->b); } else { - dest = tcg_temp_new(); + dest = tcg_temp_new_i64(); tcg_gen_shli_i64(dest, load_gpr(ctx, a->x), 3); tcg_gen_add_i64(dest, dest, load_gpr(ctx, a->b)); } @@ -3874,7 +3876,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) nullify_over(ctx); - t = tcg_temp_new(); + t = tcg_temp_new_i64(); tcg_gen_ld32u_i64(t, tcg_env, offsetof(CPUHPPAState, fr0_shadow)); if (a->y == 1) { @@ -4175,7 +4177,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) This will be overwritten by a branch. */ if (ctx->iaoq_b == -1) { ctx->iaoq_n = -1; - ctx->iaoq_n_var = tcg_temp_new(); + ctx->iaoq_n_var = tcg_temp_new_i64(); tcg_gen_addi_i64(ctx->iaoq_n_var, cpu_iaoq_b, 4); } else { ctx->iaoq_n = ctx->iaoq_b + 4; From patchwork Fri Oct 20 20:43:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736340 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503585wrl; Fri, 20 Oct 2023 13:54:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKOVU3OBHqKv2P4PvPTC93l8AQdNaua6BkFfltcfx0h9L1yeOf4KwQp1baXtwLh0CWyd8a X-Received: by 2002:ad4:5b85:0:b0:64f:49d1:3fe7 with SMTP id 5-20020ad45b85000000b0064f49d13fe7mr3685134qvp.23.1697835245097; Fri, 20 Oct 2023 13:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835245; cv=none; d=google.com; s=arc-20160816; b=MHLBTX/DCDLmt4bnWVIhtC9b6WO7Nu8oGHfPVNZukdc5+BBYdiGo8c8hgdHSp8XIfE ezixMfPBlMlU9aztYPEz/NHP2gAaae6EMjqVXEJAO8ALURI0YyjVKIbZ1gDkNiUgE3Wm 4s3VkCFLKgshpgGyLJdd/gTZfoMGF5VQXjKBv6JHJWNHjzY8feMtCLZnOTXJuKizhEm6 fmJ0RKb5oxZsSHQ3HsW3W0ZECMZhVkxFkdev5+bmHv4ECh1ekUN6ut/qEbJ/WnFzrDAr CLpDJgpIVyQOA/2Ad6FZb4YywMzsUJA1KdF5FNJKzVeGUmK1X5NGFYQplHEIGUi/olo/ AtxA== 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=SFd9Qh9JL6hOySCuo3z5YneGJwqmFS+MfoCbYZFAQuw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Lj2/yAbrCFNutOX8MheG00jIrNT4ZIH1EKtPlyEHd6tVeAzphKIyoRbU5LT4QxUfC/ iI2J2N1jbGF8LpQZpqNmAMYuQo/wvScmaY36eB6wBTjHpaH7P1UwK5ZZtSox1QtfocyQ QnO9qwJkPGgOD+OhGf9EDTBrcabA6dZuCyww5hHMzMh9N7BP1HLnXGR40BFaZtGBauLI 0NkMob42gQlf+2+M2vE28aAKZ/v447GRKqLecX7X3HhxnHYxvzjmcsguQ+QAaqrmeJc2 086JIKxsF27TlGXF6JJNSxw4CbvWXGlRzbPOuBaSVULDhjnffLLwV6UVmiJyzg6T96er YFow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gBm06ICH; 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 k6-20020a0cfa46000000b0066cf5fda809si2010330qvo.316.2023.10.20.13.54.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:05 -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=gBm06ICH; 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 1qtwOx-0001tK-Hd; Fri, 20 Oct 2023 16:47:23 -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 1qtwOw-0001pC-52 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:22 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOt-0001Be-Td for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:21 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b5cac99cfdso1157015b3a.2 for ; Fri, 20 Oct 2023 13:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834838; x=1698439638; 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=SFd9Qh9JL6hOySCuo3z5YneGJwqmFS+MfoCbYZFAQuw=; b=gBm06ICHR8rAcziMlETWL1/VU8FGsZ1WR+L2WLIfXNZD7ABupqbh428kXC5C2sym/g j7HjY7QS3iPvPB5sA7aqTGvroMB0kRB8VTIFEz9agnfako6ReKWODml5OXW4r0UbxMcN nm4TKvie7aC0gWNkpMY2/E3eYwLde/GAKdbmR4ujEa7IAflfQCECUUcOQ+0uRpvfjQ8F TqfgCVluy5xX/Nytklt3NVkroEzZLoGOSiIAxUdDkRdytYVVudC5fIPE+y4nqlHKD6O7 YiYxp0ChPuKmNh54yOCgYnZahvkyYptiD00BBZoN2KKxlMIx7O0ETUO2q6paLjWRifCP Nd8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834838; x=1698439638; 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=SFd9Qh9JL6hOySCuo3z5YneGJwqmFS+MfoCbYZFAQuw=; b=WCvCdV3rg5y8uw+qNL/BLFSmwFcIqQiDjz4aZTZ49gk1tUgBzPXZtOsevEhS8wzt83 sgpWv+1iJVJB5zpA3qGqABO/8Xnik1sdCCBZLmtRuozaQGoSHbEe0wGIptxpEzQQgoeZ 8fkXwJ3Fokj9/JKMgcU5XmqDEEtRpAXc11QvgLh7zpzMCvdAKoLh20xTtfMl3j+CO40J kCttPb4adH+gpes7Y/SKFKdpdClfeMTYdxFWTh0KBPwAnhHZ/GmjQC/DUbX6pAQeNXja X3HZdEAsXS+nStGsfjL1LzFoR1TUCZ2lrCY17R071H+8KwKTQRXHjf7kFUsWJ739RCR4 vDrw== X-Gm-Message-State: AOJu0YzvRYPXpeoC14Zo5hf1cGz/Az7WhcckRWxMt9qpUe81+NLHry7q wpPkMPCFfD3TjnGSEus9236l69fUmdQ4+6CmyZM= X-Received: by 2002:a05:6a00:134b:b0:690:422f:4f17 with SMTP id k11-20020a056a00134b00b00690422f4f17mr3186059pfu.4.1697834838633; Fri, 20 Oct 2023 13:47:18 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 51/65] target/hppa: Replace tcg_gen_*_tl with tcg_gen_*_i64 Date: Fri, 20 Oct 2023 13:43:17 -0700 Message-Id: <20231020204331.139847-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Signed-off-by: Richard Henderson --- target/hppa/translate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index fdd5fbdf0e..16d42ae328 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1325,10 +1325,10 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, *pofs = ofs; *pgva = addr = tcg_temp_new_i64(); - tcg_gen_andi_tl(addr, modify <= 0 ? ofs : base, gva_offset_mask(ctx)); + tcg_gen_andi_i64(addr, modify <= 0 ? ofs : base, gva_offset_mask(ctx)); #ifndef CONFIG_USER_ONLY if (!is_phys) { - tcg_gen_or_tl(addr, addr, space_select(ctx, sp, base)); + tcg_gen_or_i64(addr, addr, space_select(ctx, sp, base)); } #endif } @@ -2361,7 +2361,7 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) a->data ? offsetof(CPUHPPAState, cr[CR_IOR]) : offsetof(CPUHPPAState, cr[CR_IIAOQ])); tcg_gen_shli_i64(stl, stl, 32); - tcg_gen_or_tl(addr, atl, stl); + tcg_gen_or_i64(addr, atl, stl); reg = load_gpr(ctx, a->r); if (a->addr) { @@ -2911,7 +2911,7 @@ static bool trans_ldo(DisasContext *ctx, arg_ldo *a) TCGv_i64 tcg_rt = dest_gpr(ctx, a->t); /* Special case rb == 0, for the LDI pseudo-op. - The COPY pseudo-op is handled for free within tcg_gen_addi_tl. */ + The COPY pseudo-op is handled for free within tcg_gen_addi_i64. */ if (a->b == 0) { tcg_gen_movi_i64(tcg_rt, a->i); } else { From patchwork Fri Oct 20 20:43:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736312 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502246wrl; Fri, 20 Oct 2023 13:49:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbOujJM2luZnj9OODAEcTT+afTgdPr1m2D+w/yqh20EmwY/QBKFdkIADcCvs6Aisz61Z6f X-Received: by 2002:a05:6808:498:b0:3b2:e77b:640d with SMTP id z24-20020a056808049800b003b2e77b640dmr3081733oid.31.1697834941647; Fri, 20 Oct 2023 13:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834941; cv=none; d=google.com; s=arc-20160816; b=l5iNQ+cQUlpfIn9OA63FtthybdGm2QhenLQTUSge8y/UjNshO+MwD0+gPUFzQ6Bb9o 7sHLDZ35xmcPhwmCQ/N1Z3HvDzpqf1eIB9j9AOaRN0UOgzUk3CgGjAEjQgkhbZBLGyit muJbP3J50tMkGvyTexHMjeLVrEsD+VKpX30uKzrZM5d6PAnTasS7FCHeQ3HSc4wOPTQ4 tAEdJOuanMlNW8a4SXQcXPPUZsteRTSOmMmL0N76oVYEdCdTCorO5rzS29jnxR7sv1na lyh50kJ7YamDZD4+m/yywTFYaOGtLnB0C9bdUnNOCfS404c6kPFJs+YbiT4XA1wd+U/i 5GWg== 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=eyKRvcSVwIZRGZOCNbFmD7+eSOO/DoyIuLiNzQZCvfw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=AdA6Tg/O1NHx4PUsHI2TT1LyJayj1+JzpSZVpsJ7Edma+YGIJOfkCv/X0NJ5qlOFeM M1UuWVerVndBi72rc5qZ25IF3lPDX9xqeZlzpdyH2ZDvNzJhzXs9s8YRkHcC4zzYyR4g tCLP534QQZhhQgAqyBXkBicqByhbxUR/HKKmOAn9umeNlbzz02FOO+7jTA1T9KBNypjM iKwCbZ9yeE672/Y3H2EspblfkNNBgvPYufv6afFpLYjEReVlz430yM9cOGFtduXuYMav PKYeGb2k8NVcGCKy/Do4g8dwCcerLjqLVf8J2BdigEa2S3x3OydA8+6XcHrCNRutiPuy 2gEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r9OCiO4I; 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 m17-20020a05622a055100b004180387dcc0si1933013qtx.605.2023.10.20.13.49.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:49:01 -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=r9OCiO4I; 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 1qtwOz-0001ye-Ll; Fri, 20 Oct 2023 16:47:25 -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 1qtwOx-0001te-Lb for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:23 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOu-0001C0-RV for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:23 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b2018a11efso1192473b3a.0 for ; Fri, 20 Oct 2023 13:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834839; x=1698439639; 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=eyKRvcSVwIZRGZOCNbFmD7+eSOO/DoyIuLiNzQZCvfw=; b=r9OCiO4InIq3f0THhRa5t9F4+gtRe/ll3spEh7JzyuwrIjZJzVXmaLCzYtkhnvdqmU Z9ghVEZhPkuOqElCs2VV2w+Zrvs/CZ5LI9tpr+dLrU5nIfO6gpem8ZXsP9wKpEiwqYin dhdf7Ls0nuxmGqWQc4ptNFTprMnNZqq8d2BPsehOhRLjdrkxDnUZtltqfnxgO8xffXoB IOQZvG6yY7nkitJCR2MV0sfiZ2VUvhhpnWmp9/PGoobGlGU4lRe6gwdT535hbJY7dUeu 2fetmKkJN18y5GRRtDOMaaegnqHut5JcUVOy/lU4LQS+8oHJGInVYk0z1ThxCsplJHjq SZ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834839; x=1698439639; 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=eyKRvcSVwIZRGZOCNbFmD7+eSOO/DoyIuLiNzQZCvfw=; b=BnxYKcCPd5j3XLVQWUCSrtuIZuI/apc1Sn61VyuZOAIv3Qu1JJD8q+YdLnP8DPt8BS hRt0jg1votU/wVGKs3O8PmhuA5u/zI/r1TaURErg3rHkrNFvVIFF3qnOYqmvBAmnL/nx PVjZl72Bdd7yndZmjM0QBzl56k4jnz58ppwyIHeLYCmIPQmlglW4kPsEIhI0GBPNE6q9 1rFiTqu2xyvd8dqTHaK8PboddjX8IwnRPSXDMpUTU2ZVR+aXCz5L6HXWnyI3FUasMFW/ QN1pSu2bRavDj2dGvbFreh6frOk0Q21tjCGEly/xfYoJGvJjvzk2LiZArQLPtWwOvaLP by9g== X-Gm-Message-State: AOJu0YxBIwKWFVLmIc+L+n2KTwX+6adwZ6Bn9ooLzGE0x7yuvjFUmSDa gyvvMLILbSSGpTW6t5BoWzRyPSVT2KH0Pz5ZuFo= X-Received: by 2002:a05:6a20:6a04:b0:13a:59b1:c884 with SMTP id p4-20020a056a206a0400b0013a59b1c884mr2887164pzk.40.1697834839466; Fri, 20 Oct 2023 13:47:19 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 52/65] target/hppa: Implement HADD Date: Fri, 20 Oct 2023 13:43:18 -0700 Message-Id: <20231020204331.139847-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 Signed-off-by: Richard Henderson --- target/hppa/helper.h | 3 +++ target/hppa/insns.decode | 8 +++++++- target/hppa/op_helper.c | 32 ++++++++++++++++++++++++++++++++ target/hppa/translate.c | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 4b2c66316f..ff2695797e 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -14,6 +14,9 @@ DEF_HELPER_FLAGS_3(stdby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tl) DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) +DEF_HELPER_FLAGS_2(hadd_ss, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_2(hadd_us, TCG_CALL_NO_RWG, i64, i64, i64) + DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tl, env, tl, i32, i32) DEF_HELPER_FLAGS_1(loaded_fr0, TCG_CALL_NO_RWG, void, env) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index db1b9f750f..88248ed3e2 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -65,6 +65,7 @@ &ldst t b x disp sp m scale size &rr_cf_d t r cf d +&rrr t r1 r2 &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d &rrr_cf_d_sh t r1 r2 cf d sh @@ -81,6 +82,7 @@ #### @rr_cf_d ...... r:5 ..... cf:4 ...... d:1 t:5 &rr_cf_d +@rrr ...... r2:5 r1:5 .... ....... t:5 &rrr @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf @rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d @rrr_cf_d_sh ...... r2:5 r1:5 cf:4 .... sh:2 d:1 t:5 &rrr_cf_d_sh @@ -208,6 +210,10 @@ subi_tsv 100101 ..... ..... .... 1 ........... @rri_cf cmpiclr 100100 ..... ..... .... . ........... @rri_cf_d +hadd 000010 ..... ..... 00000011 11 0 ..... @rrr +hadd_ss 000010 ..... ..... 00000011 01 0 ..... @rrr +hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr + #### # Index Mem #### @@ -429,7 +435,7 @@ fmpyfadd_d 101110 rm1:5 rm2:5 ... 0 1 ..0 0 0 neg:1 t:5 ra3=%rc32 @f0e_f_3 ...... ..... ..... ... .0 110 ..0 ..... \ &fclass3 r1=%ra64 r2=%rb64 t=%rt64 -@f0e_d_3 ...... r1:5 r2:5 ... 01 110 000 t:5 +@f0e_d_3 ...... r1:5 r2:5 ... 01 110 000 t:5 &fclass3 # Floating point class 0 diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 0bccca1e11..a230a3a0c3 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -377,3 +377,35 @@ target_ulong HELPER(read_interval_timer)(void) return qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) >> 2; #endif } + +uint64_t HELPER(hadd_ss)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = sextract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = f1 + f2; + + fr = MIN(fr, INT16_MAX); + fr = MAX(fr, INT16_MIN); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} + +uint64_t HELPER(hadd_us)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = extract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = f1 + f2; + + fr = MIN(fr, UINT16_MAX); + fr = MAX(fr, 0); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 16d42ae328..0d72c96fd5 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -23,6 +23,7 @@ #include "qemu/host-utils.h" #include "exec/exec-all.h" #include "tcg/tcg-op.h" +#include "tcg/tcg-op-gvec.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/translator.h" @@ -2739,6 +2740,42 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf_d *a) return nullify_end(ctx); } +static bool do_multimedia(DisasContext *ctx, arg_rrr *a, + void (*fn)(TCGv_i64, TCGv_i64, TCGv_i64)) +{ + TCGv_i64 r1, r2, dest; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r1 = load_gpr(ctx, a->r1); + r2 = load_gpr(ctx, a->r2); + dest = dest_gpr(ctx, a->t); + + fn(dest, r1, r2); + save_gpr(ctx, a->t, dest); + + return nullify_end(ctx); +} + +static bool trans_hadd(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, tcg_gen_vec_add16_i64); +} + +static bool trans_hadd_ss(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_hadd_ss); +} + +static bool trans_hadd_us(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_hadd_us); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) { From patchwork Fri Oct 20 20:43:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736315 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502414wrl; Fri, 20 Oct 2023 13:49:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfBVA3EKJxsHt+R13Gw4FoxBjfz85R6pvrbZnLdHgYRC16OBoL3odRBbCqHcmD0DhT+bVQ X-Received: by 2002:a05:6214:1c43:b0:66d:182a:c083 with SMTP id if3-20020a0562141c4300b0066d182ac083mr3455946qvb.9.1697834981627; Fri, 20 Oct 2023 13:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697834981; cv=none; d=google.com; s=arc-20160816; b=h2/HPulf1GLBCTUfYNaMtaqeUCSWjIQT229JXsRAIKlXNv8eFrczMKT5E1hQehfMaj 30z+GjiQ1y2tMo3VfRHv8VTBk54h917bbP+8mpL3CPnkLuPykXwJ4uKcZ1wrE2Jpf/Yi JO+yh2mPjiSUHRptwYBanrzRuVapG2c0F3/aWY2VadjJlOhSQb4dMtSF2JXpvm2uz+p7 JQ/8TzVMe6lZmAsmqpqkUVPwB9gCJmtsOvNTc/HlHaJuEp3d+1XA7jCoJf9EpxOseI3u lxITiv2JM+bLsKFho2fJkKY420LTntVA/epwxz8DKd3SJs3Q0rwWXNbOQnrxZF97fX/u wKNw== 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=m2B6dMamMnRVER/FMmJuOoUUmNaPsvlpsYZS/xeL1qA=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=mLl+9aC21dHSZ5ZSn13+ppF8QNz/IHMNPu9oFXK92v/G/AE4OvouKJEkUy/KavG500 vmeFSbPoAOpIpRHtnGtUd60aMWWPDg5kRUStXMnkhJJuH1JG3MvHD1TQQZkSrCtrWyQR 2hoL38wOTMh7ppEsfS9vglLXjTZxrhTpyQJDFsMT2GZ8/P5qwtBAiIL3Sb4ksMliahhS d50odRHA1IMp2oHDiQr9DSNwDC5UkNHPiOo6PQK6YwHCl2BPerokqNZxfxLHSatLDw2I vr52uObE4FElQabURxzTZWXTAfEmJtMWgljABRhXXO/4xTYKLD38BkaBbYE51hVAA/+M cTgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ieUUD//7"; 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 w21-20020a05622a135500b0041cb481b92esi1855134qtk.388.2023.10.20.13.49.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:49:41 -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="ieUUD//7"; 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 1qtwOz-0001yX-Kr; Fri, 20 Oct 2023 16:47:25 -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 1qtwOx-0001tm-O5 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:23 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOv-0001C7-TU for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:23 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so1109407b3a.1 for ; Fri, 20 Oct 2023 13:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834840; x=1698439640; 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=m2B6dMamMnRVER/FMmJuOoUUmNaPsvlpsYZS/xeL1qA=; b=ieUUD//7IfQJ2odz+gSHb2wXU3BH1Q0JrOl9J7HWl6BkHbQ1NLrX+/y0+8YcycUaV7 /5cuXvutvTZ8gkTU4icXbjAqs2HS1TIZuxoPPVvc63gDKagnsGXNAdBLzObWWtcvdMWd 3oX3yq7c5P15WLiVL4Kl/lj/hg3+MserEAoAzIdb8aDLEomJ9Sx3jKkza++2/7K2UNwe 0jKveXWOe6nAdYPH472yNlIWBXFluwQQRN97kNXqzSK0Em9Sm1a0CLqU4jZ5AivFcrr9 Wy9hrrYUIzOTK+CvSP5H5lMNoqk+A3AAJjQD+qlaV3c9Cm3F+T2/4ktj731Y9qEFnA6+ PrOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834840; x=1698439640; 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=m2B6dMamMnRVER/FMmJuOoUUmNaPsvlpsYZS/xeL1qA=; b=QmgJ4118kkHldChEpGYzHzz6w+UXI7j9TqGjZzVVFmbdxiURsI0ZDMXVFxeONdknEY BriLMHEIFQ4REW0BNt2tQsZEz/uEWHzMfXhQjn5LZKYdKVAVI56IPa30nm2SEDCQ0ziO 4eA0/NegkPD0JQNTPweul4fIugxXCrRpKqtcWq5SGFT9aQ5SUzNU+KuXYh+lJCPPYQwy OoLlyTt4vh5tk8F3lVMDRPEImtKYVAvgsK8qsKmoYbGmjxoB6OgMO/qwE43GHDXgKDLQ xyg2JB6A/vP4S85OzUbMIGxFaVI5fhR4TwIAT055/xdMzgP2jBckclEvrz5ntOl7loLB UrpQ== X-Gm-Message-State: AOJu0Yz2GRDiseQtiFWbVJoB3sk6lF4dPdqhGSYoJtDvXelTYjL4hmAq 5WEGG5IW6i5PeS91eFNdUcJGjL/92mFntWQRcro= X-Received: by 2002:a05:6a21:66c7:b0:163:2dc7:d077 with SMTP id ze7-20020a056a2166c700b001632dc7d077mr1415795pzb.55.1697834840189; Fri, 20 Oct 2023 13:47:20 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 53/65] target/hppa: Implement HSUB Date: Fri, 20 Oct 2023 13:43:19 -0700 Message-Id: <20231020204331.139847-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 Signed-off-by: Richard Henderson --- target/hppa/helper.h | 2 ++ target/hppa/insns.decode | 4 ++++ target/hppa/op_helper.c | 32 ++++++++++++++++++++++++++++++++ target/hppa/translate.c | 15 +++++++++++++++ 4 files changed, 53 insertions(+) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index ff2695797e..99486f4cf8 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -16,6 +16,8 @@ DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) DEF_HELPER_FLAGS_2(hadd_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hadd_us, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_2(hsub_ss, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_2(hsub_us, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tl, env, tl, i32, i32) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 88248ed3e2..1830b06c76 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -214,6 +214,10 @@ hadd 000010 ..... ..... 00000011 11 0 ..... @rrr hadd_ss 000010 ..... ..... 00000011 01 0 ..... @rrr hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr +hsub 000010 ..... ..... 00000001 11 0 ..... @rrr +hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr +hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr + #### # Index Mem #### diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index a230a3a0c3..ece523bea0 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -409,3 +409,35 @@ uint64_t HELPER(hadd_us)(uint64_t r1, uint64_t r2) } return ret; } + +uint64_t HELPER(hsub_ss)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = sextract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = f1 - f2; + + fr = MIN(fr, INT16_MAX); + fr = MAX(fr, INT16_MIN); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} + +uint64_t HELPER(hsub_us)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = extract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = f1 - f2; + + fr = MIN(fr, UINT16_MAX); + fr = MAX(fr, 0); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 0d72c96fd5..63c6a28cef 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2776,6 +2776,21 @@ static bool trans_hadd_us(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_hadd_us); } +static bool trans_hsub(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64); +} + +static bool trans_hsub_ss(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_hsub_ss); +} + +static bool trans_hsub_us(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_hsub_us); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) { From patchwork Fri Oct 20 20:43:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736324 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502741wrl; Fri, 20 Oct 2023 13:50:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFB5lB9IGFNbu6YabuyVeuRNb9unSoStx5M+p+ZL8ofPaLaXdG4iRDRXC376YBnPBXHlv6w X-Received: by 2002:a05:620a:2a16:b0:778:ab96:e75c with SMTP id o22-20020a05620a2a1600b00778ab96e75cmr3283359qkp.20.1697835055727; Fri, 20 Oct 2023 13:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835055; cv=none; d=google.com; s=arc-20160816; b=zFCfVrthSRgD+oG7iLaGG1OH+KeenoNuIrxIZrTGnG+ICOqZc+aTmdr57DqD8D9wls Rs0sktn3XWsjkEh6VUITJfH3Ihcq8WugusPNwnDriNx6HSkI3c+zVOu8t6JXsoBriASh UI6LAdMRPxknunqdKOFyHCtca6mPJ6liJ34frjBuyQH4Y/oqSsCQ4fyItFxnYD6aZ3LM IZnJqp5tH+S6WJH5xvOI8PzgEUjVECim9+w52VE0YUS9YrLAt0UoJXl7ahTufXpuQmKt DU5ooY7Xk5kj0MjAJrWHK/lG5PECvSYCzAOV8Vbq5DyWTBLwddPigixR5u/eeM+jpOV4 KWhw== 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=Sna123inmZqckkeeCG7fnD84UjYEicGgdYJ35WhU9q8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=hIhDpiMnCnshzC+FcuXqZmTzaLrnJgd0ELQXP93XeQuXHn4rx6qQbrB0Y8YTc9YrwL lO4Nwlhvgie5Xh1kfEiUAt9ubjgyhCtMAgjpRfwjzutK4EOVN/n7WUr9wnsSonybybwK x/MbVGAIlrV61/QlLDOmJ3H+JgnCP4sXnNSMp1Jan9fnBKNEmeJbJF3oCiG6T/dtfYTZ EI4R3epFdGTZUaYc8JSakEdNETW9N2KFHQ3uPWUcUkAS1TkB0Ta2QSwYnLi1lmFzCTT1 1fHEYQsYndvZOONRIp7R0Eoqey9XfcNnGBOqFdR3x9RLsaXJJwIBSLt7SuJ0p2DFRzF3 ciaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ENQOdX3H; 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 s19-20020a05620a16b300b007758f5499b0si1857894qkj.426.2023.10.20.13.50.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50:55 -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=ENQOdX3H; 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 1qtwP1-00020N-CR; Fri, 20 Oct 2023 16:47:27 -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 1qtwOy-0001v8-2S for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:24 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOw-0001CJ-CU for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:23 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-68fb85afef4so1246595b3a.1 for ; Fri, 20 Oct 2023 13:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834841; x=1698439641; 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=Sna123inmZqckkeeCG7fnD84UjYEicGgdYJ35WhU9q8=; b=ENQOdX3HUt2FlYbRfe0OEx9SCkHd67r5OVAHCwF0Ze5aboGIdd4FZwwwZ2CsmM50U1 hOewFv32dAUEK9piyShD0puv8aSbE8NYTdWB/rKdsXzpctSwEMtW+GHbvIk2pU4nyJnp MVUszJbqHRKTd6OvvxLLGQdzfSZnvZFaaLBrqVx8JuNjfrE6cP97YQaOigd+2BVNo43u Zr7lNHJpBgE3R+grwlXYZB53qo2gX2Wq1qOLwFrpH+6L4aTe37LkjWGcgOrCWxUTEcfr dv0yOrkoq+KSlszqjOPfMQeo645tp4uKqZ4et2Ki53RmbasVHCfSpYd2Y8FHXtvdZ0nA Y0dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834841; x=1698439641; 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=Sna123inmZqckkeeCG7fnD84UjYEicGgdYJ35WhU9q8=; b=afV+sptHw20k4+515YuRBZRBTXreClZe9/SLgbuTLQzh8gUwxizTUNRbvJrrlILEI7 whTqAGE9oXw+SW+bKWao3oPdU2rHnLbrN8jSFnLmcIBK92gQAdG7+Ae+ahaKpO0Kmrdk EblNhQGgKmwp3p+lh2cdd+Hac11GWmUx0RIvhKyX0ILsQOplnWwilpyXr8KFOu1jnA+0 LJTf7CnsO6aZpkyYOsRAhPVBbwKQSdOirlilt8vlTZa0kPiNc5TsRd7F2Z+QXYe7NChm z6hGEBfoecRhiMVCCsZ+7HgidhlWR6efeaf4pyhopOku7u6RdnzZwGal9pYUBDk2YSiF zWrg== X-Gm-Message-State: AOJu0YykDnXGRGZgQSrhEPLzneGFOo7dGTSiR8y8LqX06m1KbEVGxDpw GuWRQoGKdcXKoWeroV184M6CHw1kVjSjAIINvBs= X-Received: by 2002:a05:6a00:15c2:b0:6bc:c242:7915 with SMTP id o2-20020a056a0015c200b006bcc2427915mr3003178pfu.28.1697834840881; Fri, 20 Oct 2023 13:47:20 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 54/65] target/hppa: Implement HAVG Date: Fri, 20 Oct 2023 13:43:20 -0700 Message-Id: <20231020204331.139847-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 Signed-off-by: Richard Henderson --- target/hppa/helper.h | 1 + target/hppa/insns.decode | 2 ++ target/hppa/op_helper.c | 14 ++++++++++++++ target/hppa/translate.c | 5 +++++ 4 files changed, 22 insertions(+) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 99486f4cf8..1feb2fdfc4 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -16,6 +16,7 @@ DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) DEF_HELPER_FLAGS_2(hadd_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hadd_us, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_2(havg, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hsub_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hsub_us, TCG_CALL_NO_RWG, i64, i64, i64) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 1830b06c76..fb0f9d6dbd 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -214,6 +214,8 @@ hadd 000010 ..... ..... 00000011 11 0 ..... @rrr hadd_ss 000010 ..... ..... 00000011 01 0 ..... @rrr hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr +havg 000010 ..... ..... 00000010 11 0 ..... @rrr + hsub 000010 ..... ..... 00000001 11 0 ..... @rrr hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index ece523bea0..cba610ac75 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -410,6 +410,20 @@ uint64_t HELPER(hadd_us)(uint64_t r1, uint64_t r2) return ret; } +uint64_t HELPER(havg)(uint64_t r1, uint64_t r2) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = extract64(r1, i, 16); + int f2 = extract64(r2, i, 16); + int fr = f1 + f2; + + ret = deposit64(ret, i, 16, (fr >> 1) | (fr & 1)); + } + return ret; +} + uint64_t HELPER(hsub_ss)(uint64_t r1, uint64_t r2) { uint64_t ret = 0; diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 63c6a28cef..c1ca4db099 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2776,6 +2776,11 @@ static bool trans_hadd_us(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_hadd_us); } +static bool trans_havg(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_helper_havg); +} + static bool trans_hsub(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64); From patchwork Fri Oct 20 20:43:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736353 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp504319wrl; Fri, 20 Oct 2023 13:56:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHP/Al0XFUQc3wXtoH+YaRDYIW5pWDGTPkGH5xvg+UnRdz5y7PhSNbFTZEAzhoEaad3USZG X-Received: by 2002:a05:6358:6186:b0:143:5826:dece with SMTP id w6-20020a056358618600b001435826decemr3380588rww.25.1697835407485; Fri, 20 Oct 2023 13:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835407; cv=none; d=google.com; s=arc-20160816; b=FBW4+OV4ljYSktQPL/r+hF7sCbO75JHUFxBIxITDDIzn7xxAt4SD9o7BCNqr2nRryy JmXoejFolkedWSd2fWz9Via0TLNY0K4B6frqaLYWRXmo4N+AKRED0UOgXECauFyUzQ8N EpA11mlYf2dUJvGMDq46vGWW+wlA1RMUpVNMMUKDqYFnqPJQ8S3r5Qa7mrGHBgeHAn1A CKL0zmKdGLGdwEmVCP7GNtTgNpts12SJT7fFLr/sMI+fPr+v1lndTCcQ43wg1ze+lDT6 fP/wQPNiR4w2d+bP4oRq0vSY9LPx+bcTqw04HXtlT+5dD8pNMlXHhjGsWziiE/mtcG86 x1CQ== 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=ojJYI0tVlCUuFtnD7VBP+O6EPwqAH+K63czDDMFmTyw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=kGARPG0mgK9k15ocEM8ypGhCtDvJ1aaSYVBMlv1KzBZ0UWskzpd7tfDYME7a2/EMVK nXLzHEdSot5tdv/ZaJnTCSy8F9ZpFkZ02jGAM5dDIuAe/+TzF87u0mT43fqIWmonP8MA XdRQWpJFu4Glioa29fYBgjPVfirHHmp74+CWw90zkCUx25smJm8fYGuRey8bnAsCWY41 TH6qZteCsodIvnqUBxym8p+GA9M3G2twAOhYYtMgxX6NR7mTU76Fffc4nWO4cr2ghYps 7G9VIy886EXMMqG5hn1HNC4heyIB03BNGeypiAOUIBT8p6WtrW/pL7yW7KbZrhH0TfCK zWng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ksrz+ISL; 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 fy24-20020a05622a5a1800b00418e6893fcasi1918057qtb.614.2023.10.20.13.56.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:56:47 -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=Ksrz+ISL; 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 1qtwP2-000218-0e; Fri, 20 Oct 2023 16:47:28 -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 1qtwOy-0001xZ-VK for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:24 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOw-0001Cb-RA for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:24 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-692c02adeefso1086347b3a.3 for ; Fri, 20 Oct 2023 13:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834841; x=1698439641; 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=ojJYI0tVlCUuFtnD7VBP+O6EPwqAH+K63czDDMFmTyw=; b=Ksrz+ISLyq6PPcLMVsKFVMm/qsb/zAETjxx/TFOafqtZofZAxXUPEFgyLnLWemhtJX wECaoK0uQuAyGYS+y9ZXZ5wOtj39tpJ7EB3+d9BKnUewTDMaT8nhF1BB6tG1Ok1zpogH mfHFgpaHKadc8CyMI6GvqWpl7PohcYwqBxr8bAs6aSHYPh3yzaItODMMON1lKxnlYA0X ANQ7+gNoNOXhPG4XY2XEWwU7kOYfxM9JhHqjW5CipyfIFTgUSvwybA4+D6HhLrxUcFtB rXGClQ5qJBG5LQ/f31uDw7CzWIJLpTtVexXdAMLloxBu2n8ArHm5x/9YHOVIP663h3op NuKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834841; x=1698439641; 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=ojJYI0tVlCUuFtnD7VBP+O6EPwqAH+K63czDDMFmTyw=; b=syWo1+RoH/Z2W3oaJlgEYtnoNwjiY0tuhiSDs/2MV36u2uHzCqSwv+90jPCexDvQd1 9bRKVS4fN0TyCJCrmdHcifXHZcEoIBI7pEDCt0MA1eyBkfuFuz3XrmY19uUEsbnKYv5d rm8Dmgw0Rm7dkA4IP29bBnTwVYa9yr8nrN+LbjhWbC3xyMpsSpHnkzXV5J88AbEHhqcH TnmPgXAMhxstB1q68BjN5avuASds8GW/XjdibQTmXoX+KESoVZcbO+S0tHmvR16Q1hLh 2CPGoGM4/EGTnDZ3WV1+FznvCNflCL3PapMy1Edvi/hGhNpRBnbA4hmRqcETfGOnxaGr Zn+Q== X-Gm-Message-State: AOJu0YyghM+hz5F1jr8Vm8M6CtCbxzhPdgeYdjRt3k6Ltsfh3wqYmtk5 xwSwy9Qms6qJnk/34jxQpZ/OK0oigHUAyuu0PaE= X-Received: by 2002:a05:6a20:2324:b0:172:913c:ba36 with SMTP id n36-20020a056a20232400b00172913cba36mr2507969pzc.24.1697834841639; Fri, 20 Oct 2023 13:47:21 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 55/65] target/hppa: Implement HSHL, HSHR Date: Fri, 20 Oct 2023 13:43:21 -0700 Message-Id: <20231020204331.139847-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 5 +++++ target/hppa/translate.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index fb0f9d6dbd..f0c4866ca2 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -69,6 +69,7 @@ &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d &rrr_cf_d_sh t r1 r2 cf d sh +&rri t r i &rri_cf t r i cf &rri_cf_d t r i cf d @@ -216,6 +217,10 @@ hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr havg 000010 ..... ..... 00000010 11 0 ..... @rrr +hshl 111110 00000 r:5 100010 i:4 0 t:5 &rri +hshr_s 111110 r:5 00000 110011 i:4 0 t:5 &rri +hshr_u 111110 r:5 00000 110010 i:4 0 t:5 &rri + hsub 000010 ..... ..... 00000001 11 0 ..... @rrr hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c1ca4db099..353d51cc8b 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2761,6 +2761,26 @@ static bool do_multimedia(DisasContext *ctx, arg_rrr *a, return nullify_end(ctx); } +static bool do_multimedia_sh(DisasContext *ctx, arg_rri *a, + void (*fn)(TCGv_i64, TCGv_i64, int64_t)) +{ + TCGv_i64 r, dest; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r = load_gpr(ctx, a->r); + dest = dest_gpr(ctx, a->t); + + fn(dest, r, a->i); + save_gpr(ctx, a->t, dest); + + return nullify_end(ctx); +} + static bool trans_hadd(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_add16_i64); @@ -2781,6 +2801,21 @@ static bool trans_havg(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_havg); } +static bool trans_hshl(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_shl16i_i64); +} + +static bool trans_hshr_s(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_sar16i_i64); +} + +static bool trans_hshr_u(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_shr16i_i64); +} + static bool trans_hsub(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64); From patchwork Fri Oct 20 20:43:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736330 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502900wrl; Fri, 20 Oct 2023 13:51:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXTO8Uoo6VeEV6s1o/mqcOeSiqs/Z9uex5stF5mY7Ulj8SSem5pUss0+wyCorTuwSGI6RI X-Received: by 2002:a05:622a:1a86:b0:418:224:db06 with SMTP id s6-20020a05622a1a8600b004180224db06mr3443911qtc.50.1697835094503; Fri, 20 Oct 2023 13:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835094; cv=none; d=google.com; s=arc-20160816; b=QqAF/Yx0VqFQdYutnSiMHR8SV/J3GrhuyWdpwUzTRgNe1uHUy7Q0TCJgohsGzsGa1c 02DyAsuTSS6ysmD/u7xjCq8ifGqq6V4LMtR+pMg5HBKqSFLr3SVkAxD5DOqlVDtrDoV3 bFjSCB/bZL4h2lO3Y+A12OFmaUPvakXWkYRSme2/QWhMDbu5HQbHzN3C4BtHyT9HUgZd lVtJEvgv/78xTzsXYskHtUB9P2lcsnmHVB2KqlTNYBYcQw8XQNNw46BoOwhuPvGHLxSn 5oAxXqRcNbU8fLdAcr48ZeGei3e0e0fjHLJxaZJV50RMvDCrQblXX1B24vmt0nxad5WP kgIw== 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=6ZQqhnqvw8jUMDjxWBT9l+s67nfFE6KW7Kxk+PLyIRA=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ImJjcH6Abo4khsJyvq8A4sSMlT9VlEjpgtBiWul7HY4ZFAAzEyxKHy25inotEgDiWI JiduaeKK1xQswPHVk0Re/7PgLYYFbKo7mmvqKPDa5KUoWMDqb8N+ygHwXa+8anXS0nUH SevMgl4n4fn6NokXkqMO/Oc1s76ERzS4TV+ynOzvB9YgvNEIL6d99yTO6GmMXWfwzM8z PX5Y+axFz2+G9Rx6/wh9T4hB10MWk36P+4GAEsvtsUMOuFWFEKilcSUi93Ergi9yqluU EskWUccrhTbs+4qLLVqNhwtd/jVtCIEjipP7pLIqnkoUv9aj8M1xWG7CfQQixs5AUMnO 2yJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hXy5IGvq; 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 f18-20020ac85d12000000b004181e1d50f9si2047611qtx.549.2023.10.20.13.51.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:34 -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=hXy5IGvq; 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 1qtwP2-000221-IR; Fri, 20 Oct 2023 16:47:28 -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 1qtwP0-0001ze-5L for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:26 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOy-0001Cs-9T for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:25 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6ba172c5f3dso1172493b3a.0 for ; Fri, 20 Oct 2023 13:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834842; x=1698439642; 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=6ZQqhnqvw8jUMDjxWBT9l+s67nfFE6KW7Kxk+PLyIRA=; b=hXy5IGvqfXsi1Wcb9dSznWPCEydHYXBE7Z8udw38XFrvJ3i8+hltNfSDXl1XwE2o1a sq/blMt5GFaW0WoZxhZHlSkjAGvAyRmsfFEUpp4oUX7wDFLiWDzwGKFnUsOavd6fO015 CwutWU1XcHtQIJ4eItjcV/0tY1HEceMDx/GB/itPmUkWOU2RMZa2l2ZcLBKzxWoQ/wV/ fDbcJTQf04K18BtdrOPmt68meUxbIcYd7eW4WiAgxFJ6Svjvn7kuSUvPtbI66s/oByr4 hHz/bHANQooLtrM1HLkidasYTwgffcAVq7vk5dFV9G1zy5gSuJIAHYf+9hty8vK3TYtb CJEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834842; x=1698439642; 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=6ZQqhnqvw8jUMDjxWBT9l+s67nfFE6KW7Kxk+PLyIRA=; b=Yw/0lRJ1drE2vRm/AuepQrbNKoRWjYByoshpLs4n6IlT5SR5hLWDauocKSoySRkejV uQgcJJGKIwqWRzjULN3BDhxiuYNTeCwkSdhXpqif3EfhGbNdznitfG2HvWZ0nhfjb8UM 7YcAbU+YbuI6ndty1CMqMKdnstYTg6zdqQBGuTowurHDz9ffUUtbC6OJ+adLz1WGXvpv 6GJ9PNfIRGrt1mwHwzPlBnWfJssJiqOvkAWxT/1CCLgjWpM/Asjk9ZC08OHJM+s5WeTX KWIvaoNJqWzuVkA2ryshD1geLVaKCrS6kLvIqGwrhdT0Y3gVOfUZP2C0ill1QYQg5320 aiaw== X-Gm-Message-State: AOJu0YzIiNuSHQSc+9Z2VDQpWF7wofI4PY9B8Mal6BKQXHHkT31JbDhL A6SGXvmeML6H3iItc87sIgF7rJ/4nRir4XQ1oKI= X-Received: by 2002:a05:6a00:1a09:b0:6be:2dce:cf5a with SMTP id g9-20020a056a001a0900b006be2dcecf5amr2797719pfv.26.1697834842318; Fri, 20 Oct 2023 13:47:22 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 56/65] target/hppa: Implement HSHLADD, HSHRADD Date: Fri, 20 Oct 2023 13:43:22 -0700 Message-Id: <20231020204331.139847-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 Signed-off-by: Richard Henderson --- target/hppa/helper.h | 2 ++ target/hppa/insns.decode | 12 ++++++++++-- target/hppa/op_helper.c | 32 ++++++++++++++++++++++++++++++++ target/hppa/translate.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 2 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 1feb2fdfc4..c4c3093a83 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -17,6 +17,8 @@ DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) DEF_HELPER_FLAGS_2(hadd_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hadd_us, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(havg, TCG_CALL_NO_RWG, i64, i64, i64) +DEF_HELPER_FLAGS_3(hshladd, TCG_CALL_NO_RWG, i64, i64, i64, i32) +DEF_HELPER_FLAGS_3(hshradd, TCG_CALL_NO_RWG, i64, i64, i64, i32) DEF_HELPER_FLAGS_2(hsub_ss, TCG_CALL_NO_RWG, i64, i64, i64) DEF_HELPER_FLAGS_2(hsub_us, TCG_CALL_NO_RWG, i64, i64, i64) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index f0c4866ca2..d7befbf73d 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -68,6 +68,7 @@ &rrr t r1 r2 &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d +&rrr_sh t r1 r2 sh &rrr_cf_d_sh t r1 r2 cf d sh &rri t r i &rri_cf t r i cf @@ -86,6 +87,7 @@ @rrr ...... r2:5 r1:5 .... ....... t:5 &rrr @rrr_cf ...... r2:5 r1:5 cf:4 ....... t:5 &rrr_cf @rrr_cf_d ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d +@rrr_sh ...... r2:5 r1:5 ........ sh:2 . t:5 &rrr_sh @rrr_cf_d_sh ...... r2:5 r1:5 cf:4 .... sh:2 d:1 t:5 &rrr_cf_d_sh @rrr_cf_d_sh0 ...... r2:5 r1:5 cf:4 ...... d:1 t:5 &rrr_cf_d_sh sh=0 @rri_cf ...... r:5 t:5 cf:4 . ........... &rri_cf i=%lowsign_11 @@ -187,14 +189,20 @@ dcor_i 000010 ..... 00000 .... 101111 . ..... @rr_cf_d add 000010 ..... ..... .... 0110.. . ..... @rrr_cf_d_sh add_l 000010 ..... ..... .... 1010.. . ..... @rrr_cf_d_sh add_tsv 000010 ..... ..... .... 1110.. . ..... @rrr_cf_d_sh -add_c 000010 ..... ..... .... 011100 . ..... @rrr_cf_d_sh0 +{ + add_c 000010 ..... ..... .... 011100 . ..... @rrr_cf_d_sh0 + hshladd 000010 ..... ..... 0000 0111.. 0 ..... @rrr_sh +} add_c_tsv 000010 ..... ..... .... 111100 . ..... @rrr_cf_d_sh0 sub 000010 ..... ..... .... 010000 . ..... @rrr_cf_d sub_tsv 000010 ..... ..... .... 110000 . ..... @rrr_cf_d sub_tc 000010 ..... ..... .... 010011 . ..... @rrr_cf_d sub_tsv_tc 000010 ..... ..... .... 110011 . ..... @rrr_cf_d -sub_b 000010 ..... ..... .... 010100 . ..... @rrr_cf_d +{ + sub_b 000010 ..... ..... .... 010100 . ..... @rrr_cf_d + hshradd 000010 ..... ..... 0000 0101.. 0 ..... @rrr_sh +} sub_b_tsv 000010 ..... ..... .... 110100 . ..... @rrr_cf_d ldil 001000 t:5 ..................... i=%assemble_21 diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index cba610ac75..9d8e728460 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -455,3 +455,35 @@ uint64_t HELPER(hsub_us)(uint64_t r1, uint64_t r2) } return ret; } + +uint64_t HELPER(hshladd)(uint64_t r1, uint64_t r2, uint32_t sh) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = sextract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = (f1 << sh) + f2; + + fr = MIN(fr, INT16_MAX); + fr = MAX(fr, INT16_MIN); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} + +uint64_t HELPER(hshradd)(uint64_t r1, uint64_t r2, uint32_t sh) +{ + uint64_t ret = 0; + + for (int i = 0; i < 64; i += 16) { + int f1 = sextract64(r1, i, 16); + int f2 = sextract64(r2, i, 16); + int fr = (f1 >> sh) + f2; + + fr = MIN(fr, INT16_MAX); + fr = MAX(fr, INT16_MIN); + ret = deposit64(ret, i, 16, fr); + } + return ret; +} diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 353d51cc8b..47abed1662 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2781,6 +2781,28 @@ static bool do_multimedia_sh(DisasContext *ctx, arg_rri *a, return nullify_end(ctx); } +static bool do_multimedia_shadd(DisasContext *ctx, arg_rrr_sh *a, + void (*fn)(TCGv_i64, TCGv_i64, + TCGv_i64, TCGv_i32)) +{ + TCGv_i64 r1, r2, dest; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r1 = load_gpr(ctx, a->r1); + r2 = load_gpr(ctx, a->r2); + dest = dest_gpr(ctx, a->t); + + fn(dest, r1, r2, tcg_constant_i32(a->sh)); + save_gpr(ctx, a->t, dest); + + return nullify_end(ctx); +} + static bool trans_hadd(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_add16_i64); @@ -2816,6 +2838,16 @@ static bool trans_hshr_u(DisasContext *ctx, arg_rri *a) return do_multimedia_sh(ctx, a, tcg_gen_vec_shr16i_i64); } +static bool trans_hshladd(DisasContext *ctx, arg_rrr_sh *a) +{ + return do_multimedia_shadd(ctx, a, gen_helper_hshladd); +} + +static bool trans_hshradd(DisasContext *ctx, arg_rrr_sh *a) +{ + return do_multimedia_shadd(ctx, a, gen_helper_hshradd); +} + static bool trans_hsub(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64); From patchwork Fri Oct 20 20:43:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736316 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502513wrl; Fri, 20 Oct 2023 13:50:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFy5ZSOSUZJxnNo+lwwKua/5QSDZjr1y4v9lc/mBiAshXPFL8gxDFSnVGIrLg+jTR8hQYC9 X-Received: by 2002:a05:622a:3d2:b0:41c:d41b:1b99 with SMTP id k18-20020a05622a03d200b0041cd41b1b99mr3824675qtx.35.1697835002846; Fri, 20 Oct 2023 13:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835002; cv=none; d=google.com; s=arc-20160816; b=biZU78wJKihE0ftr2aqztx3p74thmlbKHGRpk2HXUgAxBQcMfPA+zeOeonAX2tVD5X gktWECJDo1Em3IJDYiemV8MJhdpgUWAiPX8xgp7PwdyqxIJAZgknElcfHpVG6Ctn2vgt 3lFeXhdvuvDaiX/j2J+/pN1i/VyIObKJ3qUU387qGUxCgpzM5LGudDqRSzxDe9E8Tv+T oRydoNW1KDsrlVAWCZWwCPjoctBqOcqGHOvfZ/+HJf/s5/Qz3/wMhrluYZYlE4qnzr6t qhyb7PVD7wERZlJnHofZUCRcxk2bve+af0sM49kw7CfO3Jn6bqUFHru6SWS/J9t9SCKb 3Lkw== 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=eagFRPY1VSjyYYNRpnFw4I3TM7g/2HuCoJQHp1cHX38=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=gLQAxBL0uS3wzVXv2yHuCJzvYgQxrgxQd4yCv/4PDJ0XYnNfrAiBBcuJp3E1WdUpTm UYNe3VdOIRC98iNJ9Nbx/w9AMtS2FPSLHin+cP8GHBuQS2m75J4LuO+L9dcoImdFplJO GTngpfyY23PBf0Si/j+hH+KIBwWVlx76+nPbpC0Tq2rRrooR6oBmLoxeqvGbjL1WDeRx dXz6kXNpv5Bs+apkxkbjuerhUOzy+O5dYmHBU+aP4dKPTuLQTcGBZv8KCEzr9Mw61UIx gxFL8baHvwCwKiIzZ9hzg124fb7IOHP/n8MFf6xCnepTJPU891B+tvlr+NJEIjiCnveC X1Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CNsgA/8i"; 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 i22-20020ac85c16000000b0041818f7676bsi1979732qti.294.2023.10.20.13.50.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:50:02 -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="CNsgA/8i"; 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 1qtwP1-00020v-Qn; Fri, 20 Oct 2023 16:47:27 -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 1qtwP0-0001zc-0R for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:26 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOy-0001D9-Bl for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:25 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6ba54c3ed97so1178783b3a.2 for ; Fri, 20 Oct 2023 13:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834843; x=1698439643; 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=eagFRPY1VSjyYYNRpnFw4I3TM7g/2HuCoJQHp1cHX38=; b=CNsgA/8imnsNqfhJ2qDttRHHtHtDvSyxLKXkt77RoJktsEcp0t6ekm9do8gWShT0P3 Tra5+5EHfhQIfMIl2SXi+PqDjebMvUGykqH2plaVQVtUV7KP2N7Oyk+KNRGzGAsJhiGC +QmH1arWSemmWHSBqMkR0pFgJrM2bKtR2jLWfaFIEZr+ZUnceSByWxrkFUdqgaGsi9Rs HrrYGcq5AhtiTmxVFVZxSjm34HjMaIysQLQheFQFd0h6cf00pm1jSoHOeap6disqrG8e kpla21IUK9fd9m/lKXya6xsBn2JAUSHRViPUEsPvcVdORWpK+HL0UNW3jNGTT0TaGlvu dcpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834843; x=1698439643; 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=eagFRPY1VSjyYYNRpnFw4I3TM7g/2HuCoJQHp1cHX38=; b=FyViUQBE9CDPK7FkSpa2ISG44X2kUA785HipuUjmOOLVRWwwJpSuktVToXf2uJNe0q emErCMvNirfVpJt9PGAcTQSi+cK2UTLCFXyVJHTzhsUVCpkC3bQZKGl7eLIXKGb8rgof zhs27V4WXMCgsmEJkIuienmXB0qM8S0b8u2uGwDeziXh+YOUtd2KZi1LB0XtVIBqeOBM Mpd5U6Jvcd1AipUzJz8jDzxdKZql9VWNrSKu1PGdTW8UvixszRrEcBWlQFrZZQaXJqHL cKiyE3+AJlH7ecFqYd0vjbwD2flQ1ZWxaKeGaoAuHiWEm5nM4vD2f0mLNyFM9vifUHvP H+/A== X-Gm-Message-State: AOJu0YzIiu6iRhCCD5Ib6hZFd2mNA3X59wVUn4EUgVF3NTsMQhItgXba kwgrSaGJObeVzIKHBwSLD/+tRZuhprE3VN6qrP4= X-Received: by 2002:aa7:9718:0:b0:6be:25c5:4f74 with SMTP id a24-20020aa79718000000b006be25c54f74mr2685255pfg.13.1697834843140; Fri, 20 Oct 2023 13:47:23 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 57/65] target/hppa: Implement MIXH, MIXW Date: Fri, 20 Oct 2023 13:43:23 -0700 Message-Id: <20231020204331.139847-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 5 ++++ target/hppa/translate.c | 55 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index d7befbf73d..323e9275bf 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -233,6 +233,11 @@ hsub 000010 ..... ..... 00000001 11 0 ..... @rrr hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr +mixh_l 111110 ..... ..... 1 00 00100000 ..... @rrr +mixh_r 111110 ..... ..... 1 10 00100000 ..... @rrr +mixw_l 111110 ..... ..... 1 00 00000000 ..... @rrr +mixw_r 111110 ..... ..... 1 10 00000000 ..... @rrr + #### # Index Mem #### diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 47abed1662..57761a7bed 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2863,6 +2863,61 @@ static bool trans_hsub_us(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_hsub_us); } +static void gen_mixh_l(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + uint64_t mask = 0xffff0000ffff0000ull; + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_andi_i64(tmp, r2, mask); + tcg_gen_andi_i64(dst, r1, mask); + tcg_gen_shri_i64(tmp, tmp, 16); + tcg_gen_or_i64(dst, dst, tmp); +} + +static bool trans_mixh_l(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixh_l); +} + +static void gen_mixh_r(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + uint64_t mask = 0x0000ffff0000ffffull; + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_andi_i64(tmp, r1, mask); + tcg_gen_andi_i64(dst, r2, mask); + tcg_gen_shli_i64(tmp, tmp, 16); + tcg_gen_or_i64(dst, dst, tmp); +} + +static bool trans_mixh_r(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixh_r); +} + +static void gen_mixw_l(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_shri_i64(tmp, r2, 32); + tcg_gen_deposit_i64(dst, r1, tmp, 0, 32); +} + +static bool trans_mixw_l(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixw_l); +} + +static void gen_mixw_r(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + tcg_gen_deposit_i64(dst, r2, r1, 32, 32); +} + +static bool trans_mixw_r(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixw_r); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) { From patchwork Fri Oct 20 20:43:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736339 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503584wrl; Fri, 20 Oct 2023 13:54:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcYnbeepNbDOqgNKpX3bn5QJ9gUr9DMGnqT3pQEbJpXU//KFLvvXZMKdKpJh9H1qwglpmN X-Received: by 2002:a05:620a:20dd:b0:774:226b:c327 with SMTP id f29-20020a05620a20dd00b00774226bc327mr3012557qka.67.1697835245061; Fri, 20 Oct 2023 13:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835245; cv=none; d=google.com; s=arc-20160816; b=Wg8kylFU1BEfdtyJkn7KoDk6CbQ7DL5viH874gPQ6gybDm5slcR489ivxFaTVnHnOU PmXb/Uu2dGOM1z21xKdrv6/oHG2r/N8uRPHWByjU6O+gCTefzkVKNRRiYt0eyc3IKZJY 3nJV2BuFx8cSNzPhL61Aqau8iOm/bAQM0R7O2UsKNVy4b1ybHOThsJK+f4Mcgstzzm8H hP51UK7WyBT4402ff4KRk6KFd33ULIstd8V1992Ojz2NriGntKrFESq3eSR7ulingJLF nKiJjUuvz4Dg+A6tlvyUWrihE+zwc21hLeN20oQwwNCrwCw5oWfx+FsJZEYpXzi0dftz Ro7w== 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=vCTK88xBMWfzmeJbduNmhzzftWpNcH9Bxr7XmbIVZL8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=L4goCWARijtzLrjZ2nA01RfrSEveSO+KLzOQ/1tTnuTM/cvc4D5LBoa+MnnHnb8Suq O96y4eG97NEQEHfhso/JeRo9Pd5BJJmMO4MFLMEXXsr9ngt/MXUXCLFF98hctUuIGaTT 3S45Y42NjGufLuOCJ9xm+/zXgS91s/HmiJ78sOMULcqttQdXpDo8NGtAwkVb979lXocJ RJODZ9aLtXcvFVNx/baFNZ6xQErNjkj6ZiqsGittLy0n6H/JWGuTeriVmf7qoslI5WJV W0HAVvcF9CMpNoCTK8Wl1GOXOv27Qw94aQSGFBz+GtrB/MJvis4Wa1dkqrm/6dmDIeXp kJyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YjbxEmzZ; 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 bk40-20020a05620a1a2800b00774184acfeesi2061291qkb.297.2023.10.20.13.54.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:05 -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=YjbxEmzZ; 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 1qtwP4-00023k-OE; Fri, 20 Oct 2023 16:47:30 -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 1qtwP0-0001zx-KR for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:26 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOz-0001DQ-2A for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:26 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6bd0e1b1890so1097609b3a.3 for ; Fri, 20 Oct 2023 13:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834844; x=1698439644; 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=vCTK88xBMWfzmeJbduNmhzzftWpNcH9Bxr7XmbIVZL8=; b=YjbxEmzZt/zxrb7CfWIjD25Q85GP5N3krRbvjFZOfYdTiWxxacblKkjjsdXdWPylHR oY5XZqWtIgHrJ9/rr5F0fF68PnAt4GAubVXW6OTHZCaqGj75xHB8iXNY5YAy44sThldj vqN2Kgz9ucaLDe+4icbxxcyt+4VnQWzCCG8u0xz7L1zLXQY8KQLICfAJGfNZ7eevE2xD +obgeJDHLYACzyOSHeZgv59obNeE6kHpgAOr7S1Su9KPozoiixr4OGEdgFDza/4zHpY9 LNG8BQbt/bF91WQI+Mapf7u/vXNX5IRv/YYKjBCl7VdhTHBCXIbTX2pmj7I5GINQ0zTx 1I1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834844; x=1698439644; 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=vCTK88xBMWfzmeJbduNmhzzftWpNcH9Bxr7XmbIVZL8=; b=Hdzf60m6BMTovHXY/fbNSXKnyWJHYkm4ZEfANTCndrV6pzWnTkePsJj8E3+A9uTfGL nSkJsxkTdXECi352Vrv+xEgHg6JEvhllvFP6kBPN/UNkXkutRNB1hwBLQn3NGfg6p1KQ RjnVNPr155FOVh8xEXtTZtaK9gpdisIWduETKS7JI/F9IZeWWRMyH+cUHhu6WIYp7mlX iUk0vQCV9y0FpKhObgzhJAEGZ3+OnZ5rmSoiNLJl4IHAAus8J/Lb7knAnshWgZAkMdfM m1jHXaj+1vKRCL2SsWrGS0WrnrYiPzdsiY4Ij15CxvSw7gKLvUVb0Ye64QVcOivdMGTB FgIQ== X-Gm-Message-State: AOJu0YzbLyr/EUfvZa1JsyZOruxysS4ivfVereRhZLGX8LY5WGCeR78m vLyCpARi97aK+ZwmXmzBqIFSRrn7l+oKNCamnPQ= X-Received: by 2002:a05:6a00:2da7:b0:68f:fa05:b77a with SMTP id fb39-20020a056a002da700b0068ffa05b77amr2982313pfb.31.1697834843851; Fri, 20 Oct 2023 13:47:23 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 58/65] target/hppa: Implement PERMH Date: Fri, 20 Oct 2023 13:43:24 -0700 Message-Id: <20231020204331.139847-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 2 ++ target/hppa/translate.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 323e9275bf..c8f4317576 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -238,6 +238,8 @@ mixh_r 111110 ..... ..... 1 10 00100000 ..... @rrr mixw_l 111110 ..... ..... 1 00 00000000 ..... @rrr mixw_r 111110 ..... ..... 1 10 00000000 ..... @rrr +permh 111110 r1:5 r2:5 0 c0:2 0 c1:2 c2:2 c3:2 0 t:5 + #### # Index Mem #### diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 57761a7bed..a79cf52fcc 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2918,6 +2918,35 @@ static bool trans_mixw_r(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_mixw_r); } +static bool trans_permh(DisasContext *ctx, arg_permh *a) +{ + TCGv_i64 r, t0, t1, t2, t3; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r = load_gpr(ctx, a->r1); + t0 = tcg_temp_new_i64(); + t1 = tcg_temp_new_i64(); + t2 = tcg_temp_new_i64(); + t3 = tcg_temp_new_i64(); + + tcg_gen_extract_i64(t0, r, (3 - a->c0) * 16, 16); + tcg_gen_extract_i64(t1, r, (3 - a->c1) * 16, 16); + tcg_gen_extract_i64(t2, r, (3 - a->c2) * 16, 16); + tcg_gen_extract_i64(t3, r, (3 - a->c3) * 16, 16); + + tcg_gen_deposit_i64(t0, t1, t0, 16, 48); + tcg_gen_deposit_i64(t2, t3, t2, 16, 48); + tcg_gen_deposit_i64(t0, t2, t0, 32, 32); + + save_gpr(ctx, a->t, t0); + return nullify_end(ctx); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) { From patchwork Fri Oct 20 20:43:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736327 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502807wrl; Fri, 20 Oct 2023 13:51:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6okcQmnX1iDQzLAaVcj6gmh9qzu72ONvJNMUvaIrPeQ3N+cmfBhRK3epfD9N/H2GGSgun X-Received: by 2002:ad4:4ee5:0:b0:66d:17a2:34cc with SMTP id dv5-20020ad44ee5000000b0066d17a234ccmr3086294qvb.64.1697835072595; Fri, 20 Oct 2023 13:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835072; cv=none; d=google.com; s=arc-20160816; b=C72CQUcd2tmcStAv6YPHX98YsrmZREwjDmwfhmCKuAR7eJazOtqGjarIF54611Krx/ igZg8QcOmPrEV24/DeFBFBPayd86G5zVHW2SrIkC5/PC0tFYV7Y4tD1UQGnuMfo1iO9P GDMwqHY/9QvhPFDi1V2sZ/OTmk89vRCUdWr3qv3QVGjxfasrOnu0FdaG9OQlBVG/un2J 7nqrPTVZfAoASgKxxS37YmPxMw5tFnI8P/bWTxt+r6+psCSMvrgweFJARhblnbONm4D5 sXdtyKkRp5o62tIygLWM+HylKlYJ6d9mi1nc7BcvF+OffXJioVPYqGkt+7UumlYBLJZn qE9w== 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=wM6oyD2tzl0dJH7FSQ0obv2SUstAr+kC/PKso0mR/f4=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=wNym9wibxJ0Hx+4FX8kjKGq1XUM1oeCRnOyhVBQNx/mRPy/xCfI88SqnD/lsDu92Kl J8Mv+TDLAUD0suwG9W/2ry1obj7DZXVkwSluX+i5FvzB6+3MtXY9JHDeBEyJ21i3KGWr Fzn7Zu1unS9B6Vq5VZYIGiQ+kCSV+WIcr/zPqm4EKD4atwkmy2iAMPJUM0r5EEFr4ncn p7QhtdwkQEalBPnrNEUsJsWm4NDTvTxYZUVddW1XJ02JOaLSyI7094dg3jVgxa+Hvwko A8tVjYalOYHyuV7Mcbu1eXLe55Qr43jyj6C74ktgrf+FhQVF9rRjy8yrqBdfukdnxpU3 vDFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9J1mEZK; 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 pg4-20020a0562144a0400b0065b1114f99asi2104596qvb.591.2023.10.20.13.51.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:12 -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=q9J1mEZK; 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 1qtwP4-00023V-5B; Fri, 20 Oct 2023 16:47:30 -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 1qtwP1-00020d-Hy for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:27 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOz-0001Df-TW for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:27 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6b20577ef7bso1115545b3a.3 for ; Fri, 20 Oct 2023 13:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834844; x=1698439644; 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=wM6oyD2tzl0dJH7FSQ0obv2SUstAr+kC/PKso0mR/f4=; b=q9J1mEZKolsO6/7XmrUFsT34HsbqbORm7fg+kk24XJCVTOAf7XW84i8Uzx9dqJ04Rv /nLdNIDjvp8lm+d6zP7NDCc+J/gyBgIHxe6tQvq/+YAcLj2XryXh7ZL0AelPzcaP7VJR cDcnX/OVqJFnuI/HlONwa8l0giHiFdGczv1zt2KkyK2z5VK2HLAP1bIpm4s6Wyt7yNbc br6r1x18MRCheTAYUTB1evqi6Hbn9MBGUV6X5fyY5sBHH0vs4gXzw6KS6JTLTmmOPImh SE/qzuU5ZmvU4pyQ02+K5jwUL69cBiEVqTvwhfYx2b2QPLLY1VdkB33kpjqnHsRK8sWc MH7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834844; x=1698439644; 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=wM6oyD2tzl0dJH7FSQ0obv2SUstAr+kC/PKso0mR/f4=; b=OqFAPBYvI9Giw/FS+YOlJQewZ1C+59Wnr6MQsa27o3p0brUQst3vqSxssxbJVbygy0 8pL5sfpgZhRlFtoJprUQsIQ9f5vGzF1uy0URm9UveyWa8JClyA79R1dBZml67xoR3Jzk Z47uGBaoLosXcqwzKcBynhFHiB2kGQlTy2tSSgdIdT2q/OdfM1vE6vrvEmTqeHTnbqV8 CSGgzlL9mYQT3OE3jFAdW+HMYu9gTDO20BL0sW0hv62tgINkceDnNA/t8IoMJoHXl0cQ 3RUwg+nW4RFXRW1YA/Eamkuoi054HrHlsaOKQ82lbh8WXF7wi5eCara41lURtH9r7y9M uMJw== X-Gm-Message-State: AOJu0YwldJMGonYqR3w9skaNVjCOCKlWs9SfxQvuYaOAiK9yHUt3kWr/ USngwE/T6nqsulJGqKZbwJvggLg6UqpvfdM9+sk= X-Received: by 2002:a05:6a00:1389:b0:68f:d35d:217e with SMTP id t9-20020a056a00138900b0068fd35d217emr3115072pfg.2.1697834844678; Fri, 20 Oct 2023 13:47:24 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 59/65] target/hppa: Fix interruption based on default PSW Date: Fri, 20 Oct 2023 13:43:25 -0700 Message-Id: <20231020204331.139847-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 From: Helge Deller The default PSW is set by the operating system with the PDC_PSW firmware call. Use that setting to decide if wide mode is to be enabled for interruptions and EIRR usage. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 2 ++ target/hppa/int_helper.c | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index c9a9b9d3be..4aea46442a 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -124,6 +124,8 @@ #define PSW_SM_W 0x200 /* PA2.0 only : Enable Wide Mode */ #define CR_RC 0 +#define CR_PSW_DEFAULT 6 /* see SeaBIOS PDC_PSW firmware call */ +#define PDC_PSW_WIDE_BIT 2 #define CR_PID1 8 #define CR_PID2 9 #define CR_PID3 12 diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index f355c4c76b..a11d607b31 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -52,9 +52,17 @@ static void io_eir_write(void *opaque, hwaddr addr, uint64_t data, unsigned size) { HPPACPU *cpu = opaque; - int le_bit = ~data & 31; + CPUHPPAState *env = &cpu->env; + int widthm1 = 31; + int le_bit; - cpu->env.cr[CR_EIRR] |= (target_ulong)1 << le_bit; + /* The default PSW.W controls the width of EIRR. */ + if (hppa_is_pa20(env) && env->cr[CR_PSW_DEFAULT] & PDC_PSW_WIDE_BIT) { + widthm1 = 63; + } + le_bit = ~data & widthm1; + + env->cr[CR_EIRR] |= 1ull << le_bit; eval_interrupt(cpu); } @@ -104,8 +112,10 @@ void hppa_cpu_do_interrupt(CPUState *cs) /* step 1 */ env->cr[CR_IPSW] = old_psw = cpu_hppa_get_psw(env); - /* step 2 -- note PSW_W == 0 for !HPPA64. */ - cpu_hppa_put_psw(env, PSW_W | (i == EXCP_HPMC ? PSW_M : 0)); + /* step 2 -- Note PSW_W is masked out again for pa1.x */ + cpu_hppa_put_psw(env, + (env->cr[CR_PSW_DEFAULT] & PDC_PSW_WIDE_BIT ? PSW_W : 0) | + (i == EXCP_HPMC ? PSW_M : 0)); /* step 3 */ env->cr[CR_IIASQ] = iasq_f >> 32; From patchwork Fri Oct 20 20:43:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736348 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503798wrl; Fri, 20 Oct 2023 13:54:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEy8t9uVodT+AKvN6T4hX/Ran/dfSy1dcRpRyIGp2UQlaCaXUQCkYofqc4f1vBoaUraMnT X-Received: by 2002:a05:622a:253:b0:417:a2f9:bba6 with SMTP id c19-20020a05622a025300b00417a2f9bba6mr2771840qtx.60.1697835289134; Fri, 20 Oct 2023 13:54:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835289; cv=none; d=google.com; s=arc-20160816; b=oD/BECv5tzQ5y11FPkQ94NiJwlASqCumRn4KJk8d3xR1ORAipVMyrjUsZoPibZ5hgF GU0VOyeU0wH/bmCpkDwkMr8OlFIpRV01XiBhTiO95IRJiVERI1WCmwJIyaZrL2zzrYTY IBSRew94KP07WbyCt7lapnXX7stbscyAn/YLyESdZUkHNbqWqfZHTcZwYVxtEz8TqVil c8JYq7tJlJ1YFkrmo6TsyJJ3OlqptBbBh3PpLF9poNHYK3cAqxAAz2aQvWYZLAsO5Myi t8G1VWZISFY0J8bbVhSCNwZfRjGe5mJvCboVyaCakXR2T5ApZsEKlHY4Emom+HDQqYgr rNRg== 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=F7SjukT8MkZFkJ3ExB67ZCgDVB5vB1uA1Vxc0UPcY5M=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=shWlgUN+0QgMcO127zJFqpZ/4ApX2kf3As4XioSTnUbhzfLjvPxeW3gQrtTfPPXWOC NDC1mF2ccopdnonEu9O4Rm5YSykGrcTVjb27oVpH59OFfRisXQFNdVZFkJuXSB10DgBR 0WPg9DY4x3tF2J1hwUE3SVtPge+cFs9T0H/PjbmzuXxJcYSdmOcNmatnWIfgirxy/VrG Frr9S0pzpB0JYsLUXFjJVIwk9Zf3WqmDUOtSsuMsZpze+LfXW2YbqJNlqbC4bO9S8bGH ET+On4TARIAXBIQQ6hgRPQrh5aUlzLoHEnr7XAyf0s7BqGZIW/y/PTlmAcOnWo8aBEO/ D5Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wd6zEQjK; 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 h12-20020ac87d4c000000b00418198aa235si1848908qtb.550.2023.10.20.13.54.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:49 -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=Wd6zEQjK; 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 1qtwP4-00023b-Bf; Fri, 20 Oct 2023 16:47:30 -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 1qtwP2-00022P-NT for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:28 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwP0-0001Dt-TU for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:28 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6b6f4c118b7so1182084b3a.0 for ; Fri, 20 Oct 2023 13:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834845; x=1698439645; 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=F7SjukT8MkZFkJ3ExB67ZCgDVB5vB1uA1Vxc0UPcY5M=; b=Wd6zEQjK9XYvKTmVQHYP47ko5V4Q9dwE1ExYNtRAkjhw2pihaFgqllh8WzVfFjtTxO A3P3y9vAcPfVF4qZX+DyT20Kfgsyczcjvzl1h+W6DJ0WoSctsvhhgbLo4FPEm4XBW3TA EapbZfNoJZivVy3lV1LByH1byScJH65Q7GLZOYGO8vE1W1bqYAMwiBmbKedtW7TI2hiR 23RLKvLSmuGqldf36TgjllJxpi8rGzw095S4pJKy0b4LhqrhBpZvwgATE9RG6n1sKZmV 63J2Sl2IDJEsCl8xNO0ivLSTv0vmn1+Or8PS17RgFpf3YAsiWRe5WLTNt0DYyibS7S23 bxmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834845; x=1698439645; 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=F7SjukT8MkZFkJ3ExB67ZCgDVB5vB1uA1Vxc0UPcY5M=; b=u/TyQ443f6xTMaImtLBu+Ye2a2nBZSGKHvLdBvK4SgwQXkTYm9q1QR5PQlc6ApcrIu NV1/mnJlJsFkqiU7tN9ccIY6nWyqkSO6rbHBXtriQgYD4jmipiM4mhwOgSSQHslxzA1w +c/nT4n5ltJM+6JgTq5nsT/OVBzwTKKKvEs+idohvD7jNMkwTaruFv5x9n+ds6fnPFl4 sbe7N3tbgVsjHt9Cew0/QDrTGOqhae3zQiu84QFNhzKeLEu5rA/R7lmkUDQoBkYMChvx wKW0JBGpXzeCmf5HCjV3IZGWtGrr7IsW1x6wA0L6o0VP3jKQGsj1MUdCHDHA2PRzeyf1 HS+g== X-Gm-Message-State: AOJu0YwhosRnT4QzIf0z/eDeMi8YW4eOFz88fuI1iTRg4DI6Gg07b5mq EtOutKNzAA4JwK6ADjrBMwuqUGI85P5kuOj1ywg= X-Received: by 2002:a05:6a21:66c7:b0:16b:9285:69f5 with SMTP id ze7-20020a056a2166c700b0016b928569f5mr2544162pzb.35.1697834845498; Fri, 20 Oct 2023 13:47:25 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 60/65] target/hppa: Precompute zero into DisasContext Date: Fri, 20 Oct 2023 13:43:26 -0700 Message-Id: <20231020204331.139847-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 Reduce the number of times we look for the constant 0. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/hppa/translate.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index a79cf52fcc..9b60924057 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -53,6 +53,8 @@ typedef struct DisasContext { DisasCond null_cond; TCGLabel *null_lab; + TCGv_i64 zero; + uint32_t insn; uint32_t tb_flags; int mmu_idx; @@ -1004,14 +1006,13 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, } if (!is_l || cond_need_cb(c)) { - TCGv_i64 zero = tcg_constant_i64(0); cb_msb = tcg_temp_new_i64(); cb = tcg_temp_new_i64(); - tcg_gen_add2_i64(dest, cb_msb, in1, zero, in2, zero); + tcg_gen_add2_i64(dest, cb_msb, in1, ctx->zero, in2, ctx->zero); if (is_c) { tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, - get_psw_carry(ctx, d), zero); + get_psw_carry(ctx, d), ctx->zero); } tcg_gen_xor_i64(cb, in1, in2); tcg_gen_xor_i64(cb, cb, dest); @@ -1089,7 +1090,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, TCGv_i64 in2, bool is_tsv, bool is_b, bool is_tc, unsigned cf, bool d) { - TCGv_i64 dest, sv, cb, cb_msb, zero, tmp; + TCGv_i64 dest, sv, cb, cb_msb, tmp; unsigned c = cf >> 1; DisasCond cond; @@ -1097,12 +1098,12 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, cb = tcg_temp_new_i64(); cb_msb = tcg_temp_new_i64(); - zero = tcg_constant_i64(0); if (is_b) { /* DEST,C = IN1 + ~IN2 + C. */ tcg_gen_not_i64(cb, in2); - tcg_gen_add2_i64(dest, cb_msb, in1, zero, get_psw_carry(ctx, d), zero); - tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, cb, zero); + tcg_gen_add2_i64(dest, cb_msb, in1, ctx->zero, + get_psw_carry(ctx, d), ctx->zero); + tcg_gen_add2_i64(dest, cb_msb, dest, cb_msb, cb, ctx->zero); tcg_gen_xor_i64(cb, cb, in1); tcg_gen_xor_i64(cb, cb, dest); } else { @@ -1111,7 +1112,7 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, * operations by seeding the high word with 1 and subtracting. */ TCGv_i64 one = tcg_constant_i64(1); - tcg_gen_sub2_i64(dest, cb_msb, in1, one, in2, zero); + tcg_gen_sub2_i64(dest, cb_msb, in1, one, in2, ctx->zero); tcg_gen_eqv_i64(cb, in1, in2); tcg_gen_xor_i64(cb, cb, dest); } @@ -2430,7 +2431,7 @@ static bool trans_lci(DisasContext *ctx, arg_lci *a) physical address. Two addresses with the same CI have a coherent view of the cache. Our implementation is to return 0 for all, since the entire address space is coherent. */ - save_gpr(ctx, a->t, tcg_constant_i64(0)); + save_gpr(ctx, a->t, ctx->zero); cond_free(&ctx->null_cond); return true; @@ -2639,7 +2640,7 @@ static bool trans_dcor_i(DisasContext *ctx, arg_rr_cf_d *a) static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) { - TCGv_i64 dest, add1, add2, addc, zero, in1, in2; + TCGv_i64 dest, add1, add2, addc, in1, in2; TCGv_i64 cout; nullify_over(ctx); @@ -2651,7 +2652,6 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) add2 = tcg_temp_new_i64(); addc = tcg_temp_new_i64(); dest = tcg_temp_new_i64(); - zero = tcg_constant_i64(0); /* Form R1 << 1 | PSW[CB]{8}. */ tcg_gen_add_i64(add1, in1, in1); @@ -2667,8 +2667,9 @@ static bool trans_ds(DisasContext *ctx, arg_rrr_cf *a) tcg_gen_xor_i64(add2, in2, addc); tcg_gen_andi_i64(addc, addc, 1); - tcg_gen_add2_i64(dest, cpu_psw_cb_msb, add1, zero, add2, zero); - tcg_gen_add2_i64(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, addc, zero); + tcg_gen_add2_i64(dest, cpu_psw_cb_msb, add1, ctx->zero, add2, ctx->zero); + tcg_gen_add2_i64(dest, cpu_psw_cb_msb, dest, cpu_psw_cb_msb, + addc, ctx->zero); /* Write back the result register. */ save_gpr(ctx, a->t, dest); @@ -2968,7 +2969,7 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a) static bool trans_ldc(DisasContext *ctx, arg_ldst *a) { MemOp mop = MO_TE | MO_ALIGN | a->size; - TCGv_i64 zero, dest, ofs; + TCGv_i64 dest, ofs; TCGv_i64 addr; if (!ctx->is_pa20 && a->size > MO_32) { @@ -2998,8 +2999,7 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) */ gen_helper_ldc_check(addr); - zero = tcg_constant_i64(0); - tcg_gen_atomic_xchg_i64(dest, addr, zero, ctx->mmu_idx, mop); + tcg_gen_atomic_xchg_i64(dest, addr, ctx->zero, ctx->mmu_idx, mop); if (a->m) { save_gpr(ctx, a->b, ofs); @@ -4336,6 +4336,8 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->iaoq_n = -1; ctx->iaoq_n_var = NULL; + ctx->zero = tcg_constant_i64(0); + /* Bound the number of instructions by those left on the page. */ bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4; ctx->base.max_insns = MIN(ctx->base.max_insns, bound); From patchwork Fri Oct 20 20:43:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736350 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp504128wrl; Fri, 20 Oct 2023 13:55:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuHVRy38O86AUI2YEvcj+2H402ojQLR3aaKigrily5X/tr0XV0C/pab+9ncLpBWBlxnRxt X-Received: by 2002:a05:6214:1c0f:b0:66d:50a8:2439 with SMTP id u15-20020a0562141c0f00b0066d50a82439mr3889277qvc.23.1697835359765; Fri, 20 Oct 2023 13:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835359; cv=none; d=google.com; s=arc-20160816; b=M1q6FcNKCrV0HGBULn8ys2ZoPMLrp8vYXDSW76k0bywlU3Ngl4p1xLYN/1FZnI1qHI Xtgg6BVtZV1KFrWIINs4R76dSYDEeqmFWdsTH0jhG3byfV2I75jMxd29xfuIV3aVCoqd svT7tW8DHD95EK8U5soWSCnVrMYUksit9rB4LFjRwZ7Epwp16cJDGB9WcQXyMzuwF2qF C6Mm9UTTf8yH/BxBKe1T+YzmSCXcXULEB15FZ3TSk1lmlU/IC+r9fui9QWIANZFJXANQ S/cGNe8H63Ga+KMtVzj0UpFGSoLsWcXxaRWzQbKrMPl0gud8QJBt34M1rcFQFZZTD2/J K+og== 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=5v0gDw2hca7aeL8Edx367HZb46Y2K4iTJAYsw/i0ri0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=IBqC61rxP7q/qN8+gXdvBstKFxKx2nlkNbBs2Zqmz8vipJDWvCb0UDH7RPKIyGodYP rSvW9fo8TFRy9xIHs0JVwO+v7q0GAYnZrHhWlXgmTVdR8XDbGmrdxX0+z3wBdkM6Md0R lUJIzOeLbPgsy7Uu9o0si94AxaDTRdtSIyrZoAOyeGw6Lv+TNgiITt2luhS6wMYWsSul xMDMip8aBQI3LVJBY6Td7+C3Qi0lfpAsG98miZpSY2aKWPmiyq0UunQRCOohzMnA18nO LvWUxF7isFvZ2hN5eg9wzKIpMdBUI0RBHPRoHSw+b+a1VnG3I/2816lBKak8/2IsOkyB asmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OrRLJ9Ls; 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 kr18-20020a0562142b9200b0065b21846028si2221864qvb.531.2023.10.20.13.55.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:55:59 -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=OrRLJ9Ls; 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 1qtwP4-00023p-RA; Fri, 20 Oct 2023 16:47:30 -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 1qtwP3-000234-01 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:29 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwP1-0001E6-Ee for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:28 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6bd96cfb99cso1114471b3a.2 for ; Fri, 20 Oct 2023 13:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834846; x=1698439646; 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=5v0gDw2hca7aeL8Edx367HZb46Y2K4iTJAYsw/i0ri0=; b=OrRLJ9LsKsAbcd+zobt+lUH1GAWYJe+V5y059G4e8S8wykP3tW80Sc+47Vff/L/AIw CHNFhFEVDu193ECCWp3hs1aHUcBR40J9Nkldmt1/JFm8wqDyWVOObpZ5dyjeHfYbxB2E +D28kdn1KX2cj3C6uwbNB+5yTMyS4wnI2gHrVFgzBz4j6gPoy9vFkyfcTlfMvBHnnSGk IuOJa3PKfIfIZWAHWzb90qRA5JntQZYDxY++4T331TEa/HBTRGf+BRY+AHGe4tONzZe+ g+8os+0wAmwcJYcsvplveOKAAi6d/sAQAoLCXVIriLBdsE1rHU/xnRyN66KIwKahDfoi OXHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834846; x=1698439646; 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=5v0gDw2hca7aeL8Edx367HZb46Y2K4iTJAYsw/i0ri0=; b=Ws2xFwYbwgDyC3rdq+IMCLS9jfRgfPlFRItV6R9xBz4y7fC86kPdVUrXkYCxC0Ixyy +LoRM8lG5XTrkiaeWAwAfDaG9PRfBwKkITqbqeLzYiOjuH7ywXOCrfmA6yq6ttkM8EiE LU9AQ3M6lSlfFUjgNFvVMk9Fbl48dMDh2sXwkz2gMevjmrefG7vufOY5grx8En1Y262r b6YUrQsUa/FhJs2EWLVy2qy7tvqM9BEGfue4CQMpTu4ma/Ba4LIQelibgryBCYl72/JC JsL0agXpz+0x9vP1/83lQZeDVJyz9qNcRM17/LVgPdTk4SW+kO5jNcHY+As1TNEA9IOW 94mA== X-Gm-Message-State: AOJu0YxO9j+xGz/UDqRHhDx9lvkMRWZg2Bo0vpXxNATiwqpmofATCUlX 1GGRl/h7lnkT5Se3dqoCt8QhdItgP8w4V4hDJNg= X-Received: by 2002:a05:6a21:3b4a:b0:14c:d494:77c3 with SMTP id zy10-20020a056a213b4a00b0014cd49477c3mr2963136pzb.33.1697834846222; Fri, 20 Oct 2023 13:47:26 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 61/65] target/hppa: Return zero for r0 from load_gpr Date: Fri, 20 Oct 2023 13:43:27 -0700 Message-Id: <20231020204331.139847-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/hppa/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 9b60924057..ce2aff8c4e 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -307,9 +307,7 @@ static void cond_free(DisasCond *cond) static TCGv_i64 load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { - TCGv_i64 t = tcg_temp_new_i64(); - tcg_gen_movi_i64(t, 0); - return t; + return ctx->zero; } else { return cpu_gr[reg]; } From patchwork Fri Oct 20 20:43:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736342 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503653wrl; Fri, 20 Oct 2023 13:54:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwqAj+iR7qylogByuCi1uuXjrdiHWiYkM9YBovwhIt80oYTCEpDUDuS+afvrBjMn4mg8EV X-Received: by 2002:a05:620a:6015:b0:777:18d4:818e with SMTP id dw21-20020a05620a601500b0077718d4818emr2913654qkb.72.1697835262364; Fri, 20 Oct 2023 13:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835262; cv=none; d=google.com; s=arc-20160816; b=L/pYb3+Zp1A3uH7PY+QfN12uP04yIyU7Cw32AbTCiyYcCDDEQYo/G+ob9BlHtAteOO oW1XMgwD293OwmMTZxr1L4O0DUXUPmEYKU83zIkNry+Z+XVz5OOPlP0/aZSVNsPctxnl s3t03TaWjtL4HeXKj8veORBY+D+TKxeSh3Vkg/JrrxbrvpBLt4e0ewbA9Qw+9YfHgpuo uaU9ypHH53rhP9k3kOyjzSoq33zrC0j6fPhrdh5Z0ThQ2o2BLHabTEVC5fmYvnlh9GnF qY/UCM7ra0PDyiVYwNRIPG1rvLkcRpTXQkZDGHefw/k13AQBrGY+/SewcSl/2Gmhfq7o 8YHw== 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=EaDJt/aWXDXMzB/5b+cw749X5lfpuA3DGgkyKvYHvVQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=UEO+BDf6oXEqTNqaA60jaiS/BwegyGDWRwwL5m55+uq5+LfIewFR6cnJJExkMyKzz4 CSi4ASRRC6xVbW6e7zEHhXBDlm0/Ch58HeUBALfEaXYiMBt3B9jMyA9lCgfTr5WBdcA9 /v7FotOR8zkjvNZw5yDSsi8ZuKSlWBB3QWVmFcaMN18rfPi0Hi6DX5qLhKLdgyB7rx+X jRz31AsF++GWlMVWlCMk+oLaVw0ASPzUNX+o8nyL6/CmqtE7vd0mF3wxe0xV5YZqMjBc RbCk8chU3Xa8YOZegkMeeQO+Vv2jovt8Ud8xVLOa/z5TfPHFZJ1YQXGttDLENhdLe1dz F8Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dIXwHgAR; 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 bs17-20020a05620a471100b00773fa71cbb8si1995031qkb.512.2023.10.20.13.54.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:22 -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=dIXwHgAR; 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 1qtwP6-000250-H5; Fri, 20 Oct 2023 16:47:32 -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 1qtwP4-00023T-0C for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:30 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwP2-0001EK-B1 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:29 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6be840283ceso1162851b3a.3 for ; Fri, 20 Oct 2023 13:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834847; x=1698439647; 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=EaDJt/aWXDXMzB/5b+cw749X5lfpuA3DGgkyKvYHvVQ=; b=dIXwHgAR/3biY/wFcJ9VOGfU74MqbElexA86Mhc3l/9YaXzt/EMVX9mlku91fKOto/ h/1BucG3Vyd2AYrgaEWEvqKsziglpqTJpwaJagrnjEhnxr9/ZsLi/6CgIMpuTIEDU+bx 0g3qMpq4/0t41oWixOnMKLMwkzqeL/9lOp09PAV2FdC8avjTnlJu6qmahEB8hsfIGqCT K641fuFUl44aO2l8pDmvkwfYuNKqRHs7JTtkip6aLBmzmlzKOQwgcSBZyIDx8bshJlii sGw0RT0SubmNP026taTah3BbvdGpTdn/EeivrqXlOwuDkts2pSPCjc0MgG5hbLGhoew5 9A2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834847; x=1698439647; 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=EaDJt/aWXDXMzB/5b+cw749X5lfpuA3DGgkyKvYHvVQ=; b=m1Lahxk4XVBqpo3c0Tzz2UEzA6LgPeukERylrZu5WdfQPIFAOz++cttCSf3ovfxSAJ 2Px3y1L3yzatyNjpAqKApfD88qI6WRjMLf8ZzBfAPUApZkncjZrlRxr8ryp50fU0NXew 3GTFlvJ1rpisy5bv/vKpK/r9BBVGS4WzJqo/UoUapLNtY921bR8hSwUzJmICaKvkNEiV 7kd7CrYAjUkkmw/A69KvDEytrD+PTXThwpia1Lv1JnTuE2QI21mZFYLvr1R3EQCvHpnD c6+klwKcnMiKCYOT26G4hzDSJ3yd4T4rH9IPQaeXhlygP+Jm4ZihV9yNZ7uhPnpTzkKl nhzg== X-Gm-Message-State: AOJu0YzuMTDKOpLqASVkhHW93QJBb99GyTsIka+cW4vX76XKA8vaWhdq UIZHOlHbnFdcfaH3iVAkmpCdgYp3v15ekJpjBjk= X-Received: by 2002:a05:6a20:918e:b0:179:f81b:12d9 with SMTP id v14-20020a056a20918e00b00179f81b12d9mr3089394pzd.11.1697834846982; Fri, 20 Oct 2023 13:47:26 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 62/65] target/hppa: Simplify trans_dep*_imm Date: Fri, 20 Oct 2023 13:43:28 -0700 Message-Id: <20231020204331.139847-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 All of the special cases here are now handled during generic expansion. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 80 +++++++++++++---------------------------- 1 file changed, 25 insertions(+), 55 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ce2aff8c4e..47cfb16738 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3473,80 +3473,50 @@ static bool trans_extr_imm(DisasContext *ctx, arg_extr_imm *a) return nullify_end(ctx); } -static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) +static bool do_dep_imm(DisasContext *ctx, unsigned rt, unsigned c, + bool d, unsigned len, unsigned cpos, + TCGv_i64 src, TCGv_i64 val) { - unsigned len, width; - uint64_t mask0, mask1; + unsigned width = d ? 64 : 32; TCGv_i64 dest; - if (!ctx->is_pa20 && a->d) { - return false; + if (cpos + len > width) { + len = width - cpos; } - if (a->c) { + + if (c) { nullify_over(ctx); } - len = a->len; - width = a->d ? 64 : 32; - if (a->cpos + len > width) { - len = width - a->cpos; - } + dest = dest_gpr(ctx, rt); + tcg_gen_deposit_i64(dest, src, val, cpos, len); + save_gpr(ctx, rt, dest); - dest = dest_gpr(ctx, a->t); - mask0 = deposit64(0, a->cpos, len, a->i); - mask1 = deposit64(-1, a->cpos, len, a->i); - - if (a->nz) { - TCGv_i64 src = load_gpr(ctx, a->t); - tcg_gen_andi_i64(dest, src, mask1); - tcg_gen_ori_i64(dest, dest, mask0); - } else { - tcg_gen_movi_i64(dest, mask0); - } - save_gpr(ctx, a->t, dest); - - /* Install the new nullification. */ cond_free(&ctx->null_cond); - if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); + if (c) { + ctx->null_cond = do_sed_cond(ctx, c, d, dest); } return nullify_end(ctx); } -static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) +static bool trans_depi_imm(DisasContext *ctx, arg_depi_imm *a) { - unsigned rs = a->nz ? a->t : 0; - unsigned len, width; - TCGv_i64 dest, val; - if (!ctx->is_pa20 && a->d) { return false; } - if (a->c) { - nullify_over(ctx); - } + return do_dep_imm(ctx, a->t, a->c, a->d, a->len, a->cpos, + a->nz ? load_gpr(ctx, a->t) : ctx->zero, + tcg_constant_i64(a->i)); +} - len = a->len; - width = a->d ? 64 : 32; - if (a->cpos + len > width) { - len = width - a->cpos; +static bool trans_dep_imm(DisasContext *ctx, arg_dep_imm *a) +{ + if (!ctx->is_pa20 && a->d) { + return false; } - - dest = dest_gpr(ctx, a->t); - val = load_gpr(ctx, a->r); - if (rs == 0) { - tcg_gen_deposit_z_i64(dest, val, a->cpos, len); - } else { - tcg_gen_deposit_i64(dest, cpu_gr[rs], val, a->cpos, len); - } - save_gpr(ctx, a->t, dest); - - /* Install the new nullification. */ - cond_free(&ctx->null_cond); - if (a->c) { - ctx->null_cond = do_sed_cond(ctx, a->c, a->d, dest); - } - return nullify_end(ctx); + return do_dep_imm(ctx, a->t, a->c, a->d, a->len, a->cpos, + a->nz ? load_gpr(ctx, a->t) : ctx->zero, + load_gpr(ctx, a->r)); } static bool do_dep_sar(DisasContext *ctx, unsigned rt, unsigned c, From patchwork Fri Oct 20 20:43:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736333 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp502935wrl; Fri, 20 Oct 2023 13:51:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsJrwI8B0/6sxDqKFM4zzT9IXLnXou8H3+dvd9FXZaKtsbuNfypRCfu/QHlA/xZeRSe1pR X-Received: by 2002:ac8:598a:0:b0:410:92ca:3dcd with SMTP id e10-20020ac8598a000000b0041092ca3dcdmr9524535qte.9.1697835103284; Fri, 20 Oct 2023 13:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835103; cv=none; d=google.com; s=arc-20160816; b=alayctmRhuPbsjnh1DnL8k9HJuAciRxQRGuwQ0TXYswOGwlAehe2EZ62LKnLhaUNR4 JniiZAodAYR5rQgzfrpfRpXoWo+sTiSvpQnbhVKKkmeRPMwSNASfv7QOqLzcOBjTeu9W 4LSOfJ8ypVDts3Hy7AdzmimLYYZC7KkJ533QyRR0py3mhFpbRtl2CteygILyVzIpQVMO 1giD062uzR19U/oy2lp+74Qunp09TvapslfVXvSjx+6WoHXlPNqTyiakaWOHGwENkuXh wzmE948YaRj9Umvihm8rRSOhWW0m38XHVvjGR8ZpMeZG6vDUqpkl/vgkCSL6uLv2yJ71 59jQ== 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=hkIbB3zmI08zQqo8JvI15EoPXprMPyQ2OgXzm/sTzaE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=S4mTOfnPE86MQadcAAW2gR55F4InbKl4PoEiKQgLuyHGZtFB9TkzKrGBH0D7d3/E+c H+hB6BY+T0aYAbY2N0/gBLoZyOA1QuvhazQlHPdLfuwKXouqmUPFc2QcdIRORToAl2TR rR5WWTDGhZIcccn0a6WeJqPTig/CPpGXCMaGntMa9MsKtsi5GlNMBCK3ltycUBqctn28 qwfi/YhRNw1FCZ/WaktwsbzzJuAO3U2wB/HNQoeRTxO+NS9WU78mQGIKKKJueKiYiBhf aaJ1wc2DVHVVuuTVYMBrsr9LTbPKRu6/mV62xCKbdoiSB/Q7iBrJMNNREFT8vuMf/2M8 CK0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YgzFjKpz; 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 10-20020ac84e8a000000b0041819b16cf3si1895128qtp.27.2023.10.20.13.51.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:51:43 -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=YgzFjKpz; 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 1qtwPY-0002O6-Nj; Fri, 20 Oct 2023 16:48:00 -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 1qtwPI-0002IK-LY for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:48 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwP3-0001EQ-3w for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:41 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6bf03b98b9bso1507152b3a.1 for ; Fri, 20 Oct 2023 13:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834847; x=1698439647; 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=hkIbB3zmI08zQqo8JvI15EoPXprMPyQ2OgXzm/sTzaE=; b=YgzFjKpzx9qaaY4kgnyLh0p1qxddSikeSGexGxeFWVG+kFsdBrj1/QLVXWH15wNHIq fIyoSMIF6UJR3FBKfAH+F7Z6w94XrpQ7PnbuZfXMaOPEbyujyn87F8cXKs6C1MD5PSfo ei8iebG9+Bv/9Qcb5ca0Ws2GZsD1IjTcv6LUSW1j/aZMYk+kqjwmBVDgejmYcttG0kXa NFZjsZReTuvAIQ3x7a08bpzOxB2hU4aLii28gp3/XsRwRRpFDbINC30scX/b+LDq4Ja0 8kHmrKn8QtUyMvFLNy9n299FP/RXBRJSJlgdqzi10l8YUYEvDvwrj9DbdqHJw29kwNYm REiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834847; x=1698439647; 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=hkIbB3zmI08zQqo8JvI15EoPXprMPyQ2OgXzm/sTzaE=; b=wZVP/OpBePFTL77dEBA6pBQWvOJFNBHlqyov5OZFAWyLai5NAUNaSdsts+gxk1Hfbj BTH78iW6pl16wP4gpVaROR3WCCOckXyMvuBQkjODoYS6w2s5pRxEdQ/QjV0pEV7ZnTGa X/vzhbgzZWWzhfxdYqBEKotrjO1d/ogFznoCc5F8AoOO8uE9O2i9eY24xRUlD7OF2gxR tGmJkwn5fzGqkg8Yf6d6amZzdtLauLxCRe5BYcGjp06ffzRrCsQdRToPoBxnamKF/J36 yPoNK8CtY4v2TrXjhL2lFMEY39sb+vsbpOoDXjsCa7N5WTLMKWODJYbEog6RVtjGr22x PX7w== X-Gm-Message-State: AOJu0Yzmq49NlNRR3xLGEGM5tTVFhAvYo7+1o6j0NckrEDWoNaaRjAhK Pjx8GH/7DkEWxgS4lTSwhHbiIp1nrnH7L/Zl6as= X-Received: by 2002:a05:6a20:7f8e:b0:14d:e615:277c with SMTP id d14-20020a056a207f8e00b0014de615277cmr4756602pzj.11.1697834847658; Fri, 20 Oct 2023 13:47:27 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 63/65] include/hw/elf: Remove truncating signed casts Date: Fri, 20 Oct 2023 13:43:29 -0700 Message-Id: <20231020204331.139847-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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 There's nothing about elf that specifically requires signed vs unsigned. This is very much a target-specific preference. In the meantime, casting low and high from uint64_t back to Elf_SWord to uint64_t discards high bits that might have been set by translate_fn. Signed-off-by: Richard Henderson --- include/hw/elf_ops.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index dffb0e73d2..0a5c258fe6 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -385,10 +385,11 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, } if (pflags) { - *pflags = (elf_word)ehdr.e_flags; + *pflags = ehdr.e_flags; + } + if (pentry) { + *pentry = ehdr.e_entry; } - if (pentry) - *pentry = (uint64_t)(elf_sword)ehdr.e_entry; glue(load_symbols, SZ)(&ehdr, fd, must_swab, clear_lsb, sym_cb); @@ -610,10 +611,12 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, } } - if (lowaddr) - *lowaddr = (uint64_t)(elf_sword)low; - if (highaddr) - *highaddr = (uint64_t)(elf_sword)high; + if (lowaddr) { + *lowaddr = low; + } + if (highaddr) { + *highaddr = high; + } ret = total_size; fail: if (mapped_file) { From patchwork Fri Oct 20 20:43:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736349 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503811wrl; Fri, 20 Oct 2023 13:54:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZLh9M8byf37ruC0fRDriIc1DZi0I+8wGYkkiENruX/vNwPpNtuY59BEFZziekX6w7GK/E X-Received: by 2002:a05:6214:21ed:b0:66d:1b4c:e867 with SMTP id p13-20020a05621421ed00b0066d1b4ce867mr3180136qvj.45.1697835291736; Fri, 20 Oct 2023 13:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835291; cv=none; d=google.com; s=arc-20160816; b=Rh9ybyALnjkb7TBCDA8kFYmvT+dvuSR4/aMgZ77OrdSBCdqMxLdzRJ40qtIl/ZxJPt +whhoQngvdODwQFPv13BQCTrn/eah611+hvGFKU7zSA543/yRCHKX7erfFtQHlv5eyvf CdDZg/KO7/BYjH7Uh476iZSMRK/fNAU3gn0Yv0Qqlnw9WTqIsz5P1U1bP93vA7qfrJNF wwHFreFNFvScaB0u//QY3YgKECKGJvGUKx5/P/Seoeuf0hOS414V0pq6+/M4oNHhTqp/ 59QRkPw2vjJHr8e2OgOQaZCX+B4ndnp2tgogg8HIMDxtaVJLRu8DcVX94WWPVrjqvy4+ lW5Q== 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=3YpfUmyUa6m05sFckuJpc1CvhipgVeCi72arXwnoozE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ZqNVrivFchpHxaCXgJHv4Qe+buIzLhCuOd3ekJVddZjZZ2ZRdt/6gy9Yxcxqh+W09/ A+J/RbwR4z/QeXMk30ylOeKWXvL0eT3a1VItXL85uux9zWbGK/xKVcPY9YZrt6njOmdK 3avUeRT8buBhanHI6mFl6EfC66lkKcQaq0i775yjqeh13MZP3ma1O85n200eJ32Bj9A1 ut0zGZgJOs3RL/TOrhjHzuSuoPfNq6GcgNU7w5tJCn+9dNlm+rmXRUE96VqGWMuYB95X PztFAFY/UvnyNXgyvJrilnvY4VyILe547L9falbG3bh3ibWF8lcB0l8w8LuA7QZ5FZX9 jItA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c2sAHm9L; 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 u37-20020a05622a19a500b0041986eba0c3si1911915qtc.350.2023.10.20.13.54.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54: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=c2sAHm9L; 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 1qtwP9-00028e-W6; Fri, 20 Oct 2023 16:47:36 -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 1qtwP6-00024o-2Q for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:32 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwP3-0001Ef-Sb for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:31 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b201a93c9cso1117461b3a.0 for ; Fri, 20 Oct 2023 13:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834848; x=1698439648; 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=3YpfUmyUa6m05sFckuJpc1CvhipgVeCi72arXwnoozE=; b=c2sAHm9LspCn4deFQhICb7m7ekTtEpOKxqcKiy/b6AYyo/2jPOQU70yV8LDR+vXFC3 SmY3LbcSyzWL8uCaezLMZtsZ47UCoCu6pSPISxeF/htx/HzQWs/dEkjE6rRhC0bpsXdD jJgeYsJGCkujNHcBPrcxvkhftv5GjO7vV7lJqmegGds+jeZj/qLlLLsYfG5o6T9LMz7q a28VsUmiizaReN3b5drBNQkpjQw2VKchkSTvEfEwKbjo/FeiBr/mt+P5+4iMC8jOyh+5 Si7gcs5PqWLVVTqlu8XZcKRHf6AwXF2GBCXinKf8OCnWQJ6SC4LItxeHdC0fvptgfvVP BMAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834848; x=1698439648; 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=3YpfUmyUa6m05sFckuJpc1CvhipgVeCi72arXwnoozE=; b=Fz9pypLLucFNt9bAVjLpIT48gwcWwqn68Ct6xb/9Aqn7FwtecmcpUi4Dk24KX0bft1 EB2AC0Y7HpChz2/9qvypgXIOe7xPmohPC9t4FVlU8BuOZqROz7+nc7jOhIYLZWhCvlK/ /Bkmlf8uABm8y+LLpwjCmrrlaIlf2p81SkYyz+rHyz9lXEJmxEku4lee50OHWLFQRcoK zrxO2tqQQY6NlNRDpBJ8i48niModHvd8PQpK99m3tS7AEsoMlAoVaxkK6VmPpyBoxH6v Tro8l+tfjNzhj/OUEQsGqkjucAwdJi1IrsNgY3cjuGDa2CNraKUOg/ZgLhXvNtLRj3LJ SuzA== X-Gm-Message-State: AOJu0YzHsBiao279BQirN7rzK8CRVq4BAab+BuVPihpzNkXNq5nCwnPT Nz/YpCjH3zJ5/vVHJtqmrMNthBOgI5u1tOeitcA= X-Received: by 2002:a05:6a20:3ca8:b0:179:f858:784d with SMTP id b40-20020a056a203ca800b00179f858784dmr3237205pzj.21.1697834848419; Fri, 20 Oct 2023 13:47:28 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 64/65] hw/hppa: Translate phys addresses for the cpu Date: Fri, 20 Oct 2023 13:43:30 -0700 Message-Id: <20231020204331.139847-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 Hack the machine to use pa2.0 physical layout when required, using the PSW.W=0 absolute to physical mapping. Signed-off-by: Richard Henderson --- hw/hppa/machine.c | 117 ++++++++++++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 46 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 1f09b4b490..43c7afb89d 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -87,7 +87,7 @@ static const MemoryRegionOps hppa_pci_ignore_ops = { }, }; -static ISABus *hppa_isa_bus(void) +static ISABus *hppa_isa_bus(hwaddr addr) { ISABus *isa_bus; qemu_irq *isa_irqs; @@ -96,8 +96,7 @@ static ISABus *hppa_isa_bus(void) isa_region = g_new(MemoryRegion, 1); memory_region_init_io(isa_region, NULL, &hppa_pci_ignore_ops, NULL, "isa-io", 0x800); - memory_region_add_subregion(get_system_memory(), IDE_HPA, - isa_region); + memory_region_add_subregion(get_system_memory(), addr, isa_region); isa_bus = isa_bus_new(NULL, get_system_memory(), isa_region, &error_abort); @@ -163,13 +162,24 @@ static const MemoryRegionOps hppa_io_helper_ops = { }, }; +typedef uint64_t TranslateFn(void *opaque, uint64_t addr); -static uint64_t cpu_hppa_to_phys(void *opaque, uint64_t addr) +static uint64_t linux_kernel_virt_to_phys(void *opaque, uint64_t addr) { addr &= (0x10000000 - 1); return addr; } +static uint64_t translate_pa10(void *dummy, uint64_t addr) +{ + return (uint32_t)addr; +} + +static uint64_t translate_pa20(void *dummy, uint64_t addr) +{ + return hppa_abs_to_phys_pa2_w0(addr); +} + static HPPACPU *cpu[HPPA_MAX_CPUS]; static uint64_t firmware_entry; @@ -179,7 +189,8 @@ static void fw_cfg_boot_set(void *opaque, const char *boot_device, fw_cfg_modify_i16(opaque, FW_CFG_BOOT_DEVICE, boot_device[0]); } -static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus) +static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus, + hwaddr addr) { FWCfgState *fw_cfg; uint64_t val; @@ -188,7 +199,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus) int btlb_entries = HPPA_BTLB_ENTRIES(&cpu[0]->env); int len; - fw_cfg = fw_cfg_init_mem(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4); + fw_cfg = fw_cfg_init_mem(addr, addr + 4); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size); @@ -258,32 +269,45 @@ static DinoState *dino_init(MemoryRegion *addr_space) /* * Step 1: Create CPUs and Memory */ -static void machine_HP_common_init_cpus(MachineState *machine) +static TranslateFn *machine_HP_common_init_cpus(MachineState *machine) { MemoryRegion *addr_space = get_system_memory(); - MemoryRegion *cpu_region; - long i; unsigned int smp_cpus = machine->smp.cpus; - char *name; + TranslateFn *translate; + MemoryRegion *cpu_region; /* Create CPUs. */ - for (i = 0; i < smp_cpus; i++) { - name = g_strdup_printf("cpu%ld-io-eir", i); + for (unsigned int i = 0; i < smp_cpus; i++) { cpu[i] = HPPA_CPU(cpu_create(machine->cpu_type)); + } + + /* + * For now, treat address layout as if PSW_W is clear. + * TODO: create a proper hppa64 board model and load elf64 firmware. + */ + if (hppa_is_pa20(&cpu[0]->env)) { + translate = translate_pa20; + } else { + translate = translate_pa10; + } + + for (unsigned int i = 0; i < smp_cpus; i++) { + g_autofree char *name = g_strdup_printf("cpu%u-io-eir", i); cpu_region = g_new(MemoryRegion, 1); memory_region_init_io(cpu_region, OBJECT(cpu[i]), &hppa_io_eir_ops, cpu[i], name, 4); - memory_region_add_subregion(addr_space, CPU_HPA + i * 0x1000, + memory_region_add_subregion(addr_space, + translate(NULL, CPU_HPA + i * 0x1000), cpu_region); - g_free(name); } /* RTC and DebugOutputPort on CPU #0 */ cpu_region = g_new(MemoryRegion, 1); memory_region_init_io(cpu_region, OBJECT(cpu[0]), &hppa_io_helper_ops, cpu[0], "cpu0-io-rtc", 2 * sizeof(uint64_t)); - memory_region_add_subregion(addr_space, CPU_HPA + 16, cpu_region); + memory_region_add_subregion(addr_space, translate(NULL, CPU_HPA + 16), + cpu_region); /* Main memory region. */ if (machine->ram_size > 3 * GiB) { @@ -291,12 +315,15 @@ static void machine_HP_common_init_cpus(MachineState *machine) exit(EXIT_FAILURE); } memory_region_add_subregion_overlap(addr_space, 0, machine->ram, -1); + + return translate; } /* * Last creation step: Add SCSI discs, NICs, graphics & load firmware */ -static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) +static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, + TranslateFn *translate) { const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; @@ -324,13 +351,13 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) dev = qdev_new("artist"); s = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, LASI_GFX_HPA); - sysbus_mmio_map(s, 1, ARTIST_FB_ADDR); + sysbus_mmio_map(s, 0, translate(NULL, LASI_GFX_HPA)); + sysbus_mmio_map(s, 1, translate(NULL, ARTIST_FB_ADDR)); } /* Network setup. */ if (enable_lasi_lan()) { - lasi_82596_init(addr_space, LASI_LAN_HPA, + lasi_82596_init(addr_space, translate(NULL, LASI_LAN_HPA), qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA)); } @@ -374,7 +401,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) qemu_register_powerdown_notifier(&hppa_system_powerdown_notifier); /* fw_cfg configuration interface */ - create_fw_cfg(machine, pci_bus); + create_fw_cfg(machine, pci_bus, translate(NULL, FW_CFG_IO_BASE)); /* Load firmware. Given that this is not "real" firmware, but one explicitly written for the emulation, we might as @@ -386,15 +413,10 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) exit(1); } - size = load_elf(firmware_filename, NULL, NULL, NULL, + size = load_elf(firmware_filename, NULL, translate, NULL, &firmware_entry, &firmware_low, &firmware_high, NULL, true, EM_PARISC, 0, 0); - /* Unfortunately, load_elf sign-extends reading elf32. */ - firmware_entry = (uint32_t)firmware_entry; - firmware_low = (uint32_t)firmware_low; - firmware_high = (uint32_t)firmware_high; - if (size < 0) { error_report("could not load firmware '%s'", firmware_filename); exit(1); @@ -402,7 +424,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) qemu_log_mask(CPU_LOG_PAGE, "Firmware loaded at 0x%08" PRIx64 "-0x%08" PRIx64 ", entry at 0x%08" PRIx64 ".\n", firmware_low, firmware_high, firmware_entry); - if (firmware_low < FIRMWARE_START || firmware_high >= FIRMWARE_END) { + if (firmware_low < translate(NULL, FIRMWARE_START) || + firmware_high >= translate(NULL, FIRMWARE_END)) { error_report("Firmware overlaps with memory or IO space"); exit(1); } @@ -411,18 +434,16 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus) rom_region = g_new(MemoryRegion, 1); memory_region_init_ram(rom_region, NULL, "firmware", (FIRMWARE_END - FIRMWARE_START), &error_fatal); - memory_region_add_subregion(addr_space, FIRMWARE_START, rom_region); + memory_region_add_subregion(addr_space, + translate(NULL, FIRMWARE_START), rom_region); /* Load kernel */ if (kernel_filename) { - size = load_elf(kernel_filename, NULL, &cpu_hppa_to_phys, + size = load_elf(kernel_filename, NULL, linux_kernel_virt_to_phys, NULL, &kernel_entry, &kernel_low, &kernel_high, NULL, true, EM_PARISC, 0, 0); - /* Unfortunately, load_elf sign-extends reading elf32. */ - kernel_entry = (uint32_t) cpu_hppa_to_phys(NULL, kernel_entry); - kernel_low = (uint32_t)kernel_low; - kernel_high = (uint32_t)kernel_high; + kernel_entry = linux_kernel_virt_to_phys(NULL, kernel_entry); if (size < 0) { error_report("could not load kernel '%s'", kernel_filename); @@ -500,41 +521,42 @@ static void machine_HP_B160L_init(MachineState *machine) { DeviceState *dev, *dino_dev; MemoryRegion *addr_space = get_system_memory(); + TranslateFn *translate; ISABus *isa_bus; PCIBus *pci_bus; /* Create CPUs and RAM. */ - machine_HP_common_init_cpus(machine); + translate = machine_HP_common_init_cpus(machine); /* Init Lasi chip */ lasi_dev = DEVICE(lasi_init()); - memory_region_add_subregion(addr_space, LASI_HPA, + memory_region_add_subregion(addr_space, translate(NULL, LASI_HPA), sysbus_mmio_get_region( SYS_BUS_DEVICE(lasi_dev), 0)); /* Init Dino (PCI host bus chip). */ dino_dev = DEVICE(dino_init(addr_space)); - memory_region_add_subregion(addr_space, DINO_HPA, + memory_region_add_subregion(addr_space, translate(NULL, DINO_HPA), sysbus_mmio_get_region( SYS_BUS_DEVICE(dino_dev), 0)); pci_bus = PCI_BUS(qdev_get_child_bus(dino_dev, "pci")); assert(pci_bus); /* Create ISA bus, needed for PS/2 kbd/mouse port emulation */ - isa_bus = hppa_isa_bus(); + isa_bus = hppa_isa_bus(translate(NULL, IDE_HPA)); assert(isa_bus); /* Serial ports: Lasi and Dino use a 7.272727 MHz clock. */ - serial_mm_init(addr_space, LASI_UART_HPA + 0x800, 0, + serial_mm_init(addr_space, translate(NULL, LASI_UART_HPA + 0x800), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_UART_HPA), 7272727 / 16, serial_hd(0), DEVICE_BIG_ENDIAN); - serial_mm_init(addr_space, DINO_UART_HPA + 0x800, 0, + serial_mm_init(addr_space, translate(NULL, DINO_UART_HPA + 0x800), 0, qdev_get_gpio_in(dino_dev, DINO_IRQ_RS232INT), 7272727 / 16, serial_hd(1), DEVICE_BIG_ENDIAN); /* Parallel port */ - parallel_mm_init(addr_space, LASI_LPT_HPA + 0x800, 0, + parallel_mm_init(addr_space, translate(NULL, LASI_LPT_HPA + 0x800), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA), parallel_hds[0]); @@ -543,15 +565,17 @@ static void machine_HP_B160L_init(MachineState *machine) sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_PS2KBD_HPA)); - memory_region_add_subregion(addr_space, LASI_PS2KBD_HPA, + memory_region_add_subregion(addr_space, + translate(NULL, LASI_PS2KBD_HPA), sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0)); - memory_region_add_subregion(addr_space, LASI_PS2KBD_HPA + 0x100, + memory_region_add_subregion(addr_space, + translate(NULL, LASI_PS2KBD_HPA + 0x100), sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1)); /* Add SCSI discs, NICs, graphics & load firmware */ - machine_HP_common_init_tail(machine, pci_bus); + machine_HP_common_init_tail(machine, pci_bus, translate); } static AstroState *astro_init(void) @@ -573,21 +597,22 @@ static void machine_HP_C3700_init(MachineState *machine) AstroState *astro; DeviceState *astro_dev; MemoryRegion *addr_space = get_system_memory(); + TranslateFn *translate; /* Create CPUs and RAM. */ - machine_HP_common_init_cpus(machine); + translate = machine_HP_common_init_cpus(machine); /* Init Astro and the Elroys (PCI host bus chips). */ astro = astro_init(); astro_dev = DEVICE(astro); - memory_region_add_subregion(addr_space, ASTRO_HPA, + memory_region_add_subregion(addr_space, translate(NULL, ASTRO_HPA), sysbus_mmio_get_region( SYS_BUS_DEVICE(astro_dev), 0)); pci_bus = PCI_BUS(qdev_get_child_bus(DEVICE(astro->elroy[0]), "pci")); assert(pci_bus); /* Add SCSI discs, NICs, graphics & load firmware */ - machine_HP_common_init_tail(machine, pci_bus); + machine_HP_common_init_tail(machine, pci_bus, translate); } static void hppa_machine_reset(MachineState *ms, ShutdownCause reason) From patchwork Fri Oct 20 20:43:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736346 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503763wrl; Fri, 20 Oct 2023 13:54:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKnT7Tmls25wexQwqsnOEJZ8AzQcOicIKdWfAdvvmXnjvZsGFtX0vi9+jvFQCk82zFucpq X-Received: by 2002:ad4:5ccf:0:b0:66d:6919:7bf7 with SMTP id iu15-20020ad45ccf000000b0066d69197bf7mr3160365qvb.27.1697835284228; Fri, 20 Oct 2023 13:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835284; cv=none; d=google.com; s=arc-20160816; b=gRc9W6xeLsUnX1o0kFlss8nH6+p6U1rGDgCd7HP/iPQUHL7s+yDQVnIrmo/5fu5Z+L ojJwk99TRtMkvlxATWBFJTzTtAJQ51rvoGwODI3aaqvNO2hFofHbBZGBrT0X01fp26JF nZ4YKsSA92d7Ib7/kt9psAer8ROZz3CoUsq/3YQyY1qOfMEbvk9eWHUUvpDTFGKVg/9B 0JOd9vSUKKbyRxIwJyamg8nlSQYRM2Yys6N1pTejW4+ZtkLmx40dwiEIfMOUb7u/kOum GUYa14EbtWVZwu4JDDK5ojxvle30v6UF1JWfnIucZ1XEJrG647qhIIpHzP1vumrZlgdM qJyg== 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=hES6yVQ0/11qdrvyqhHvx3Mqj7cvamUGm715KS/hVjU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=LwAzLuRyYbB4DGEug6Yp8l+M4kL25kl9OcNiDP3bqG5ezf/Uv17iuHkVOdveciyN3Y zlLpuwRSzo20krRiXYllZEMAzQMIAxxfZxc7kdXrwmJiWyJrjrz++k3P3c4R7R84GfJ9 LxeMVGzPoNtLHwbyhCP8oNH5/KUiFW7w+7BgMO3j8IPQHBqwVuSWyMiYiwarSzRrM3eJ ETYpLeUSGoNTKxsHwaS4vWLQV/TmeDLAKdjet0TDwoh44QQcPZ/NmwAYr8acPC4E5rqZ C+oGgSoK5uKOWK9SQg/AruePTRLoMMv4rxPyYhp69LTgs4WjFjDJeWB8EVnyMwonQQ16 qMlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BFp2Elu+; 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 d1-20020a05620a240100b00773d32bc746si1968901qkn.401.2023.10.20.13.54.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:44 -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=BFp2Elu+; 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 1qtwP9-00028E-LW; Fri, 20 Oct 2023 16:47:35 -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 1qtwP5-00024j-Sf for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:31 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwP4-0001El-Dc for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:31 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b1ef786b7fso1160542b3a.3 for ; Fri, 20 Oct 2023 13:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834849; x=1698439649; 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=hES6yVQ0/11qdrvyqhHvx3Mqj7cvamUGm715KS/hVjU=; b=BFp2Elu+kkiM6mPMqNX9M9WL6O6bv+RQ5ws2DX/Ecb8b5GAWO7wAthwra7U9AJdGUh E6lhL1bgk+BtlNTPnDelQYaM+MwTEf8CV/sJWSwIQCBJD7AUKwKXdwCdRQ4JZszPgng+ laMpcZYkSPfmXdFuNDdw+xH/qzvy1RD1O0lsfwYwKzxyKeY0Tz4Bo4RQDoJYBwRYI4fj tFlvWcUwyHP/E9luL3cRWALgtvELS6k63D9jKARpYRr+aQVOOa8H4jedZz29tI2vw+zi WjaKM4n5sdRMCBxgN2MZd3NzaIyqxcCF5pP2Z+A90rhwigzI0mTJ9lmpQgjXl/jT1/+t DLkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834849; x=1698439649; 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=hES6yVQ0/11qdrvyqhHvx3Mqj7cvamUGm715KS/hVjU=; b=FziQzKzMYXv1P4xlGkYsFuRIWeGgi03xiTo8JfCN3AOo27wYSxoGQTXITwC2TUjoSo 3xqrC7xN49ce/qQz75xEuiyLaRnfAwrifCTUTsFddHDasvVnG3TVQ07TSE2E8l4McwoJ zFhftCElGT7cgX6Vs800wcz6HbiNa9worTPuZtVeYlEc/bzpIZ8A3MiBky7RClI/iwmU fO7Tw7xgyEYsSy92ABVLqvYhh1bw1l/Y68iWwxOdM//vh4S4X/IabsI2g1NxX/9ppBzN sxvOV7h+qSIHGCDYtNtE4+WKCCh8s2SIL9UlG8k5qmQ0vjb+kq5pzR14Crnva+/7HxUw AIeg== X-Gm-Message-State: AOJu0YzyrX5bXy//zy3ZRMVym6ytlQaAb5P+LYszP9MCdp89IjObFjKa 3sklCorNnnsZuXeZIIwluAMlhNDKeXVk0wDdS8E= X-Received: by 2002:a05:6a00:24c5:b0:6bf:4cb1:e78 with SMTP id d5-20020a056a0024c500b006bf4cb10e78mr593535pfv.6.1697834849289; Fri, 20 Oct 2023 13:47:29 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 65/65] linux-user/hppa: Drop EXCP_DUMP from handled exceptions Date: Fri, 20 Oct 2023 13:43:31 -0700 Message-Id: <20231020204331.139847-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 Signed-off-by: Richard Henderson --- linux-user/hppa/cpu_loop.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 8ab1335106..d5232f37fe 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -147,12 +147,10 @@ void cpu_loop(CPUHPPAState *env) force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_MAPERR, env->iaoq_f); break; case EXCP_ILL: - EXCP_DUMP(env, "qemu: EXCP_ILL exception %#x\n", trapnr); force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->iaoq_f); break; case EXCP_PRIV_OPR: /* check for glibc ABORT_INSTRUCTION "iitlbp %r0,(%sr0, %r0)" */ - EXCP_DUMP(env, "qemu: EXCP_PRIV_OPR exception %#x\n", trapnr); if (env->cr[CR_IIR] == 0x04000000) { force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->iaoq_f); } else { @@ -160,7 +158,6 @@ void cpu_loop(CPUHPPAState *env) } break; case EXCP_PRIV_REG: - EXCP_DUMP(env, "qemu: EXCP_PRIV_REG exception %#x\n", trapnr); force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVREG, env->iaoq_f); break; case EXCP_OVERFLOW: @@ -173,7 +170,6 @@ void cpu_loop(CPUHPPAState *env) force_sig_fault(TARGET_SIGFPE, 0, env->iaoq_f); break; case EXCP_BREAK: - EXCP_DUMP(env, "qemu: EXCP_BREAK exception %#x\n", trapnr); force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->iaoq_f & ~3); break; case EXCP_DEBUG: