From patchwork Wed Oct 18 21:50: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: 735109 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226378wro; Wed, 18 Oct 2023 15:00:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEg/kNil1L5dMM+Qh5h/sbONWndYJ9JZEogClPr/LsyMIbhIMxtK771o57p6C9hbc4crG6l X-Received: by 2002:a05:6808:10cf:b0:3ac:4ee2:337b with SMTP id s15-20020a05680810cf00b003ac4ee2337bmr461123ois.51.1697666402173; Wed, 18 Oct 2023 15:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666402; cv=none; d=google.com; s=arc-20160816; b=KVKvHChmp/F1g8Sl4/Gy/gYfNkfSW2DjyiKuPsygLfWXvud4QC/DTTw0GJ80Nt/jNd A/6Obod5U7xdF9KCfVPiPxnsYlFWIgJY1vF7mUTs0fqcOX9tveNTsxaD0UVesseBVEcS mKCaij6MtWug4t3qJAhe5iW54/gWu86Y3NlnXWDrTG4I0174gft5PIijaDSvYEb+tYHO NKiVoJGYjcFkHWpA1ev3GdW52s4NIfaonjqJwBoFCFVqnusNC1GuF8OubU1W7Ya2PZ/R Nl1jKvQNUCtiQ3cUMjqt6l1xhrYf/KnnISmyw5paGgue0Xd29brHgtgzgaAgsGuKzLFK sMEw== 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=GOE4CUsFJnj1XRZ3AxbG5+vTWwEV/HTTngqjz2d7HOVi8EemrMpdtbKgWmUta3HUzE UJUguCL5mN2EVm3L9lAvZzfoB/ljf4mEvNibUElEkNpCesihZhwU06JZ0xgXvArdHvoW 233bQtSpyIYCyX/NqCLRIyEydidO6MvLAxGil9m5n/X7h+u9QrD6ntigRkrAf5MPRTbh IX8RuOjIHxIIg5jCpZW14zuzDhK8h2/pbQWxTxvmhgDdnxBtAHQuRRpcsOkZtF+5LuJZ pTSGdWoZvbjpPZJrVrhjOQWOfaUTHhbHEAqhagVFMo9Z4fyg84urJg+wGuny7puSKEut 01Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C0pxWsAM; 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 l12-20020a0ce84c000000b0066d854ccbe4si637205qvo.449.2023.10.18.15.00.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:00: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=C0pxWsAM; 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 1qtESA-0000rL-9e; Wed, 18 Oct 2023 17:51:46 -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 1qtES5-0000it-Tb for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:42 -0400 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtES3-0004Mi-Lq for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:41 -0400 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-57b5f0d658dso4275582eaf.0 for ; Wed, 18 Oct 2023 14:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665897; x=1698270697; 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=C0pxWsAMx0xMZpriRBPtpt6F2xoLOTokrT6GVDvIDnBJcoURHZ7yAUnTBBX79trORM Bk1g/ipdxpGsHABeH7Dof5Mmh9kBKngf+kTNrm9rQoMVL8yHOuUpyNpGsxdO2qaNHrdv 96l1bE8MFoRfoh888c+I5xp36hQ/heASfihyWapdsaW/z6oBkqoaMfdcFLGjHgbqOrlA D3PHGszWTYnBtaBO/axCBpD5xjhr8lAZJKQO3kNXoFo9PtNwlq5Zqgelj6Y9uyIMGbzM r8WAVC3+aYtQj3SnoXr4FqOc5w0BkSQLg/wdoo289cnZJ/uTXQ6C2Sj5zWG49xqOo/0B A4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665897; x=1698270697; 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=FPsJE6SDDObhVToiaCRA6erm4A0zl13Rf+yhtACRt4lvMW+FVcg8+MezFHDxxGPhiU ggdGc1zsay1eD2o0PA6cBkZf5dZ4oxbqq0SqVJ16kypqzwMtICyKZVVc2e2tzzazZhSn lIr8e18LBMjOx1Ycsgf23jVc/vJP7noPzEBLOx2kRbpGU16h8PavrjhfvOh09O8EZTuK x49Hdd0I5UeIPYqVFYgm8xnfR9sUi8kx4hFX22u+97I8U+FWNPAyIEoF4UaxjEeW9t+Z JBrB9EQw5WQF9kBZvqJ3W6CCoeKHTaA6Oz6C0gLO2kuxaJxBFUkKK4OVi4TsiSJ9fLYk 6Bhg== X-Gm-Message-State: AOJu0YwVLQFn1BPvPjKsxTfOMKkbAOIsGvuHHgf3knfnEWUcyLMuY5JI 8kF9fuCJQcBMOMZScRvR+zxZMEc5fIb+itSOiio= X-Received: by 2002:a05:6359:d14:b0:14a:ddb8:9a12 with SMTP id gp20-20020a0563590d1400b0014addb89a12mr276183rwb.6.1697665897576; Wed, 18 Oct 2023 14:51:37 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 01/61] include/hw/elf: Remove truncating signed casts Date: Wed, 18 Oct 2023 14:50:35 -0700 Message-Id: <20231018215135.1561375-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2f; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2f.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 Wed Oct 18 21:50:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735078 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224559wro; Wed, 18 Oct 2023 14:53:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhB/nxr4cXnkN+q929FHuuW4ihwpisQd6jR1xb/i1RxAsK2syooHNCpe+eKlUtQYg3FGyF X-Received: by 2002:a05:620a:c4d:b0:778:8cce:dbf3 with SMTP id u13-20020a05620a0c4d00b007788ccedbf3mr456915qki.46.1697665993570; Wed, 18 Oct 2023 14:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697665993; cv=none; d=google.com; s=arc-20160816; b=C0VIcAG0fSsZkxyO7BHFWkLLLT6g5bsbpQ69ADJdVrKwMo3ACVdGpCWvwS+vFVvgEd G3Hk23EhjOeIsmhMD4NvQrUQknjGfJtvJJobrfqHIaaBMNP0pLBYX6TuxjOjfdm9SAw0 4roVjYoIqwKVKBTEx4gIkyjQBL+HzPFGjiJQNnEZcRZ4Ll1FDVToO9dfKU5kjsWre8UP bqHsffcLWPP6A3xPeUNOKi2Gxz24/cq+TSYOBPm+8261iIMToLnVpSExb2kFhr+tkOg8 CNwMnC+T7srBiTTY0SxeBOkjRibeHXi/OkCZy0BXTby8ZBk1NSSMzCZ393zhEK7SoEhP E8wA== 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=23RI/mW6AMfApntB6AZBjNSIoZLAv2J5xj2sb88apLg=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=B8i1PvgrUF5GK05YazOEhVmEfNjd07YT02cXvZFYwiVsYjTse03SXonCulvLjmRWya 4E3ayxYmxEsEvLqrdp/ZM29tKCFK2094dkWUeONbV6vkQ/GPC5QJopzpplWeE8mF4sik SRXKcPcFc7D3TCjF5IfUptzir2thVztaN6BCo4dRC4WcDoxMJdO/qTWCwRZAcc952jHo BfH0tOxhv7mMVagxk3rzU+BpeclI2euyaYyjB2h7un5obbLlRwSVdPIAq6WE5BU8Hjvu KO780TXXr85EbAmD7ujhxL1KLoHZ5380QNOX+MvIc1p10zdQt6ZZZT1DJ//1AZOUgvQs mwTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WXYP2C5I; 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 j10-20020a37c24a000000b007742c5c5584si575012qkm.465.2023.10.18.14.53.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:53: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=WXYP2C5I; 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 1qtESB-0000sR-2W; Wed, 18 Oct 2023 17:51:47 -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 1qtES7-0000jD-8c for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:43 -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 1qtES4-0004Mu-GO for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:43 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so4161605b3a.1 for ; Wed, 18 Oct 2023 14:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665898; x=1698270698; 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=23RI/mW6AMfApntB6AZBjNSIoZLAv2J5xj2sb88apLg=; b=WXYP2C5IlICDiz/j4nUrYJO4uyAYtK4VcJ/RzmXYxxxAyiaTOnZD34aNdQ0rdmFUaU TMB3g+D4XvTuQ+hyS2tUVzxuaJFbyb8T81QKdH+FTsejLhBGqL17i4gpKtWMkw7ESDLi weDHptqQgpXnYtMfhub8fbiiRZ4n+AUh1FZ7B+QLrvX0ApWVpm4//c1lxN+vz7zj74dp OJZ/diez8oknA4a7DIp3tIHXSr4PcBRXhFzaanSsExewBfKv1gANkRW+UsqUfDWw4utU 95dAJNs8x196fsITI6OwPkkfKXdcCwZUbQqF6MDecTmizXdBO947kskN1Txi3uvnR37z R4jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665898; x=1698270698; 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=23RI/mW6AMfApntB6AZBjNSIoZLAv2J5xj2sb88apLg=; b=wgOotSeSuo2W+SPpeqgmtihhnNeFX6dnhwls/lx0AhhIAkQE2bmVaJKJYcVaC8pw+g i83nZRfKFH5i5HmHdMnd3hKuI1RjA/y/ajKzJyoQN/ZzczAuTMVyg+A4sAgLdKBsJiMx V7KLichYmefgosp4xQcX6k/0vQmxLrexO5oJRx/+UZY9j/AmlOyLgs7SgWkl3uTmst6v IdJpWl71GH3zHKI+iagu8AQqqhnTpOcstFA013yWXKI2p+kCMvDcqwXr9YSAjhQL9h/E PXVD9CBbvT+7bSTIXGHpiilP73OvRCN1RoELjXVqivutzY2S0O/BmJpVcriJNKYQbtnB 8kuQ== X-Gm-Message-State: AOJu0YxM7pLJmgYI5wG5n+6Fnneq/w2jDcosX5fEuX5Jr1qIf1WsDbhN 4u7h/6BJaN1QhucElRNaZCrkyJxNWQ9GDbSN9yU= X-Received: by 2002:a05:6a00:1827:b0:690:d620:7804 with SMTP id y39-20020a056a00182700b00690d6207804mr407896pfa.13.1697665898520; Wed, 18 Oct 2023 14:51:38 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 02/61] target/hppa: Remove get_temp Date: Wed, 18 Oct 2023 14:50:36 -0700 Message-Id: <20231018215135.1561375-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 Replace with tcg_temp_new without recording into ctx. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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 Wed Oct 18 21:50:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735079 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224592wro; Wed, 18 Oct 2023 14:53:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnh2c67F369gMR8Hs93CW4PP7StgMFUrSzhRTPsBXR5Uz5TiNyhlfinEOn6dU6gAIcQUpj X-Received: by 2002:aca:90d:0:b0:3ad:f536:2f26 with SMTP id 13-20020aca090d000000b003adf5362f26mr454301oij.18.1697666002103; Wed, 18 Oct 2023 14:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666002; cv=none; d=google.com; s=arc-20160816; b=WkJBauNt92iGw6T7YJL1vsQppjHZR0NmAa2e4Gk1+yqaeVVJZW9QHzi+4tG9Og9oMj F1ki18SWJu69QkZ2UEhGrxD7nDXVagsahpMbtPk4enaRa96yz18mjfHtd23TBBf4yUB2 hg6Rv1BLs8PLo/iF4lmbdj6H9xIzLwzZLt9hWisP8p1w+4CmWwysuJ6tOKAG7CuldtrI u+ikO8BYRhU2p1c4sPBT4OgBuBt5N1XlvDykFC4gqgvbGAu0JDbmPCcyYWLOKJX+buIC 4QJFd0/u0KAG++KWQB6pem/rUTx6FPPIUXYJLqh7liAXqVC89Z7bgGVUUXV7BQW8zXxJ Gzgg== 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=3tf30naxwG8ULfBR8Z80R+ehNXjBaz2adScdYG1B0wU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=DgD0vSjMCd0noteBooVnJfGfwpZ2yxdyU0poPVNa4WDfxUoaFP2XwPu5lz93z2z1M9 Aa4Jy5lEzb2rtbQk0iyaAuI5fPehM7jWdc6BfrGZGVkVz1e4oHLU59d41+5Nr4h2NtB1 qf7ZTGFf/fc8GgMQCGSGSW/YG7Q78nUX3OHaThm8+oV79nr3vWIJ1+gQYeN12p9HqxM+ e5R8/DfOf5zpg19mMptDzmJs3XkAmJ4u0u7F+na+anb+4ZPlHbzbausH5wjguH6atHf9 HxOGJy8unx8ao+7WWytAXGquijRdRH2frelWnG4MjHx+eU9ikPzA/FXUUK37kRvtR6jh O9SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NCSlLadg; 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 md6-20020a056214588600b0066d09b6c11bsi626271qvb.526.2023.10.18.14.53.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:53: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=NCSlLadg; 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 1qtESC-00010N-4q; Wed, 18 Oct 2023 17:51: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 1qtES7-0000jE-9S for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:44 -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 1qtES4-0004Mx-RV for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:43 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6bd0e1b1890so3701732b3a.3 for ; Wed, 18 Oct 2023 14:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665899; x=1698270699; 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=3tf30naxwG8ULfBR8Z80R+ehNXjBaz2adScdYG1B0wU=; b=NCSlLadgE/GDmykhjXg+w4Y37UXtENolz0RqrRYfRDENiraCzJVMlXRXkpvRWQ/0Xt 60LuXd03KPrCyBT7UEy0rPft5YcjVFEbiytVD0tiCP+7eNStLnZMyDl6QP5gurhALeZV CAihLL4LLTuhee+uhq41iqBrS5x9JWg6r8ffYxM6IWyTfVk3YNPfsOflyPAlrA27I37c sPMwZKnc9kjkvrWZ3mRIXGZS3dcNRAWJQnCibrhtwAZ46YzgMVjHoKfWzNiNWPg3/esB UQhEEOWJvNcVAOyv8e+XkVhUt7ffjZSD53ubG94wSdI8kTbCt9T3Ou/SD3oLW4Q9ZyJQ Lzmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665899; x=1698270699; 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=3tf30naxwG8ULfBR8Z80R+ehNXjBaz2adScdYG1B0wU=; b=xTmeXCJOjqNtU/9gBe0osm3aamzRBPcHO+7RSTU/WjJqloRmnplOqKdneicRfLJX2J DFoSm6IcuIAp08WAnCPOKJsV8FiGblmXFlnaIr5bqPDvQmtJWa0xolT4uKhUiH3qvKkH v3IlRUSqwYy4LoZHg8rQTMfCXMmgLRFJplizBJxx7vlIyU3qoJ7DrL5uG+BS97nS/ab0 izRLJaOyUDoCwxofuAwhB8n4W22jKOHPAMvuKwBqpnPApZqB+I0/lxrD4yN2/l+ovrF3 tSvBds2Iz5+DcAjwv3O2M/mXTGg11qwK+Qv4vnqtUEbYAQvRgS+NzLNYY1KKsk4NZjhv 0yog== X-Gm-Message-State: AOJu0YzQr7Lau8b7XJjFFu/XqL7dbKQCImcEi1QHvsD0LNThQTdEBWo/ bE3IcmCb2BQUnlHdapbh9bt1+zV6b8ZcW1vtb6k= X-Received: by 2002:a05:6a00:b53:b0:6b5:ec98:4289 with SMTP id p19-20020a056a000b5300b006b5ec984289mr357415pfo.14.1697665899423; Wed, 18 Oct 2023 14:51:39 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 03/61] target/hppa: Remove get_temp_tl Date: Wed, 18 Oct 2023 14:50:37 -0700 Message-Id: <20231018215135.1561375-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 Replace with tcg_temp_new_tl without recording into ctx. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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 Wed Oct 18 21:50: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: 735099 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226064wro; Wed, 18 Oct 2023 14:58:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERjoBodnRSfGKGgRhQmY73WMWwoTefQiRylQpEVF5y3ABAPG+VjdSyqsnw6dWR7l5Pjw2Y X-Received: by 2002:ac8:7f41:0:b0:418:2242:7823 with SMTP id g1-20020ac87f41000000b0041822427823mr692852qtk.32.1697666332666; Wed, 18 Oct 2023 14:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666332; cv=none; d=google.com; s=arc-20160816; b=BMGRONhfmV17oV0X/wTEGecikJThEX9mAZVObkf0IVOOUzzWb3lWof2wozlK7w9Mq+ wu20yJqUUGNOGYMN6eq9wqLNIZpxGJzr5sh+nyu6aLc4ZE20xo3b6OYsaNu6aLZ+XUgD IiaV9hOYoWlozPZPpFZvQJtn4DJnraBrMJ/rW1aOY5lKswF8/QBm30xkDtOV1COLSgPy lQCE9esa03qXa9Dm5Pq8miR2fIMup+rzun6XfN2ACsoMqPOYF9HQqvYKz1M88M5cxPhB evs/kea5q58645q8jvB24/uHElUIWpiM9RxWs9ZM7aCIGI+s+BDW/vCBxR9R5dgk2SXe d4uA== 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=YjXhJrX/SMBGxH7IGxTXnRjBc5z/qhvZamM10cAqGZ7M5hsCC1vgHNF0xre5ZBabzb YjH/+160oEzKd4LA0zpiSLy2stiTL9LqbsKWqXSOOOH5S1hD/DJlp0cctVqpC22Av1ic JF9wCqtP6LJLPzaO3Svpe8meQxIn/Ty1CLkqmL5AUM3pued2c2vIpBwKZ2hy6eiaMz3K dbslVI6b4ti1/+k+8lj+0O6uhwEgXBimUiEYTfWg1w0rISIiwt7UF3ZGInf+pyChUSvM 9rjdseznWZo80vkAN09uE2qw7XAGtDrRajZEcVXKCi6si/STiyVXtlpxaU3aZ/DU0Wr1 Zd0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ayD/AAtZ"; 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-20020a05622a190300b00419905d39e7si642791qtc.517.2023.10.18.14.58.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58: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="ayD/AAtZ"; 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 1qtESh-0001mt-Bb; Wed, 18 Oct 2023 17:52: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 1qtES7-0000jI-Rj for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:44 -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 1qtES5-0004N9-Pz for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:43 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6b20577ef7bso4648803b3a.3 for ; Wed, 18 Oct 2023 14:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665900; x=1698270700; 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=ayD/AAtZT34aCcjfvcAfIBSySIo5sKo7Ud8EWRzKvQUDmEspuENEqvZkMuykwdzsIk LRshcKvTqUAi0bd6jdINf9o8lgA4HBUqxxjB4v382KpO4SNhfaD8hxD4AkFB/EQe534H SdmRkraKkvPrCHAzP1Z0Ah5flfv/Nf9GwG+5sgcOIbzxOK8dPT4eOvSsOTQU9W/rLD42 dSf43fO6P/cyHyM8sXgwT++mJGii5blzrap5Gqgk/2ke/HMGy9cm4IGTHEVMKneuIKSH j6FfOjvkgbtxopoEkoROZiG5Bb/aQp926mjiLEMJIVunEXGeic/lH7QDil9PUFTgwKjn YlqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665900; x=1698270700; 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=kclm7fy9gPV4PHLc+1nhVEL2DAKtGSg1sJByEpI/JHvQppEIJje2XSPRgJazdu259c t/BP6dQ3paJp65QAIAZ+bp5wc+9ZZLHp/emyegfPlVjvol7JZ9At0Bmu5tqfMfRoyRpJ jbEA9ic4OJEORR9KfKXYQdD031OTzRfIlAzrSAR9F7uCb5mSEs73LBQdKH0Nh9RyGb94 qCBFJAGgspYmF6TpRTaB/T5p2sUfiL2DWbgum3N8//KruHPb7+zENOO7+x2W69m7Vqz2 4OrcLjz+KyWIycEaaUGSYvYPOi/M2eJV8vwC0PAIYGZaV3wBXReDCn092aTz56nEaPRo KbxA== X-Gm-Message-State: AOJu0YyI4s70w1xHu0AbwgOehq6XUV0PfPeAELyrFLOhF3DFkJnadEYz iDavSww90F33/r8lVNeItc6WZFZcLko4OqBLlkY= X-Received: by 2002:a62:5e05:0:b0:690:2e46:aca3 with SMTP id s5-20020a625e05000000b006902e46aca3mr327818pfb.25.1697665900218; Wed, 18 Oct 2023 14:51:40 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 04/61] target/hppa: Remove load_const Date: Wed, 18 Oct 2023 14:50:38 -0700 Message-Id: <20231018215135.1561375-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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_constant_reg. Signed-off-by: Richard Henderson --- 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 Wed Oct 18 21:50:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735084 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224763wro; Wed, 18 Oct 2023 14:53:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdvbyKWzC5WSovscuajYrOj4e3i6jgE/pb/ukQFm8e7ibkezJI0Ayo0P7C4rK/GLA7mrn+ X-Received: by 2002:a05:620a:2904:b0:773:cb13:cb7d with SMTP id m4-20020a05620a290400b00773cb13cb7dmr504349qkp.48.1697666037544; Wed, 18 Oct 2023 14:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666037; cv=none; d=google.com; s=arc-20160816; b=yTjNz8hVdPtMCRZCnC6/Zft9DQ/Mlm/31VfX/LKPZnoEk3jFAVBGoTm24MQ8HiU5tG 9kB3UXCUqfxtWCJqv9e1SGnoA5W37Vio1mfR4HuFdebcnnmkuJHXYpbRVgNxLNaqWhKc 0ZxHF2pU7zKts+4WC2hlik6vN/FzHJE+0fKqovrHpkAw9PEpVHdEz1ILOmEC4SbT+Uge K3svYcmimC9e1NwT8UwofjhgbiQPNIDINGhAMLsaP3u021XKbkGYExKHxXGb8shilCbf tU8d+1MtAHUVW9rAmJc8R66w/N2aWqXMaWBcqmL57E/9EHVHe7mZQKIswqZI/Z2l50eC mb0g== 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=gXjPx1N2BmS9T36iCkUtw6yZQ8ADMqU+ZTj8P6Ggkckj+UDlnGyEZ9CPMtCGlEXiHh tKjaYW9MWCbg59aynUPGirfV9+Kvzrm5dCccSwc23BbUSUokB2rRuhEluwOHy74buyZC 5ifpVTiyODNjKTSskgjlFgKFPO8FKP7dNWLniBGieiwaT5z0O6X1YH5imBr+WPKJn9Q2 6F02V+3P2zEgB50htL8KAC7oix9ZYhOYA4rv79gnQv9g+xmHw9MKLiLVGORx2iYHSBv5 TviPbI8Qyz+TaCHYG92+qrFFQks6gUC5DJrmcVKuolGBGsWU6B/ORf/I0Rd7L89aamYO zqVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RNmoujDR; 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 d29-20020a05620a205d00b00775cab41f33si572236qka.552.2023.10.18.14.53.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:53:57 -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=RNmoujDR; 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 1qtESB-0000uz-FI; Wed, 18 Oct 2023 17:51:47 -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 1qtES7-0000jJ-Rs for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:44 -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 1qtES6-0004NF-8n for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:43 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6b89ab5ddb7so4874823b3a.0 for ; Wed, 18 Oct 2023 14:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665901; x=1698270701; 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=RNmoujDR7osnJn1omZfO8X0Q7DGMPFoqSHlR2bK2frPk6sH6n2EqzrCWqIq2wB9Y/K qtAaVdOrvNGrlYSOkMBOuceq1dxxYHTRMtyghyNr9V66mvSzZ2t4ZjDF7iiTuerONVfQ 7esRH05DC633ED6cL7M5mExAXrD/DdE1aw3zFwifhNEcPGEgAF9VPi2ucaRGCw10cQZT cL4FW8DaK+d+Xs87pLZQtIwtMZ2R/JCpSM+IPKATKG9aKEfVdaj3Lmu63iL7qn6E5akK C7kF876BZHyr0ZFjjQAIQL2J4EHxnQhDhukg/2pByX2Kb7GwDZ2nnafg4TEs/5K/T8QO RNLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665901; x=1698270701; 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=sogBXfbnoUGzMZstvxSEDiE5Cksc0DQfeuv3f+gXZxwY5fxFENeGKKg1qcvBPMVJat YT2N26lVa2W276T/yUR/wb0ThtOlR6rPrUfgBs6j1BxZV2kfnJSfBAV3F4MTgty/OvCC Wi05tyAXrptnuARUrjw1vyaS8MLsDmaVQFwbtaqQyl+fN6O9uiUFvlIVCI5PhjMGS+6E pGACR620FMN7Gibboyu6NSwgJapLLrxYpfhRwXFt9Qk1i6Fis3I8SXM5O894rX1mavEf 0iFBkDF7U6VQAA1QNIQh6ef6U00DvS+5C/hvdnSUH8uFOajSa132rGQEgzf/LEDtiad4 kJdA== X-Gm-Message-State: AOJu0Yw/7sltaX4nJv/2oFnvDob2xYhaG1c5u2J5BEI9OJh0GhjOc7id HzcuGTA/Aq0hUnBXyr0RJHMenMKDb8CFgzos/KE= X-Received: by 2002:a05:6a00:1788:b0:690:38b6:b2db with SMTP id s8-20020a056a00178800b0069038b6b2dbmr452679pfg.6.1697665901043; Wed, 18 Oct 2023 14:51:41 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 05/61] target/hppa: Fix hppa64 case in machine.c Date: Wed, 18 Oct 2023 14:50:39 -0700 Message-Id: <20231018215135.1561375-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 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 Wed Oct 18 21:50:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735076 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224475wro; Wed, 18 Oct 2023 14:52:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtzOefmOx2AkOirgrdUQX6nchfqU26FLvIsGlPbvSRCQhyiJNcaMyYqX8gYZkrRr7psrSJ X-Received: by 2002:a67:e0cb:0:b0:457:ced4:414f with SMTP id m11-20020a67e0cb000000b00457ced4414fmr240836vsl.25.1697665975217; Wed, 18 Oct 2023 14:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697665975; cv=none; d=google.com; s=arc-20160816; b=ZM9WsUj0FtclNx8AStkfekXk5jjlRO565IOyQzY6SlxMeDWdyiDGVU22lBfmaW9qRE baklPTwB4NIlpi78yst3g22H3EFHwd13FqNIjUkuXzbRAdipQUxXsxUgukY5xvW2srtq paRXj8lA5c6lqONN4OlYlolZ5h+Mot3XgBr16O8I1RixQ+YTxAZV3Ef2tMUhhxxD9VXN qd4kLGVuc7QpAluW1hS38bluhk5A0eg3L4bW64RlcjNCOJwAOf6jugegmNi5Ov5Wedcp zZ6cztXg+XmVSB4m1aXmdQrYimZInJxBodDjTJ/of1D8MZdbkq8Nx/wzMqRga6TIkR5+ kJsA== 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=OQDrnustD9JMJVkf0X+C7sW4Z0qLBIQjQQllFpFrUUM=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=usq0RF7ng3XgCojKuf6HWC0LZdhYRqrtUvTgWwjFmvHoHX7ItaeCaKzaAxZYt4L8Or HoY846PO/HCAiMKF9zXXSDSDfWlnzOeo/ereCDqumL0Os1YVlW5nPzFZkEykf/+bOhSy MZlRq9udBcwsjNK/gQ5Rz6ts6wBWkLWOVOJygb4jc6CWHQAIqrhJZQlsk81oM0/TVdT7 QTxo0juNRZYlelGVa9pbA2VwUXJF5bqC87aiS7rIVj6kYlUtAzJNjIGEzmr33/ByF3Cn r2wwxYJMDUXfY8i1o1C2ky5Sl1HwJgX9WlmU6T37XiQa2EPIn/YtF2vxUPMTXKvqYpRR 4zQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YlCB5rbX; 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 e12-20020ac84e4c000000b004195ad3b40dsi643983qtw.229.2023.10.18.14.52.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:52: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=YlCB5rbX; 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 1qtESC-00014D-O2; Wed, 18 Oct 2023 17:51: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 1qtESA-0000rs-Cn for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:46 -0400 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtES7-0004Na-3i for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:44 -0400 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-581fb6f53fcso553858eaf.2 for ; Wed, 18 Oct 2023 14:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665902; x=1698270702; 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=OQDrnustD9JMJVkf0X+C7sW4Z0qLBIQjQQllFpFrUUM=; b=YlCB5rbXHhXRgm0HIo1I/HY/j7JB7PrfPynCaGRzvlAv3tDWMnc9M6t74qxN3J4iq6 mlZnSH2Bf3Npv6BYltE/BsVZUmaIEnTpfUHbvGtBHKPbx+OiNff7nd4/aa+cU+Nt7/y3 OG7cPqlYBkRt6NOXFvdpyxeyGEdaIbbYZkL15EuL+MjZnOR3mZfA7J4eokf9y7IhskoP GydHyNmT5N24LkklYWv0VDwe3ivHWvHEv+6cerP9x+JJxqeWSu713Ys70FZuIrM874Et TLRYy/RvEM1Oa4Pm74HXrYxN0lufuxE5IRFAeteTDsxCRFpJvy5XV7fbVXefm60dm2Ia icBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665902; x=1698270702; 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=OQDrnustD9JMJVkf0X+C7sW4Z0qLBIQjQQllFpFrUUM=; b=tHKU6y6zFBQOD3amX88s/QJJSax+sGH4H5RBzaX1EefsnUy2ha1bg4sQKlh/wcp5C1 i2C/uuV39veR7/ofIMKast7+gYWe6Dg7Lz7sEfbPRxtDd+nIxG2yNh+YangFIDMu1gAp NuORGzCD76HoBTsrNFCXu4Pa9VjAyjojHBLQaRqrlwglr5tP5sA3yppARBnbYZvk4rZu NUGNqc42iRBD2TOn1BN72fY51d+D5LO7p87IHlZQ+4ZESUnIgufzWz+uZD93nK7iompE jI/ugIGVfO03K4kJ7E9++xvD7qUMHEyi0/eW+G2cJojmJ7huO0MS8p46kmkhxq+r7Dfp FxNQ== X-Gm-Message-State: AOJu0YwILU3IrHlyA0wK5wcV+Y/hlPlLG7ZkyZ5kh2OZa0iO/7NYvDyx zp50RomWY7TwUkUWJBykqbSetJkOnyxU8CUTv+c= X-Received: by 2002:a05:6358:c62a:b0:134:f326:e819 with SMTP id fd42-20020a056358c62a00b00134f326e819mr261045rwb.29.1697665901989; Wed, 18 Oct 2023 14:51:41 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 06/61] target/hppa: Fix load in do_load_32 Date: Wed, 18 Oct 2023 14:50:40 -0700 Message-Id: <20231018215135.1561375-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2d; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2d.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. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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 Wed Oct 18 21:50: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: 735082 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224718wro; Wed, 18 Oct 2023 14:53:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHo65mbnSUGrwIKsdx8xm2Xk6yUHSGnfmVrwbYrdheU/n9Dec/WySsZe5JlwOX9k1vOUDM2 X-Received: by 2002:a05:622a:102:b0:418:1ea6:5530 with SMTP id u2-20020a05622a010200b004181ea65530mr633260qtw.40.1697666028613; Wed, 18 Oct 2023 14:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666028; cv=none; d=google.com; s=arc-20160816; b=C2G975dtLv6I+3gu/K4SRKXkxw40S0oDDww8TCPXbWiIOqeGMY2hMNsQDqPzfuizHi lq626k73XJUdoLkXat7KScRJB/Qg1l60eg7QlViak/5+J8pCotq8RAKxmrNRHpmcL49/ k0iCNiH2tVXho9W6sVqeFhpHvZk2apWXKxBcKOae4u1QWNt9/Xtidcns1fAV4O3sreBl B+zLuv/CgJXUa8OVV8afND0Dhl7DpO6yLgWJd85Tmpne6KEPuPzIi/vxNtWFwKqmBP7k f2/lT0d7PE4GfXmyHK9EGqB60d1UHEu+3/wat4zTSJmgfQnstFGYmlqeVuuQNkzxgAU3 l6Og== 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=01zm6ZeYS4mBkyaUxiOWsfMrPRuFQSZcNtSJIXxVpEqfgjsOmeCTVopwuILsFv4ZR/ vmNiUItoRkeDMlNeHk91LZXiUGtt9RUOi1D5DnSGBaGIIB0G7sLggVSubeI0NvEQyARc xIqRxgw/96XOPaleXI2bMvPSlhMNVKZnXPdx8qz8qnehX2zLASt5QHC2DB+d8BUbf82L CK8HehsOL9Rq25xVgzYf7AYS/StHbVWo/2rpHBhezYiwjgXnY84tO3rYwrV4bs13h+b4 i39h8SRnPx35EnRr4AxjxhEKS/ilEsbrbVHnfhOgMKebp0tngrbi/GAFeo8cfenL39Pq OwiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="JTOUyhC/"; 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 g18-20020ac87f52000000b0041cbbbc2ecdsi620792qtk.321.2023.10.18.14.53.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:53: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="JTOUyhC/"; 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 1qtESB-0000sv-3f; Wed, 18 Oct 2023 17:51:47 -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 1qtESA-0000rt-Cu for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:46 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtES7-0004Nm-Sq for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:44 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6c4e30a3604so4809466a34.2 for ; Wed, 18 Oct 2023 14:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665903; x=1698270703; 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=JTOUyhC/XUy7Gr2RsMUbu28dzfSfUr+dCgUrTh8sJyk76u5B48M0m8Z6xelUUjLrC+ DC6bCjJlw1gIR+K3FS4lLWhPrmFsBfw+TTz102t83RFIVpm0/3ki5c4wcly9gsEdo9eY SqPY8t+LIzPX2Ag2v4X1blivRdZ52oKoDmRDA4AWVSbO3P8ulKk6DdyE8xXBAcd4iKUs yzyiRtYcja7UsiJwns1UNA2tnxZ4rfAxNQ120iwqG5sqLyTfmNz8YRsI8UeX+D2DOmj5 nt70QsyGq8hlE1DkKVpDVfyb+C1N+paqMrblYD9+9kGO2xd616EIOV+HRBgXyEKmRsjN ElqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665903; x=1698270703; 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=fWPCZ0giKHrpqMuQqVrUoAUL9Sl16nkOM4JF6/eZLP3dqBbPtlzx8mAC57FFwPRvm8 nq4Dz8wRBghq0B/KP3RX18S5Gout1ebOeWelZLfBH8UUZzCqzXqyPsk0oFm/ShltKNBs RzbPxpAq8lGGr5fejSUjNXlPm0lb+ghSDwIWgpakk6PBOxOonJX9ZdISAOcbP15jaRuT SLvTIXQSyP4zU9izMD/FHSFnBJ2vkbqwv0AYW5rRJrErUWE4C2phZxbxslmSIAa3rGCB j22IvZuervzdxOhIouU+cgzWsjnxydeDlrdbB2NO5al+Gz09BCH7QJWmca/Hqq08US0R 6LkA== X-Gm-Message-State: AOJu0Yz6yciU/CF/ZJk0nCKuduehhI0S7TdK2vp7es3f6qzDmsmM0oDk fzyXdiapmumiP+ZkF+5lr1BipoZeeAHosRivPLc= X-Received: by 2002:a05:6830:2641:b0:6c4:aa6a:c4e7 with SMTP id f1-20020a056830264100b006c4aa6ac4e7mr513901otu.10.1697665902723; Wed, 18 Oct 2023 14:51:42 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 07/61] target/hppa: Truncate rotate count in trans_shrpw_sar Date: Wed, 18 Oct 2023 14:50:41 -0700 Message-Id: <20231018215135.1561375-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32a.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 Wed Oct 18 21:50: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: 735077 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224489wro; Wed, 18 Oct 2023 14:52:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhUm+Wvwmw3cDS8V4VnscU91naeTR2rONTDzwSHlO87LlKiXw2KXXPJuVKgX6yg8TZj0gl X-Received: by 2002:a05:6214:4001:b0:65d:f81:9b47 with SMTP id kd1-20020a056214400100b0065d0f819b47mr556105qvb.45.1697665977576; Wed, 18 Oct 2023 14:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697665977; cv=none; d=google.com; s=arc-20160816; b=NzCnQLIrBCW1HkRlK1zIqJEro2f6uXc1Pt2FDa//its1Q2VQF9qomJJcReUh6++UBu OTAI9aibPgE7K2DqbTrcNwpO6M4QlhD7BLEpBlrXHglZdv+Ny62UXGn7hTmiRtvYJDRT Dbkn/5zJgNQ6d4h9kOFdft/zl+CVbuGslyYEbimtHwWlIug9KfR+6PpV31Ip4Y/3qba7 enFQe9KFQOo070fhWIsYN/iwGaiVeaYxvgPeapZNKemZYIyTXC58/Bb2V9SFjQBFkEpq CqFQcow9//qkgLvNrjPx/Plj1JGOs2RFLpjO5N8UdnIdxgzvqjJ+QN7pJN0ph5LzRWJg I2mw== 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=FpsUgLCJwfp82RymuBMUoTF7+mm2hcKUaeEmrZSwRyQmkxPxoaSd0g24Vhnrysq6zA u/0PqbFxvNcBTNGth2Ut0RK2rXpY1RXWc8NkOAjRASbIYu+XMacQd7hQl8RJkPZZbINa KbxX7aHpud5kBOzX6EoXoXa4nJh96kqGmv7bld5fAg5NZQ/mKd+nRm9u+SztUBy6UCdK OGgQ6qqX+SPKSRUPQXPHssq634aCeHPJ731B+RCo7z600exlsaUPYePuiH1eQD2+78qD 1ztefKnuDOnAqHiTPa2i5+4R0BrUpFtk5SzpSCG/jyIrzOy77RvH2ew8cnjC0BN7Qd0r JSpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M+KngcJO; 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 y20-20020ad457d4000000b00635f614adb8si578100qvx.560.2023.10.18.14.52.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:52:57 -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=M+KngcJO; 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 1qtEST-0001BB-UW; Wed, 18 Oct 2023 17:52:07 -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 1qtESB-0000y8-RO for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:47 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESA-0004O2-5S for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:47 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-581d4f9a2c5so1258453eaf.0 for ; Wed, 18 Oct 2023 14:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665903; x=1698270703; 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=M+KngcJOuAS+GoE9u33VRTnk17iY9Z7CVFcqSxPRbzaRwv/5ebdysrBxgEDtlcg+C4 d090iouG/p5T8rq7d7JZA8JG5x1/tRDQRLPQbwLlQGFnqnD92LM+tVymwxSxXG3LUziT 76ZEUIozHCpP+OADMEWisUPBdzJhELQKOw/0HXD1mnDrKEsFI01ZISnaGRHP0o6WrUIk JNFKCcKo/Ne2w7ku09FbOBpz0n94Rk9sGsKy8amD+1Bt1ZqCX0Qhv5XgLFnBSOY5xjE/ j3ptcvvjxMTt2EqP6/vLoOrnzvjIlbi52zkW6V2T5hy0Jf/UNNK+MbR9kza8v4CcEWO2 B97g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665903; x=1698270703; 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=srDK6sHMuPuLMzFs6SJja3OSEewLboYcHkp/+SHJoazp1qAcnSTmrdULGi/6BWDdad zo1R6L+Ndg19luJ+ub/2+8CxZ7jr50Iqqex818GAj9xgHWfz+87acrsbGqMjF+Kk4Ksp MdHvdBhxleZ9hJgZ8tECgsQwZTosjCP1fS+u1/akrA6e7EpxKuR+PB4VKDKW6LJZSnAa rlvWkB9YcFQnHE+DVlbvtssGgsC98VO8dD2l3UTQCIIaKoGYGMoVZQoHuVzNqYmx5/UP HTw+8JgcKPha8oYoYV6YwldIRt2Wn73C4sWEUytsq9jfo2h5lwYBS0e4tPEgPuVOx9Lf ++LA== X-Gm-Message-State: AOJu0YzPvP28EvL4pVGmvWBVRiylrhjFmg9nv+HyNGAymri+zB+H1EGJ p0Wz/BtfGXKc0ssxfcGQVs2jD2DODzPk/rQWoZA= X-Received: by 2002:a05:6359:5d27:b0:139:c75f:63eb with SMTP id ps39-20020a0563595d2700b00139c75f63ebmr219978rwb.21.1697665903522; Wed, 18 Oct 2023 14:51:43 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 08/61] target/hppa: Fix trans_ds for hppa64 Date: Wed, 18 Oct 2023 14:50:42 -0700 Message-Id: <20231018215135.1561375-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c29; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc29.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 Wed Oct 18 21:50: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: 735075 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224397wro; Wed, 18 Oct 2023 14:52:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjLu9rkY2DMyAlfmQS8HNgfKCDSA9vljdcCYBpmFfhqO1eqonY7kfRUtCRDVxaQUsGUK4c X-Received: by 2002:a05:620a:424f:b0:774:2d84:f3d3 with SMTP id w15-20020a05620a424f00b007742d84f3d3mr444930qko.63.1697665957736; Wed, 18 Oct 2023 14:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697665957; cv=none; d=google.com; s=arc-20160816; b=YMIScmE7/CrT83R5j/WPN6rBOXihWRmyUrM2iYy/MYt+1NBjRoa7+zL4KKPNZOxxp7 wDfwIrs0hhNq1oGmq+SijcF1U9rls//vqYXwr8wXGS4r+8dFjr/Fv6xOYmfL/vRyA/St rPkwnaGTDNborGxM6vO3d4hTBu/cmId3z8J7LBCAB75MOEtTh1R9mAfzCgnK+dbDAzQu UNjjjhNbVO5sdv6Ggc4vNHBXiS+KyT+pVnU9Y5cfiGmE4kNd0Vghpp3AHUIVDbHBaF5Y k90rYXYP9RvGD7hTYbbbMC9OfkpGBUOhrx6GTxYH50TCQsUdd1VmO7sQX4XOHTt0msle ibgw== 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=ZUyBgo8G69EFWcN2T/mXQejBHUIA9fw4JhEnkA/8gryuaud67RwYa3K+3kxyTT9DNP PM76LZ0Oh3VcGnihiANVZZXSXj4D/oGkTSqAK90z+mJVXPqNMnKzEecuPluNJ/L9fWCV FWLZoJY3V9jg1ijj3TkONK0zIaI7mnUeAA625O+9MKcZR8kUIBRisF94/oluIpAIu3Ox MH8Qn2lZcqt7V4buWyhrsYLcCa1zpkikhQYG5FORZX6b5Xj4pbcp39ZZtJJiDSKhEZkD djP7XFs6SKyjoFBoMqr4cGHn7o47a5/Q6jBRP/FrJMGJ9tC1yNzrBqAPUARb4Af9yCL1 4jHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qk2aoN7f; 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 ea17-20020a05620a489100b00773dcf010f0si586929qkb.547.2023.10.18.14.52.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:52:37 -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=qk2aoN7f; 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 1qtESZ-0001U0-Es; Wed, 18 Oct 2023 17:52: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 1qtESB-0000z2-Uq for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:47 -0400 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESA-0004OE-5u for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:47 -0400 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-1dd8304b980so4636093fac.2 for ; Wed, 18 Oct 2023 14:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665904; x=1698270704; 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=qk2aoN7fFmPgsnPWRZCf58T0Ql4TMOdoXep+3P3YljWwveXOho3TkTiTRulA8guso0 qeNk8JIyckDYB9CTx8oPclLtwPMXguY7a2t+XvuvnZjCfAYFMQ+6ynPkCM+XUL3RnrzZ SgA9R+JmcZEFeZAgzDDbXmG/8oYvkVcR5Agdc+WFjHfgvdF/ilYTPlbYSJaVr9Yj5NU8 aI8TFA/8+zGAD/NH39BBNb9513E8Of+ZE5wkkgeeb6CTPDcsg9vhxGrWTCSVsseGb5Vl Y0ZKQszpC/Q3ctx2LzxcMyyfOndlclqLTqqDNOAhksYgjQPjNd2roUlYYp+/ErfQQikZ QQYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665904; x=1698270704; 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=JpvBnOdrzB8EAt43VuVltItJEmsW/nEKoIkLUBI5by8FMSFM4g7IVl0RNSQOI+ShIS Ir1zRCe7SQcYqw3fe8BhylTViOeGPfucjua3S/v4RjQub4FcBiBD7qTK8JO97/jPwggj o7vSITCxarZr0GWbCZro1Rsad+ao7oNSy0N82GW6aPRe531fVsjeIlRhNs+Xl6rRAQ/A YEjt4DRahbS3c71tvz8KwmEitRY0GxyAxGj3OEBbgUB3bEjZkRQ4nz2r9j09+EZq4ju8 s4QVgrNTEIzJ+gaRTs8zTOPVrcXpYNd0z0oNKEAHFAifvQz4u8ucP6Cy1aF8KF/EtHuH EHKA== X-Gm-Message-State: AOJu0Yz964iWVrd2q/t0DfR4/qaf8TjDVhR6k2Jf4qynkZ3Q8Qk4nYJW bXDCmGMXrliko/i1s/oSGM8Tk6aX5ZliYVPctn4= X-Received: by 2002:a05:6870:8294:b0:1c0:f8a7:ec14 with SMTP id q20-20020a056870829400b001c0f8a7ec14mr635442oae.57.1697665904345; Wed, 18 Oct 2023 14:51:44 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 09/61] target/hppa: Fix do_add, do_sub for hppa64 Date: Wed, 18 Oct 2023 14:50:43 -0700 Message-Id: <20231018215135.1561375-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::31; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x31.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 Wed Oct 18 21:50: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: 735116 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227084wro; Wed, 18 Oct 2023 15:01:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqw88OYm+/sQjwnfWdi52ACNtvUP5CTwgxNEa23Tm/CZfYMwYrrOb6GzUoFOptIvwm1RjU X-Received: by 2002:a05:622a:307:b0:412:22cf:83fa with SMTP id q7-20020a05622a030700b0041222cf83famr691303qtw.28.1697666483809; Wed, 18 Oct 2023 15:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666483; cv=none; d=google.com; s=arc-20160816; b=Gd9txrRFtg935lwpZtPx8pfBsGRF/KxIZuf0qGnZwRAxkjs+dim4/Qkq/u8HtjYHiC oodpmnzXPm3DMPEO6hk3iFiG/j+wlSJufMIBs024MVfql15XZ7Amr0jwqhjO23d4GE88 ogm05g7CDcorZUJ+VMCgMIDFXckeuQlUaHc1ybxojAoKxw3pjFgj0FGRU6ly1YtrcReX LWWu2/rppw1R7lQJlIRD5Z3YJzPaW3T6dCMvRoeahGL5ettfjJUlm6LZf1XAMv2TanB5 YB+mxwYybPYc5ZcmWlMUkr76o9SVMzYKG4YiO4Y53eqL2Cm8wDzjEPnkeEW1xCkRn051 uNsg== 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=JRsrD8O0xY/V/93lLBKN6B8T+1xxcvgl0Ers1OpwwDtWpNEWs4lwAW0qPjZMOwZsu5 I6qE0Kck3rtd65MiEzVk6S1kxPqhNeLOMHrhlvIAioJNwVY8dZn0QgbQNPmfyNY/uoGN ssOFTwL7/e6u+s++MsFpuMg+l93sA6wZGVbuhmS4kHDaB+Xj2zX6uDZjKn5CdLGKxWZ/ urqq6sXifxPYu7ChUDmsWDf8OHdi6HcjLfLCNfoayAhx955ipNwk2i5psImmuLXVQtBJ aPXOiFoBhsZjQvWb/uGpvSYQauHmh3FwahRq/P2CPjDbu24CXEOqtwRaDahoq5gle7q6 hR6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FVjQ2RAt; 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 bp36-20020a05622a1ba400b0041cc13be9dbsi617056qtb.679.2023.10.18.15.01.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01: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=FVjQ2RAt; 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 1qtESl-0001y8-OJ; Wed, 18 Oct 2023 17:52: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 1qtESE-00015D-IR for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:50 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESA-0004OH-AP for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:49 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1c0fcbf7ae4so5076552fac.0 for ; Wed, 18 Oct 2023 14:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665905; x=1698270705; 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=FVjQ2RAtxT2KrWlgEhrtiRn00QAYXOTeYlkbbVIN3yG3ng8WFSj96ZMMGaTah4QxFg QMZ1BrMAbIyp5aucF3Roz93ylnmrxIgAXD5GhwbjMbQug3okqnNj9tjDagXUbeOantxE nes0asv+XxAWQ1r6q1DgyVgoCUDVduyoqGiYenI3vB8JzF4VTxDGkVp4p+NMMgzliXit efZJKExF861l9kXuV1k8M8L7gCV49WW7mD+OI7DLkS+QMEAKxqYvFmuTRpQTC3O2Otfv 7C9uVOtLDFpRcz64/8lPV2Xk//7MI8olf00yHe4q022wke98WpL/NO0ZYPVDJDWBOr+6 z/pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665905; x=1698270705; 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=T3GX8F1zQ0vnFOkU4fRdZ2a8ACmCDSCaw5hTKGYArBbzXJyZBD0zAtgGWXbicy46KG fkVsPWVPU+F9LkjChEgkeJOr+Vh42CmSyvDOVg5UHoJC5lzS/d5SiHLeTOogvs4xOT4k ur9gnZteQO3VPsPsHglAA3kFcQ2/6UjpWVB/wUocfv02MrgYddIo4ZA3xZTN/+Npyc9B +U6/SkUhg/zSJU8vKseKsmsLvprWUlWdPZPOjsAdXhCAAeWr7EqmYtepGmDDeIP59JZq ARCZ4corBOQRucwEkuWCC4jzADGYey/HRX861UVU/vNwH2NTJdbO6Ecut/8WbWb228on 1XLQ== X-Gm-Message-State: AOJu0YxgMAu4LBiRObfjr6ztDbd4r1mzoxDB4oouXHkd1QOMuJQAiyM9 ySgGyTjcPkBLNI4PyHzU5Q6KqWSWTXXWpy0jgds= X-Received: by 2002:a05:6870:1094:b0:1e9:f0ef:dd8b with SMTP id 20-20020a056870109400b001e9f0efdd8bmr609837oaq.54.1697665905146; Wed, 18 Oct 2023 14:51:45 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 10/61] target/hppa: Fix bb_sar for hppa64 Date: Wed, 18 Oct 2023 14:50:44 -0700 Message-Id: <20231018215135.1561375-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2a.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 Wed Oct 18 21:50:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735098 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226056wro; Wed, 18 Oct 2023 14:58:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBheKEcUJUgmLAuakLoHfXWLR+XUEdLw0rzTrixSn1HMAwpaPvIDsVPyab3/570/4ON2SE X-Received: by 2002:a0c:b2d8:0:b0:66d:248a:2dee with SMTP id d24-20020a0cb2d8000000b0066d248a2deemr469394qvf.0.1697666330481; Wed, 18 Oct 2023 14:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666330; cv=none; d=google.com; s=arc-20160816; b=UrqnO0saAHeP6dbioVhhqvwpub23xxQM8wEFlGcHx8tywkbxGIXG9p8x5KGOucVXoG UfyqPYk0bAn+F2ZyE5HsWzoHFVwZDQnGVb4FIkDzyKOxF95ThQcVopJcqwIuFXw5Kh7/ ZNS+BtUhMdcTOMckM0GLTRHHXVUuI3/bykeIhihVNdvJz4NlygLuKo9AmVZ4S35jHzb3 h+inS5DpF+O7KmUci1RBJTss+AhtvB5UONtpQIZ1+36VCOK52fs3VGt67+FnpAtorgoT T0WDfbnecDLAg7zAKKcvLMAb57EUnVIBMDlcpJZ0S5TSW5ecpknxHmZrmR+ndTOnQ1XY YCTQ== 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=m5DvP2X/dvsHBh6uiOUl7068GNehiYX57AFq0MXbgw3k4ACC35qIAgYB6AF4vqc+xI Fhv1gGwN8ROfBp8xjbiPHqkKLXkqWaDX+s4B1JoQwa5fUfTYo0HfmmVVmIo/OBX6ovRc bOA8DVwtfNfe1Grov0OCU89c/AZb18SBKj2TGnFARFk3RSQuICxplEAqbQtuGxHt8iH7 2juyy9Zmn9mzzwdpTov21XLtHXg/oG4KHdUDV1fmGAJXy+vAujNPYAVzLPlqRa8y7I1a 1KwuJgTaUXemAbTYv2Ry6MQVlfcT6olonEwhhgsc1dQ99b7C4pHATZUtG6ZSf5enwR8h eTzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mAX1CG8e; 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 ev18-20020a0562140a9200b0065b2d89bd79si591189qvb.465.2023.10.18.14.58.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58: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=mAX1CG8e; 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 1qtESb-0001cz-Hd; Wed, 18 Oct 2023 17:52: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 1qtESE-00015C-I1 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:50 -0400 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESB-0004OU-6b for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:49 -0400 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-35749078a59so29497765ab.3 for ; Wed, 18 Oct 2023 14:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665906; x=1698270706; 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=mAX1CG8eaS2c6s2OMWAjQWUkDDyiAPnzno2nxLyv2r/k9uVfJ/X9/pSs9L4NUlp6To +NPHljC0cb/DrPKRqMYzjJSR7HYjLZGF61H5eJTgwUOb0xiygJfk7G9sTV+9QDjkdAQU zCOcc7d835IIWCcP8wmzgTcm1QnpFdEIx4F+BCXz1J+mDc6hzDP5Wyju9TKdORB6BMhe dvKBRoSOyCQsL4bbcKm9DzHdb4nO6yxnigDcnHfz/mldNqo/rofm9d8SUrHdYBjOFTil ekiAIP/Yizl6NXbYBpF/+e06yAdefinB1676CLoXfLYct6zMGK21f5yq6EfnShpTIiwK PQSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665906; x=1698270706; 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=guZi7vEECwSVvQlJBqbHKIyKkXD1vZ0WxOZ45upMOtWywgr3zTMxXhiOhk0iuqiKHM rMNexcMLsdwlxjmf5LNMgRha8Mdj5Zhe97Egix5R3dg4IW1Omq4IyLAmTn5vmi1rw7Tf i7BvjXcY/M/IymrSRBXLGCdITbhbo1Ai7+btTfGp0kI74nnpfgjeeGdwEvHVvfhgmsUi Xys5m9iA5/zYJR73yE9/mo1s4dKCudPRhTo6uT6GNb16D4k6y5MXrKdsfY4Oxd2HK4/O yrhHwmLwVgXLsOP4JISe56kDRtfPD937E4R33DllfB+R6ruCjS1AUK+N7sc1DzFzB88S PELw== X-Gm-Message-State: AOJu0YyIbn3wSs9ROW6tq7ScKYg7V5JEBrludFcxmckj3IO8tJXKoxWE KTWezIIUoiwKUCXNT0XN+/NEdiwVUFoqq6y6gP4= X-Received: by 2002:a05:6e02:b4b:b0:357:627a:52 with SMTP id f11-20020a056e020b4b00b00357627a0052mr761487ilu.28.1697665905976; Wed, 18 Oct 2023 14:51:45 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 11/61] target/hppa: Fix extrw and depw with sar for hppa64 Date: Wed, 18 Oct 2023 14:50:45 -0700 Message-Id: <20231018215135.1561375-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::135; envelope-from=richard.henderson@linaro.org; helo=mail-il1-x135.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 Wed Oct 18 21:50:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735087 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224888wro; Wed, 18 Oct 2023 14:54:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCLVm8HAZVa/OOb0HBEjVaKCB663Y06FDVRguX6F5z2szi144xRqk4yUgrfW1804GshHaZ X-Received: by 2002:a05:622a:20a:b0:403:ed26:4083 with SMTP id b10-20020a05622a020a00b00403ed264083mr582806qtx.61.1697666065962; Wed, 18 Oct 2023 14:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666065; cv=none; d=google.com; s=arc-20160816; b=RUQzJOEktOjWbfS4IbBKIJXqzzZ3BmJp2zCkPQFoDC7u3fQbVneuemi0coQ7JiSvej SXcs6/S3pD5L7V1pLrx7bQUJr8qiL3uDOofHIb2C7XhErbuIQmXTAaw4e65b9nv5GN0s JrYaCJmqJF+pBATYd9bQUkaA10jPHrGcEikZLPYb/MuVG6m0JLM9JaJjznSkD8LpD17H FJMkKP6CcdtsE+i/MIf+4wYEuxRc/9XqEeNpQ620HzMlDaGwIPe2ZTrgWh5wVWgmg6fq ZoKcQZKl7Bud0TMM8pf23z2xPD38LvxtbOEuod2snuoWIrKG/Edru8vOtecGfw4SKNZT Wikg== 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=cjdPIOgHmvrr+30vbWYAH4JEvq1rx9Ce0rUnUJEWHoQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=sRfowSPrhvgJVFhR8lWonjl51OMdds1w+Y3fGKCqDu5VVMFqrc4B+YgQP9SfAGY0ao Qkk2Vg8taRTpJbnM6zLSi5BKs2voMPsJ6sC5ls/067yYmJWVpSXVIqUREWg8/CSzeJOP dFgJT6s/FtrV/0E2ZenDZx/5vvb1zZobz/GdB/dX4rh72jfHw/+XvraH51xu3y3Ut3Md Nm5StMlDic8rldH/doitkpFRUsEF6/4UlNzh4YdxGWtEokodU7aAhwJtoMxmf8kXzyeU eYZvemxHOqi/gaRX723y1jniaggMf9d636EdmflswbDAllzM41raxzhYFmrAvCU7CZt/ wDZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SeD0Az0d; 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 w14-20020a05622a190e00b00419845c7a91si628580qtc.377.2023.10.18.14.54.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:54:25 -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=SeD0Az0d; 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 1qtESN-00018r-R2; Wed, 18 Oct 2023 17:52:01 -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 1qtESE-00015E-Ia for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:50 -0400 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESB-0004Oa-PP for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:49 -0400 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1ea82246069so1519476fac.3 for ; Wed, 18 Oct 2023 14:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665906; x=1698270706; 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=cjdPIOgHmvrr+30vbWYAH4JEvq1rx9Ce0rUnUJEWHoQ=; b=SeD0Az0dBHb7xSoXjFMGlJbSuXXxDlZj/nB5zduenr34ujmDZMFUrg8ajQivjvNSHe QJXPddKJlyc6WVlOn6HVn6pQeeVeUoPJ5Rf8xnkKoHJJ9YiBAyNg1qaZXJTzVnJLOBbI vg7KMo01RkKPSL5rRWSurFkKptsi23R2hR9lJI4n6MveBsCgXxgPXGoE4seSIR/Jchd0 PX0oDxtx6dUWuJcoBUBPBE2BNq8KtdQr7WFLv7EePJyRVhO60plY5QvTvq9utcug0EfE wDQldeX8pKHGcq2xrTwveH96McjTaMNSH6tu3BUIVvQv5S6HCPHSPX4iFQQiXkrHpp2p PgLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665906; x=1698270706; 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=cjdPIOgHmvrr+30vbWYAH4JEvq1rx9Ce0rUnUJEWHoQ=; b=T1L7A4xYcgn26mg5So6j00jU6eLpNJ2+H/zurqrimQb1aavKc66yXofW/0nQCl4QEh PV6QgAbV2BN3u18hmG5KYjn2gz1oho9lsT3yVD8rTSwS3KYjRtY0LzyW2tckiPYRGYYv GhvJ6srgfyjrmsFpHm8qbyRzUSaeufskp6IGJWbKUvmFnLzdX7TrsBPkmQ/Uco4hMTom zS3G4zNIehXJYsTCXbe9Sp5K2y3LqKOroMES5GsfhOFDX8+wwcvsdgVyOzPnb2eItM2I hYi5dUdJSu5IIHRU710GdmVqonXZhUe/KwRS9EU2+eXReo1WYah5qJtjTEJP4JuYjZIY DWRg== X-Gm-Message-State: AOJu0YyoR89mSVogSrmdvN8642Sf7PkaeOecF+NJhaTxGhUlCoxxoqNb B8QEWXIIgc/BBfp0GPnom+JfO0LiDj2dSnHmhDA= X-Received: by 2002:a05:6870:cb82:b0:1ea:478c:a26b with SMTP id ov2-20020a056870cb8200b001ea478ca26bmr788073oab.9.1697665906695; Wed, 18 Oct 2023 14:51:46 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 12/61] target/hppa: Introduce TYPE_HPPA64_CPU Date: Wed, 18 Oct 2023 14:50:46 -0700 Message-Id: <20231018215135.1561375-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2d.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 | 7 +++++++ target/hppa/cpu.c | 17 +++++++++++++++++ target/hppa/translate.c | 3 +++ 4 files changed, 28 insertions(+) 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..743fc90e14 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -239,10 +239,17 @@ struct ArchCPU { CPUHPPAState env; QEMUTimer *alarm_timer; + + bool is_pa20; }; #include "exec/cpu-all.h" +static inline bool hppa_is_pa20(HPPACPU *cpu) +{ + return cpu->is_pa20; +} + 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..ed5b6afd10 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -218,9 +218,26 @@ static const TypeInfo hppa_cpu_type_info = { .class_init = hppa_cpu_class_init, }; +#ifdef TARGET_HPPA64 +static void hppa64_cpu_initfn(Object *obj) +{ + HPPACPU *cpu = HPPA_CPU(obj); + cpu->is_pa20 = true; +} + +static const TypeInfo hppa64_cpu_type_info = { + .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); +#ifdef TARGET_HPPA64 + type_register_static(&hppa64_cpu_type_info); +#endif } type_init(hppa_cpu_register_types) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f86ea9b9ca..9d6670f91c 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; @@ -4087,10 +4088,12 @@ static bool trans_diag(DisasContext *ctx, arg_diag *a) static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) { DisasContext *ctx = container_of(dcbase, DisasContext, base); + HPPACPU *cpu = HPPA_CPU(cs); int bound; ctx->cs = cs; ctx->tb_flags = ctx->base.tb->flags; + ctx->is_pa20 = cpu->is_pa20; #ifdef CONFIG_USER_ONLY ctx->privilege = MMU_IDX_TO_PRIV(MMU_USER_IDX); From patchwork Wed Oct 18 21:50: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: 735080 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224598wro; Wed, 18 Oct 2023 14:53:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvkfJEOXOd3gNyvB2vhcHTGTvPRlwhdQL6aQ+RGSZbBr/2hoTiPT0nkG763126xERLmvBZ X-Received: by 2002:a54:440d:0:b0:3b2:e74c:30a6 with SMTP id k13-20020a54440d000000b003b2e74c30a6mr457218oiw.10.1697666003770; Wed, 18 Oct 2023 14:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666003; cv=none; d=google.com; s=arc-20160816; b=yQlWahRZgxZWayff3GcItrxRIiW5JwU0LFMDa3uieo2HWqGpQfsf5oQRW8WqzmDJn6 sQDDxcZIzya0F1ksHl9cb9XqEoYD9WcMJQhx2IZrkb/hIrLC4PZYJwMgtlL/AmP8y14r C1sTsvUWAWJT0N4AkxP9+J3+mB9UAkj7HDIAb/AGVDomeaRDK6NzZsWYFkZ5AQrbU98Q ruhBVhbqy7veu+HdjtAFpYvoY0m5sDz+fr5hKhKa4PAlUG74y3RkZrxCQNB7dBKo0uc8 qYycQ/yh3He7D8ZOIVCpBmMOs7rVRwupNxsAu8fuOdIif7+/XXQL33tUH6Je2X3NWo17 DOug== 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=4w9TuqB+Wh/IgMQszmtMNOuKxNZ/aMG7k6ZFrv3n6zg=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=fnnJTsOD8EnEQA/abl1b/Y3ltdB9xzZg8RR2CnocunXsB31uTHi3e+BhJM5I5Tu18B fN4JTIrDGpRtuhf6AexWkttNIb/5E0kdi1mm3oIPOe00n0jgDg7DQkKRutDcTjVpkpfn uZgg3SxblSObVhyKSyteljsEPZnmCCxnDj0xmiOrSemXdNBGeS8Wh3C4glp2MMkGr94e n5eexADkbvKesQk7ovEclPm1XouVbXWHvcS4dK5kFX4BLjTU10DUuykWcgT+VYKjV+tb Vw2cNn+6ivvgN0vB+eDz3LoHsdK6H77GUceYhA4poIi3jIkiRfYXXyrRZGuoUQBaCWP3 gbmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f1fPYWVY; 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 dc2-20020a056214174200b0066d08649238si594966qvb.501.2023.10.18.14.53.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:53: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=f1fPYWVY; 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 1qtESQ-000196-Fz; Wed, 18 Oct 2023 17:52:05 -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 1qtESF-00016t-54 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:51 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESC-0004Oq-Lp for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:50 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-57be3d8e738so4124982eaf.1 for ; Wed, 18 Oct 2023 14:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665907; x=1698270707; 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=4w9TuqB+Wh/IgMQszmtMNOuKxNZ/aMG7k6ZFrv3n6zg=; b=f1fPYWVYztKEg0hCwjFVvX5Yspy4GcWq+q+jPstbdfPN0Povgw1etSBhXj6F3xm9W0 /zMysTA2j8BRh9WMsxIX/U95/48nBRUY6zgC5FCuK3Fys8wUlj4zN/+6RIwid9etY3+z yVfm53FiDRnaOF+Eia1Y2n0VIe9r3YEZhqH7eGqACGyPinJVPC6MvcV0VCCgvFaYMhEf Xkuhuv2WPz9SJ+ELUtFDCDD7/CRGApyK7TWEJsNpf/1SglCphG7UUV7Z9MHKwjYW7art rGRE7TYhmFEGKFXajHWnHuonsKFovBcQfCYxJ6rXpTmKP0R/KIXqwMF2U5aNdQF4N4gO 6DGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665907; x=1698270707; 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=4w9TuqB+Wh/IgMQszmtMNOuKxNZ/aMG7k6ZFrv3n6zg=; b=bZ+545h6MMvk+5/adbfPGJ8jBPVsJuYSP1rxKcZmCuOnKc45OxTde6Xb9gr2J0aiaM ySm2TFILTxZjKcrgUkK9I/AiTuje7fS7F+XTDN/oqns2FI4VdHRxoatoKLg9grOIKJ/3 LQRKmyJ6kOJS3k06ZOdCaCkqgRy3xkQBTxPs0K/ZsH5ErWju4rlYBfwLMxw+W/HBDFwg VeJEr3pwhsSYcCtzFCtHyx1taETzGWu3vxxL71bnbfiooRtePUYKB40tTHZqNRgVnle4 5Ren2zEW7q5rHsQcF5TmIvRJ0TDSjEpaDZano0ukOf5UGb/UNhmaxaZbaP4Sk9zC1Szb Kw/g== X-Gm-Message-State: AOJu0YyCTGQwggZvYtmBoOqUL67CIx9kFbyXkmuFGZsjybeBMIVFQAuy 7lWj4DM3rNyvpGVF9EC8jdko22obAHx7QjpFg5o= X-Received: by 2002:a05:6358:c683:b0:141:8c:75ad with SMTP id fe3-20020a056358c68300b00141008c75admr262733rwb.28.1697665907467; Wed, 18 Oct 2023 14:51:47 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 13/61] target/hppa: Make HPPA_BTLB_ENTRIES variable Date: Wed, 18 Oct 2023 14:50:47 -0700 Message-Id: <20231018215135.1561375-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2e; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2e.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 !HPPACPU.is_pa20. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 16 ++++++++-------- hw/hppa/machine.c | 6 +----- target/hppa/cpu.c | 3 +++ target/hppa/mem_helper.c | 41 ++++++++++++++++++++++------------------ 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 743fc90e14..22690e351d 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -210,15 +210,15 @@ 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_BTLB_ENTRIES(E) (env_archcpu(E)->is_pa20 ? 0 \ + : PA10_BTLB_FIXED + PA10_BTLB_VARIABLE) #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. */ diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index cf28cb9586..07f8ebeb6a 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -133,7 +133,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms) 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 - HPPA_BTLB_ENTRIES(&cpu[0]->env)); fw_cfg_add_file(fw_cfg, "/etc/cpu/tlb_entries", g_memdup(&val, sizeof(val)), sizeof(val)); @@ -429,10 +429,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 ed5b6afd10..41abdb04d0 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..b2a75f6408 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,13 +429,16 @@ void HELPER(diag_btlb)(CPUHPPAState *env) hppa_tlb_entry *btlb; uint64_t virt_page; uint32_t *vaddr; + uint32_t btlb_entries; -#ifdef TARGET_HPPA64 /* BTLBs are not supported on 64-bit CPUs */ - env->gr[28] = -1; /* nonexistent procedure */ - return; -#endif + if (env_archcpu(env)->is_pa20) { + env->gr[28] = -1; /* nonexistent procedure */ + return; + } + env->gr[28] = 0; /* PDC_OK */ + btlb_entries = HPPA_BTLB_ENTRIES(env); switch (env->gr[25]) { case 0: @@ -446,8 +451,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 +469,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 +489,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 +499,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 Wed Oct 18 21:50: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: 735110 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226579wro; Wed, 18 Oct 2023 15:00:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7lUeu8saR/8i2CcyIU5dU1qmytFEhxcBRcvYdiT1KMB6GZb59vttg8DbG9Dme1FIrfvbv X-Received: by 2002:ac8:5cce:0:b0:412:c2a:eaef with SMTP id s14-20020ac85cce000000b004120c2aeaefmr554667qta.11.1697666426264; Wed, 18 Oct 2023 15:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666426; cv=none; d=google.com; s=arc-20160816; b=ZAjIvWZ2+IeE7JFOuXU2giZPV1QCNp+oECtuGZ5BAbD2OtcYHSck/flTzg7ZVmAayo VnZXurJkciyjLWG5Pfym5gamfDbUrTFwD7YxZvZvvi3OvSCSCAvndBmCQmf1oralR1Tx hf/jTe8A+qwa5rv1jOA6H//A2b+V9irFpl/EdwiDrHC4guZXro7o3AxLvWvC4H8t+AwD m3CbNAI+e6AKPqCRyw9BrFlFQq1Y1sQGGgn5TpOXN3Jah5IDt/y3R2k23DHN6SIx2Y7z kUhNukPPeU0jnGn3niYhBtC9O54jk6cfQil4BZ9Vra6k0PN7AtGmk6Qsng1FvLvPXYbC 7cCA== 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=LHeZQ0Lg4r7zm7nc2BLDD9ln4Dja/Hc81cMiyiTh6zw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=IO+88R+QOmB2DUEHXAH7rQ1gupUIaM9F3r+fVzpefk4sOmc/RQs4w1eURu424C5QXh RHxk19chJREG3HR48Z56nXuvur9pwAuihbzryCsM01OfXoPo9k5T/dbL/PUsq2tVWPTR 2V0b6/SEdmeFWv5Z0zmpbPLzwkj/H1CDiPtjhpY4O0ePFgX+sGcjCwUUEnpYM/gOTrep nPOaZuxYVKC/kjMpVgya7mVUiERpM0fsRzB/2MUSthkU/mExTI7aOOzf4VDLZog0qJgc BmVF4sQz2CdzMQValPBdmHk16/JWzoN+OqelDIRGpMAKCFHC/in18FQemOOlqp4DheFP 4Ujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AhUp6N7k; 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 a4-20020ac85b84000000b0041808244656si594066qta.313.2023.10.18.15.00.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:00: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=AhUp6N7k; 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 1qtESa-0001a9-UG; Wed, 18 Oct 2023 17:52: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 1qtESF-000172-VA for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:52 -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 1qtESE-0004Ox-AI for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:51 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6b497c8575aso5392605b3a.1 for ; Wed, 18 Oct 2023 14:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665908; x=1698270708; 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=LHeZQ0Lg4r7zm7nc2BLDD9ln4Dja/Hc81cMiyiTh6zw=; b=AhUp6N7kuWu2/psqdAuyMZUv40+lHb/uAkK8tVvF6wqkIaQnaXVrb9JzrC+lUFHtIk INiUrquQM64Szykrl8Exj8Gf3N6WfddGgv3lizC0om/yXtOAFz+ENJcQOWM3AouNOXP8 vsDkVG93DZLq40m5KuiFmpxPigznWT0hndPJi5xrpAjCZmztViyNKCwPJjNoeyAOct8/ agSYvyeySjWFY+2xChzAqDLP5peIMv3iFlCIofQmF0zX/hyv2jDS6xbFFnAckEtjbxyN 5IC0CJKJHU0UCOpRXyJD7wfyNAQc6/hlIBIIjPBHm6quUuImJc109GeHGsG0aB7lzH1p b4og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665908; x=1698270708; 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=LHeZQ0Lg4r7zm7nc2BLDD9ln4Dja/Hc81cMiyiTh6zw=; b=J4r0W8bYg1p/KP2L7l1SewdgcxmMzxbGtx8+AlkyuK+DMCNLGgoppxy6FJ5KlmRCqI zY6NMAYj/S/ZQhyNs4ML8AIXsW5J4PZ8VrvVtjTq5uA8ZALs/JIeHQavqo7JZkxUvpqp 1v/XdGYP7CZAEmqRdVM+lYBguZTCwmlJ+v0AaJaZYsqUDmXQRzLc68B4/2Q7TU0DqN2G 6l4ZbgoGbQ5JVButuXtqvGHYVjZ/qOR8BzKzaiFPo6OgAm6psVbkopZFbTcsZM0yaQ/e Yj0S+YqUW1/5FHYqzyeGGRDW9Pg4jSm4bOWmCF7oFFtHpfP3k44sWnyn97g2h7D+AD38 TpJQ== X-Gm-Message-State: AOJu0YzyLs7++w25+3fSCLCeI+vplC9e1S6BGPCWhiMBEw1BUvjAAjW1 F56GU441mR/BHpDIHsac+T9cG4/IUgPTFtJ5AKw= X-Received: by 2002:a05:6a21:7741:b0:133:d17d:193a with SMTP id bc1-20020a056a21774100b00133d17d193amr382198pzc.59.1697665908207; Wed, 18 Oct 2023 14:51:48 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 14/61] target/hppa: Implement cpu_list Date: Wed, 18 Oct 2023 14:50:48 -0700 Message-Id: <20231018215135.1561375-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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/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 22690e351d..30010858a9 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -365,4 +365,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 41abdb04d0..1975aa9621 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 Wed Oct 18 21:50: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: 735086 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224811wro; Wed, 18 Oct 2023 14:54:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGw6EjoTUtfVgzkppT816fl3R4jOte8RCSaUHKGKQImRcZ2ldWKVhJFnK9ChoBc/rHUIsMS X-Received: by 2002:a05:6808:83:b0:3ad:c497:1336 with SMTP id s3-20020a056808008300b003adc4971336mr361921oic.16.1697666046185; Wed, 18 Oct 2023 14:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666046; cv=none; d=google.com; s=arc-20160816; b=myPjTyI4hoeSwAyG3HWO2vz8wqoWnpIfkUwJHl7JNUhAyCPb6w6dRJ17BJ4ji9p6P1 Rm530akyqgaVQVjqCEBQk/6NsXnZAQb6hj99sXfkMLtcaNSvz+8Iq1s9WfwcALuNLLS5 HRmWOnUHO60UnDwSuzzxqrN6nRryWms/zUlzrKn9loCHjpFGhIn3Sx2H9btlCb6Zi8gz nBl8PacO+oqvXkOemm1LrqE38A3PitWDkGy+bpqVpyueki5m0f1LUAsGa0EGTGQmcv9t uAiTaanqI5N/gLbQjiUJs2eewGdtr/59Gar2Sl/WyFWlK9LpN+eOAt/nYgPDAE4PgIDf DfHw== 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=BuwEn/6tALxgxX8K5Z/25NI6Kvm0qV/PZyiXdtk4l3g=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ExOixfac8jL17+czZaFS5+so5wnBpMTrMJtDc5FJQfmKo5jjJ6tWCgN1AiA4aMB3at XaXqEvR98ot9NmS/l4BoKsWjdi7uWUzy+09ibpUQPGo8ksSBNK9ptWR48WL8MgRPAv6/ VIyekv3LmnF1ShFaHsyJap6TQnL6D58svC4xxloNnm6nUMfqd5lq0KKLaiRH3Zycietg 3Pkhpje+2etnmCuf1DjOTn5UtvuBXkmbihkuTyNqxqaEgh68TVuflDWIB9qdxWLpp1my dVau88gB+3AB897sXx7e+lTSxhAWhOeRvfcK8NeVjVDrM/SFPFnt8cYyNt7E60y6bOlA nj8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cS4i09oy; 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 ev2-20020a0562140a8200b0066d20730d37si609169qvb.111.2023.10.18.14.54.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:54:06 -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=cS4i09oy; 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 1qtESi-0001nA-3I; Wed, 18 Oct 2023 17:52: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 1qtESF-000171-Qu for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:52 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESE-0004P1-AX for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:51 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6cd0964a994so634634a34.0 for ; Wed, 18 Oct 2023 14:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665909; x=1698270709; 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=BuwEn/6tALxgxX8K5Z/25NI6Kvm0qV/PZyiXdtk4l3g=; b=cS4i09oyx+YNPo+afAne13vVJfcog+vH08H05bAPOhfcRFFY7LU66CDv1GrNe6oTe2 eUQuC6m6PXCUV8OfKTGmEREklFCLe+jvlQrOCUDx3s4IOcAAj2lkRenJ+AunZc30ZwbD 5iaRCnvJ7ZX/SiNAEt3cCLY5+1y0r2QkxefunOD0wNB8pBh5rVfCZGKtIbdHXPbcuWZ1 5/ACpGyM6hiuV9nIDFG5lUjWdso1gBakKG0Mifqp7bS0jgBZ5uthqGC5yTJQBI7DQrXd jSRlBA+gB2c4u96J3//jVWEBQIYHyZeuliyaO9uyDViEF4MhLeeaDCP/GdH6fdCG+/cr 0OLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665909; x=1698270709; 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=BuwEn/6tALxgxX8K5Z/25NI6Kvm0qV/PZyiXdtk4l3g=; b=W6WzgdAh0pY9qNORNPyEuAUQ48wpdfVvmIdwMK3oeTy2/kcDS5+2c4irccHjyexeb+ ga/oQV2AF+1R6XqdgcPhPpFZg25WAj+7zTeSWHh9/i5QGnkfgK4vwqXztItYZXrR2S1/ d+YhW3aP50mOpJikhuCUvu5tj4TVpNqNtr5V6iYJyaVvrGOjtvQqsg1eaDf/Ed/+aSyh 93ij8UQoyy7DDI2zmBapBgBBksply/lY4U4jX8kx4UENxt5kLm+cLsj4kM7KZ1yeyGJo Kksnaw7BMOqDj/txcCuHiSpbwq63dOqzCUd33iZddOKOvq/ZCvTSTOokMWK7BB+RKthb B2zA== X-Gm-Message-State: AOJu0Yz6XWNcSN5dWgrwpiEEE8w+vDCrvzUWBZkj1ahUf8X9USweb2hF goLNvn/yf+TYJdFFuvivtz+nS28ZwlcCLHzM47Q= X-Received: by 2002:a05:6830:3493:b0:6b9:bd9d:e333 with SMTP id c19-20020a056830349300b006b9bd9de333mr831791otu.3.1697665909039; Wed, 18 Oct 2023 14:51:49 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 15/61] target/hppa: Implement hppa_cpu_class_by_name Date: Wed, 18 Oct 2023 14:50:49 -0700 Message-Id: <20231018215135.1561375-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32a.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..9bb865ae92 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 TYPE_HPPA_CPU; } #endif diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 1975aa9621..6bf415139f 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 Wed Oct 18 21:50: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: 735091 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1225863wro; Wed, 18 Oct 2023 14:58:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCv6YviscyEuB1JGsvrgAsl89HR3r1PfLlYryzokBwgzz+cpz+5/5X1uUEgdAyeE2rSSl2 X-Received: by 2002:a05:620a:4550:b0:774:3147:425a with SMTP id u16-20020a05620a455000b007743147425amr482198qkp.16.1697666286899; Wed, 18 Oct 2023 14:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666286; cv=none; d=google.com; s=arc-20160816; b=ih/PYGWo8ab0aYLUVxOIKFmHNDpwIO5T2d4VVBElX0VRkON+k3PTgwopH5AdoqR749 4qe0i/49t6UuuHOi9KRmyJ4ox3b9aZUQ1J48Ysw68doNbS1MbBxp9iOQC2dDqrEYwVLF a9d5d0s6uh2OzgJev/n4GaZQffo8pYlpL4xqfrV2y7IuxykX1HjGHbm0/tyr+afjJdSW 5V8aFJfg0j3zNqSE8XIXnpt8urGMASsMmSFVzq8w5kbH+u1bXUvP4WV+47BAPObgwCeC puXrvKoS+F0oNCB6emKAjsPLtvdnzrkNqH9en8Ar7xPTPshW+Tw+HFBsrAsNvZvaryeN zWLA== 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=KPk9VlCAjpCD8p3ZbSvb+o08mQKrjmWkggjvcwFuWFk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=KdOxhXHBdV0PDXDg2mfqnnFYPKszbhBjUC7/9j0PRKwZCGyv3mp+EFufXs8Xi/MSIB 7ULqQYSTR1PKWGsf3R25OeEisWq4z6iVIHbqwRGaR05BN4muJJvKH+GZXE1dVQVDZkki ZI7LHgtsAGAzmUnk70ShBQ2PEtAylBwzfPIRmSzs91nts+fYrDB9LnCNzJjSXGu4Y3KR DEwlDPW5lI4EHBYM4u74MulUmLT4pH9OvRgwTftznJ7FxmMkO4OMUkKQeAJIL4uW10Lq c4IiReUXr3GuJJnL3Y6ICwipdReNkQJ3VL+wDunC2fWmdZJsKTheuae4TqOFITY+s0tJ SQ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rFx9Bv/M"; 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-20020a05620a425000b00773be513ec2si666381qko.738.2023.10.18.14.58.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58:06 -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="rFx9Bv/M"; 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 1qtESg-0001ml-Il; Wed, 18 Oct 2023 17:52: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 1qtESH-00017b-7z for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:54 -0400 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESF-0004P8-IL for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:53 -0400 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-57f02eeabcaso4483952eaf.0 for ; Wed, 18 Oct 2023 14:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665910; x=1698270710; 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=KPk9VlCAjpCD8p3ZbSvb+o08mQKrjmWkggjvcwFuWFk=; b=rFx9Bv/MTRbEoI4GcHbtb8Ev+Jvvyq9OUZ/WSft2c1xZ2FC8EZ5GtC3iS5bt702Tzg osooo9FGLK2xF8Z6TZe4VFDx8AX4Him8ctHBKa+1zgfWg7EuiCwvGu/0pv2NipOJBFui Hmt4fjUje5lzW1ddI6fKVOIpmU0bG/hIoJ+qgyPCde2XGDnJqpuht6C4S/waMDFo8OKA XnRcjLzUB6P5BHFr+I52wDPZid/WTAWFdJorKnqYLUKz8Bpp6mvLQCekumga8T0deIHq 7BRgIbcMHzIC/X3iwVMMOdRpo/4AOTpMjj/BXfFLRn/MNSVXVnPetiu8avsdVLwJb2qc oMww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665910; x=1698270710; 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=KPk9VlCAjpCD8p3ZbSvb+o08mQKrjmWkggjvcwFuWFk=; b=fg7Qup6fkhUljhWWztdEq5p/6iwHB+bcK/tzTHZkwpNe/WzRLVv9TJp+zqWkXD5cqD pRv25h2cDaOC2l2C6Uo3yavJi/+RA92LZMPLaF6exnGAxzztos1eS75wZjBw2MecoGCs SIr4lPkBvNuca6/IsQOAy3wOlPmU4l6WRkOE5IBGB0mPtam7NxMYY1A7Q7DBqLU2AyO9 5Bw3bKTrvcWzW58nmZ4pFGDz8xmB3dcxBUpweaEEd8uXWW8Sq29FDCYDu6Y0wLwexTME 1Cc8O+RyhG3yNrhgik+5ZYCnwD2ErTvbSPTZDSiUbvE7F7YVb0W+xRVxC6ymIy2X9ice xf6w== X-Gm-Message-State: AOJu0Yy8+ygBWLd5SHp7rcM0WVnPHe7FwrkYGhWT4j3A/yD8KQAJNqjN Hw56SXg8EmFqvHj6PyyKUFfvJ5w7QSs8W3liZPk= X-Received: by 2002:a05:6359:6e8c:b0:166:e779:7ce7 with SMTP id ti12-20020a0563596e8c00b00166e7797ce7mr212479rwb.32.1697665909864; Wed, 18 Oct 2023 14:51:49 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 16/61] target/hppa: Update cpu_hppa_get/put_psw for hppa64 Date: Wed, 18 Oct 2023 14:50:50 -0700 Message-Id: <20231018215135.1561375-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2b; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2b.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..40e859ba08 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 (env_archcpu(env)->is_pa20) { + 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 (env_archcpu(env)->is_pa20) { + 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 Wed Oct 18 21:50: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: 735129 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1228496wro; Wed, 18 Oct 2023 15:04:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzhGmcr+U50wWeSiZ4uhoC20pryyY6twHkcJTwfTgcRjeTruPuUTIWjVnYU6o4eliRPrUn X-Received: by 2002:a05:6214:e47:b0:66d:19b5:9a3 with SMTP id o7-20020a0562140e4700b0066d19b509a3mr714059qvc.29.1697666653941; Wed, 18 Oct 2023 15:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666653; cv=none; d=google.com; s=arc-20160816; b=MjlWAjec+X3ef+Vwts+QdiltJ9xUKdZoPXzPa8MknZSzk3k9jH8I7zc3XHQIZ/fm+s RwYn1kU12L0QAgFcwck5TAOegfP9oQ8nya/em7CwzbuuzvNM4tpHOa5utmoZ1cFfCd1W mDNKlK/29+53jeg0WR361rVhL0s+t6BYvaYJJJ4Ge/+eRXb0nfLiv3vlrmMLPQwd+e8Z aadxqMIr9RGIndh89rRwh3W3q88hbw2WPzc5hLJditxoLM4XtYCoPNuqoEfQe2UJ6EDm 7xplalqsPncnE26waHXlkB4zEG55FLhFPocZkeagi7C/ury5mx7iRQ3+Sgj9ctppF5Za 7Fyg== 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=0ZXU+uJQmMW+4OCGtgI6BB8XXkY8PzpFUr5ZBWJJgxY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=HphxtZ31HttT1qesF2/UzVDQI0FBawvrjd/FeUV0sgr7IB0F4N4qF6HuXsPfXqY/Vs Jx7eY4ATq1slej8QZiyY2o0rz7U4gPRfcpHAlLu/Bjv9+hs8ZzsRSNkIYopvgYQ/I/Zj uURvTI+iQomgkYT8OG/v4OwE+sUXAOG2lSYGAGm9wzRD33itD+Km2AbHNT1B9IkVacGU i+ErGJbnc1t4aNCK/AIlAJn/ycQ0WtsYRomDmyi5xrheF3+xaSOL2oRocwg9AgXgWwKN w1P7Fyh8fC0Z71+wcjcZmpm+a3Uwv3SernC3UJ85qy+6H9J3Kr4fgH1Fj49Yg8R3mdKc rx0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O+JSM06l; 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 e3-20020ad450c3000000b0066d0f75bd25si602753qvq.614.2023.10.18.15.04.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:04: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=O+JSM06l; 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 1qtESd-0001fc-3L; Wed, 18 Oct 2023 17:52: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 1qtESH-00017d-LU for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:54 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESF-0004Py-Vu for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:53 -0400 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3b2f5aed39cso139979b6e.1 for ; Wed, 18 Oct 2023 14:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665910; x=1698270710; 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=0ZXU+uJQmMW+4OCGtgI6BB8XXkY8PzpFUr5ZBWJJgxY=; b=O+JSM06lhx7BJ0dhSVsnkju510ez08BeqgOpOrFUVIGB8+J2yqgx8p9jJVSi3DYQNo VBa0TSdfTlsWvPLHKXRYfJOIQe9NEt+4u9s58KUXmFOPLlZ6I/1YeELvAgpt2kKFNYGN fioElGPMop17jiaiDYbevX9TINTnE1+4XX4dHYpYI2m70kYANKOyQV+QxxEc+RsNg7PR 2FXrEB4S6zS2U8ktVqlldKqQI2I7Kwq9OuWF3yhMOUd00AMQoljNzuXTE5VeJUN4M0iJ tURuFT2cev/0V3J8r6uWECMXc0hlBDE69zJrViiamOTe/HAU6IUWH0zN8auduKCYPvWD H5nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665910; x=1698270710; 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=0ZXU+uJQmMW+4OCGtgI6BB8XXkY8PzpFUr5ZBWJJgxY=; b=Alo8A5eosezsrP62rqSs/TvXJtcdVmdc7tktKd5dw01PQ/7LtFW5a7BT4Rad5v9jKh mAJt+wlU1QO9yota9KzeqlfFKDsvJk7iJcb4eU5BGqsYdsVWURToUNj8/n80zZVHSuGM 8BIBZtB8uP7RclzICMjnOGJFiXwdpeawvHH0MkpDWMNgSrXKtTUFSvC1cPRoITR9G2rX OGElRtYbgFb5Vq/DNI3hngMZX3kNNeupy0Pvc+8iG9+9Uj6uL+1LOm7uFJiztJtBzezR fUwaLYUZfx+H+WxeOdM+2551Lbd09qmJbC2TaocdlIEWt8Qd50IQcw9fiKM0o+j7NhQ4 ytMA== X-Gm-Message-State: AOJu0Yza+FaH17SrJzwzK1YokXwAi1uvgt7if6CSnkHATxbBqSBWklQw 2c9K50B8/DC3elab4Pmh8n9jPqJ63TBGxXUBjUU= X-Received: by 2002:a05:6870:10d8:b0:1ea:2e2c:e9e7 with SMTP id 24-20020a05687010d800b001ea2e2ce9e7mr579020oar.59.1697665910592; Wed, 18 Oct 2023 14:51:50 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 17/61] target/hppa: Handle absolute addresses for pa2.0 Date: Wed, 18 Oct 2023 14:50:51 -0700 Message-Id: <20231018215135.1561375-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 | 47 ++++++++++++++++++++++++++++++++++++++-- target/hppa/sys_helper.c | 9 ++++++++ 4 files changed, 59 insertions(+), 4 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 30010858a9..671e43ebd8 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -283,6 +283,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 40e859ba08..0ef890184a 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 b2a75f6408..169e878479 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 (!env_archcpu(env)->is_pa20) { + 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; } @@ -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 Wed Oct 18 21:50: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: 735103 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226153wro; Wed, 18 Oct 2023 14:59:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHS72c/3IuiDKkt7LAdIt2ZsGja+AsM8L2J63OLK3+ZnO1nXxPMZpbfKQfDP2qzjoE2ELq3 X-Received: by 2002:a05:6122:4693:b0:499:696c:7810 with SMTP id di19-20020a056122469300b00499696c7810mr528331vkb.0.1697666349648; Wed, 18 Oct 2023 14:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666349; cv=none; d=google.com; s=arc-20160816; b=vFEIv/ZNwA0lfmlk2zCO1U97ogXjyD1NA1UT2VZPXtOAz2YviZYnrJeVqF8k+fyxMP JSXTgoi7gEuMgbh6yadNxhL3Sf0KyStZBwdW5ALg/UbkmFnwlh9VRIQ0w4DExf+Qt61X MGCVxIa5+o2lws25jfwF/5Nf+7KXH51qQX6HEr7Ur2+rHbFOWEiVi+sSf0YPF4fEzqln 6xSvrzUun559pY6tMPno+Uazb+SMHfyTlHJkPC1olHT9vV3VHKrrWJDN92ssytSEwmFZ ysG4JbiVy5dU3pjyagGdcxz06EWMrjDyVA7ornKsli1pg89QNcBX3WZomWB6Z+7QU3QD GYow== 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=gxoeDFewjCpExZ9mTpKevDYx6+NicYXRP6vcBDYf3yo=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=zIqPpNAkflNDYN6qwifAYBCnGsvC9aPVBCN5dYwLdyAkbyRoVkC6ai+vGqNLxJxpV0 XUst7O37zVVO8XrI6+YUJ7B7itvRvdEREaEtmPi1wDF3hLyOXjXswc3M2z05LQIUQ8Pz lwKMMXe5g4lIWn+MyeJHHcEv8OHbDfFUcFp2S/ZeYsbZO5ROqqgR0k17fPvmwhWyuc84 oo6S+YEpvZ7p0J2QEbrnRSKyvW+erXvJgYnhxIieUWjGmzOfU7yfAbNtWA/7XCdPkbCY PHRUXwblxb6ReQFjfv+ioOnfqkkwIyE0B/yRwGlZ3XPC7FomQK5oIlOZ7P1dmEoGZaU/ hFiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j5Aut7FI; 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 j21-20020ac85c55000000b00419785380fesi628831qtj.508.2023.10.18.14.59.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59:09 -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=j5Aut7FI; 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 1qtESY-0001Rq-4J; Wed, 18 Oct 2023 17:52: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 1qtESH-00017e-Rg for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:54 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESG-0004QA-EC for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:53 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-57f0f81b2aeso4041299eaf.3 for ; Wed, 18 Oct 2023 14:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665911; x=1698270711; 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=gxoeDFewjCpExZ9mTpKevDYx6+NicYXRP6vcBDYf3yo=; b=j5Aut7FItsu6la4W/zIHqt51lWIp6FKUBwn4hOOghnw8rf/uRYah8IZUQUCt1qC5bJ sxFVeaDOgxA9RQWU7/YIFSeAhGQrkGxDKlrz8sms4VCTZIVJCKrGHWpwCiMVXyBTU/J7 kjmh8kErE4T8grLQ0zTj5pAiXtSqgXWVV7YeSRITHMjJifEHQ8WVNdD3cHHAolclgAwq tIgCIndttowTr7QfL/qclJuYLMCNuW2zm/3EBgJaCxtUb7WBHGA8wRiLZMFg/FDxrdol BVQRf6eh/bKxIec7VIOa51UkUB62FWIPCZyTsUH+PM0UkF5oM/XJOCaN8hmP9lmRkQSU p3Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665911; x=1698270711; 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=gxoeDFewjCpExZ9mTpKevDYx6+NicYXRP6vcBDYf3yo=; b=RTw9LGSUEA8wpDwM+e1tZnIwcgxI4zuPYQKvAACMKyffvyNzCExZoLR5B7IY+pqb3/ Pswbmzhx7gcacQ6PGTkMFnpjyk1dI/SrabaHCL7RNlTvQ5nN1tkbW3XLe2AiEAMdUuwc v8W7nlHaFBX7aEpmA1wxaDx/l1WUkl1g7VVqWryVV4b3WuUCNI5K5AANfTsV2qh+1wZH ROv+XQC40NmoTJwxyPvghZ3Y512y9OJlcr3dANtmsaTGhPR1/FzVdzYZxAFXoOGoLcGy o+a5O/bVhgci1vK/dnYCV/c73Th95Zoq7i+N7Yd0SJZU4s0JWVhK1pgRX30UtwULyQ1o bFqw== X-Gm-Message-State: AOJu0YygV1/3NAMfi1x3u1BWTx2WHwgVligWNdEmEEPm6YwcT3j0Iqqt 7JQYW9k9WCsRkLjb2Q+oIBJGx9z9Wru2E/guFYM= X-Received: by 2002:a05:6358:c62a:b0:166:a6e3:cb9c with SMTP id fd42-20020a056358c62a00b00166a6e3cb9cmr296039rwb.5.1697665911306; Wed, 18 Oct 2023 14:51:51 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 18/61] target/hppa: Adjust hppa_cpu_dump_state for hppa64 Date: Wed, 18 Oct 2023 14:50:52 -0700 Message-Id: <20231018215135.1561375-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c34; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc34.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 --- target/hppa/helper.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index 0ef890184a..04cdbafe9d 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -124,13 +124,17 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) target_ureg psw = cpu_hppa_get_psw(env); target_ureg psw_cb; char psw_c[20]; - int i; + int i, w; + uint64_t m; + + w = cpu->is_pa20 ? 16 : 8; + m = cpu->is_pa20 ? UINT64_MAX : 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 +155,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 Wed Oct 18 21:50:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735092 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1225951wro; Wed, 18 Oct 2023 14:58:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVljrrFP9K0s2riVU4cEt/pGuUhg0IqRfrqPSx+BKSQfoBT3gQG1RDZIXaXahHASa2YALh X-Received: by 2002:a05:6808:52:b0:3b2:dd87:fc with SMTP id v18-20020a056808005200b003b2dd8700fcmr444273oic.2.1697666308589; Wed, 18 Oct 2023 14:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666308; cv=none; d=google.com; s=arc-20160816; b=cZJDXu36+Ue9xL4bIhnvN2zg5LzlmzHqnRDkw1SV3AmQYvjiikDA8ds7AJllnvjLRF CtmM3GuDru2QouLwfy9tVqttnaGi032mf7c06IGus6nmSha4FFDsWJ2T5YmGV/l8C2ho AHmp3g8OMSRsPbsVwjx+26aQLyMukkgaAsOsBB24VxZvh7TQD97OEP8p1k31Yjzs+e24 BjJySxNi9/EFOzUdY8BZ/5a1FOlFggAi90r1Ao2zC+viILt6VE2lTRzwWluey4GeJnpD CM6DjDxxfxw8CL21uZypPbKFQ52gj3khGsGdMOyM0yd98k0qEqQuxmnRwBJJaXGftQ/9 AZVA== 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=KZ59Wqyg2YQUe4NJ15oFoXlcwSLtPJhdE2Dc4QmCfGA=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=NcZIgNAYRAVFatJ4AZLmQTPubCkNutZ2J/gD6vYVWerDQtZhlTZ5T0oONbp7S1rQ3z rtPaum5JccecjY4Rg/KRDiaHDGWd1JCo497ttfQY6CEaANTwi9Dn1dZaHroVzI93zC3e T5OeHTZXVZxZl0JWRa4KyRQBrOeyu5wP+a9xkiyBPPRX/hLFY2pT/rqMgnFcbIDJfNVm 5Nj+l9LL2DfjE7T1DyDnykhqhRGPZhPOjV8KQNRfiG4qZettm7DDuTx/86QIK39Vc+55 V4vMA8ob5h1+mfsdtethc0mDvHDXTQ02a/WEhEd/E6oFjMeS9295eR2Nzz9UzUUjS4J5 FKLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lbLJPekV; 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 c2-20020a056214224200b0066d03c88ec3si686643qvc.236.2023.10.18.14.58.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58: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=lbLJPekV; 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 1qtESe-0001jC-0c; Wed, 18 Oct 2023 17:52: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 1qtESK-00018l-5z for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:57 -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 1qtESI-0004QT-1w for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:55 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-68fb85afef4so6054511b3a.1 for ; Wed, 18 Oct 2023 14:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665912; x=1698270712; 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=KZ59Wqyg2YQUe4NJ15oFoXlcwSLtPJhdE2Dc4QmCfGA=; b=lbLJPekVhsqw9nquZCAM5lJnt5aZjDn3MSwC3xBFQsKqWGUwAupxrjhciasQqsEYPW CdB15csPcTYHwoYnUDMSM8iMRLNvzBfbg/xxNDxB1VAl7KyTnU2ut8iInnlhvY31n7Y5 W3fJB2h5zZbv6A10YfxeCGbJRRrltrrRGiL0mvadRlAYmwOihTjXOn+Wpm+tGviwb11F YVB94eQIARzYknGlEdcRYSZ3X/oaHjDqNDsThI07sONJYSkOpDBHSv4tN5tTeqtpL7SP y+JWPiy4ilbWy+7EjqSQUgeOfjyQz+mVQGgjvWZUeYDOO+WPJXwyy9lAHp8ui+Z/x+4H 1BuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665912; x=1698270712; 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=KZ59Wqyg2YQUe4NJ15oFoXlcwSLtPJhdE2Dc4QmCfGA=; b=GOI5vgsG/eIaTO9YAR2d+0GrSWQni0uNn8RKJk5leZlssnguElnQwmQ8ahnKtmwkig ioFufyRsJqPdWFdWfEWIiZwYHsj0nZrRcXD3fJClsba5331UcNH/8xw7yt7coByIxwl1 BfYBQThzcq4NrYJMH3eOCL5QagH14bBNVLAs6ODDV8aP3CWLUuODKvE1QfxwgCgZD9N0 2x+ekbJK/5BMe4Aqm/HEA/1NaACM7kOeh3dTMA+3bPyXJ6yqOJR1HutnYmeILSiCSxRS zgQf5d9SmKSKSGzQHtNyLhY9WvmPIMwxp2Do47kpPDHYIFZCBcVkyIpCXFGUUT4kogSP GD6g== X-Gm-Message-State: AOJu0YyH4J60dquhHZhRBFio1GNriXCb12xiMltRW/6mRu16/LZTcg1U /daxUrS5OetGhGbKhiyG209P+lHgI7fGBq79U1U= X-Received: by 2002:a05:6a21:7985:b0:171:c88a:891e with SMTP id bh5-20020a056a21798500b00171c88a891emr397623pzc.55.1697665912230; Wed, 18 Oct 2023 14:51:52 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 19/61] hw/hppa: Translate phys addresses for the cpu Date: Wed, 18 Oct 2023 14:50:53 -0700 Message-Id: <20231018215135.1561375-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 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 | 87 ++++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 07f8ebeb6a..765f338544 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -81,7 +81,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; @@ -90,8 +90,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); @@ -103,7 +102,7 @@ static ISABus *hppa_isa_bus(void) return isa_bus; } -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; @@ -118,13 +117,13 @@ 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) +static FWCfgState *create_fw_cfg(MachineState *ms, hwaddr addr) { FWCfgState *fw_cfg; uint64_t val; const char qemu_version[] = QEMU_VERSION; - 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); @@ -173,6 +172,16 @@ static DinoState *dino_init(MemoryRegion *addr_space) return DINO_PCI_HOST_BRIDGE(dev); } +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 void machine_hppa_init(MachineState *machine) { const char *kernel_filename = machine->kernel_filename; @@ -188,20 +197,33 @@ static void machine_hppa_init(MachineState *machine) uint64_t kernel_entry = 0, kernel_low, kernel_high; MemoryRegion *addr_space = get_system_memory(); MemoryRegion *rom_region; - MemoryRegion *cpu_region; long i; unsigned int smp_cpus = machine->smp.cpus; SysBusDevice *s; + uint64_t (*translate)(void *, uint64_t); /* Create CPUs. */ for (i = 0; i < smp_cpus; i++) { - char *name = g_strdup_printf("cpu%ld-io-eir", i); cpu[i] = HPPA_CPU(cpu_create(machine->cpu_type)); + } - cpu_region = g_new(MemoryRegion, 1); + /* + * For now, treat address layout as if PSW_W is clear. + * TODO: create a proper hppa64 board model and load elf64 firmware. + */ + if (cpu[0]->is_pa20) { + translate = translate_pa20; + } else { + translate = translate_pa10; + } + + for (i = 0; i < smp_cpus; i++) { + char *name = g_strdup_printf("cpu%ld-io-eir", i); + MemoryRegion *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); } @@ -216,41 +238,41 @@ static void machine_hppa_init(MachineState *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. */ - isa_bus = hppa_isa_bus(); + isa_bus = hppa_isa_bus(translate(NULL, IDE_HPA)); assert(isa_bus); /* Realtime clock, used by firmware for PDC_TOD call. */ mc146818_rtc_init(isa_bus, 2000, NULL); /* 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]); /* fw_cfg configuration interface */ - create_fw_cfg(machine); + create_fw_cfg(machine, translate(NULL, FW_CFG_IO_BASE)); /* SCSI disk setup. */ dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a")); @@ -262,13 +284,13 @@ static void machine_hppa_init(MachineState *machine) 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)); } @@ -283,10 +305,11 @@ static void machine_hppa_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)); @@ -303,15 +326,10 @@ static void machine_hppa_init(MachineState *machine) 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 = (target_ureg)firmware_entry; - firmware_low = (target_ureg)firmware_low; - firmware_high = (target_ureg)firmware_high; - if (size < 0) { error_report("could not load firmware '%s'", firmware_filename); exit(1); @@ -319,7 +337,8 @@ static void machine_hppa_init(MachineState *machine) 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); } @@ -328,18 +347,16 @@ static void machine_hppa_init(MachineState *machine) 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 = (target_ureg) cpu_hppa_to_phys(NULL, kernel_entry); - kernel_low = (target_ureg)kernel_low; - kernel_high = (target_ureg)kernel_high; + kernel_entry = linux_kernel_virt_to_phys(NULL, kernel_entry); if (size < 0) { error_report("could not load kernel '%s'", kernel_filename); From patchwork Wed Oct 18 21:50: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: 735093 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1225974wro; Wed, 18 Oct 2023 14:58:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1mO/H9TclyPQDt2PzdUDR6MdLty5hqbuVT7yIOsymRGkTn2ZJkaOCiVRdILiWvHnvDte7 X-Received: by 2002:a05:620a:8786:b0:778:96ec:661 with SMTP id py6-20020a05620a878600b0077896ec0661mr352267qkn.73.1697666314733; Wed, 18 Oct 2023 14:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666314; cv=none; d=google.com; s=arc-20160816; b=LohidqoGCl4WYTnCCq/dCkFfmQvRojVtnUp4ZSnhMkp9fBJKbWfM1g5ks+cbVzydLQ vkC7w3nBH/SWNJN9MsLmDoGw5uMecdI7/FpUDW80wJa7kdEizZImUBHxnJwBfgNoJw1n ZKT8e960ptREsjL5RcEbfs4jB8MMVOjPot6FNEph9WDrFh9DF5QtFfSXwWIqHoUGH/0B Mf4kEOrHe4wdAysitMgddv/KHZmMRTvhIc+lHcjJosA1xIibqq/0PNK6SmOtsuiIr5l8 cFrkVrSAKT+EyfHSBwzzY42wOVldGr1YsR0mv0MwHgUVw53jnxTIFAjHwSaj/6oUgFY5 Utow== 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=G9nUcdEt7w+NCkvnMW2YnG2igY5bd41b5qtUzVj7Mew=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=v22q32eGfTc+inrXzBxuftz28GV53q6RRLbxMY5cQ/6G6KK+RswM7kr2QmGyliq62s VTIaJMXX53lXrePy2FMIwsrmzV9I7RN6lK6A26vxyH+mklvcfGcfJ3eIDefrspFMGPXQ FlnghExzjriurMmMi2qBuSkTbvGjYX2dFKiUgPiXQHrr0AezU6fV8hInX//ivRY3DI8a /85ti2ltdizAMeFcXBnsyDFUYVSSLgiadxV1DIT3hHw+Xi797WRjkaO7y08de7h6IUcP 8kN197YNKfNFRQN1085hr+qCC11yz/YEhaKrE7tW2ygiUmZBlCPDMkdfYucg8tIzUTEY 5LKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GguMiPal; 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 d24-20020a05620a205800b00774067d659csi620037qka.92.2023.10.18.14.58.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58: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=GguMiPal; 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 1qtESh-0001mv-Cp; Wed, 18 Oct 2023 17:52: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 1qtESK-00018k-5e for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:57 -0400 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESI-0004Qk-E3 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:55 -0400 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1c0fcbf7ae4so5076617fac.0 for ; Wed, 18 Oct 2023 14:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665913; x=1698270713; 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=G9nUcdEt7w+NCkvnMW2YnG2igY5bd41b5qtUzVj7Mew=; b=GguMiPaldiSe/RdlR54LmFbmFXs6tyish59fcM3bwQlNmfkDSPnAEBePKfgV2ttwgJ msimo1/SNkxS1PVZ8AsLmT/2EfvhhqAI0b1wOEpTHvugQwK1sT1IppCv8XR3GYKTcOWQ 66yJpB0HMcDME9YF2rrbTQ4+iqLhQSfOoxjsFySfeFPqkVjhyB/HElM1Jr5FbHcXf8Cj WO3p88QfE6mFXihEMrWn5dbZyPUHxljSx2xvryFcgUrfPfFyrDRcIqrYiOGO3BwonCQX 5HKPaGvAnboxL1df7d3wYAuGPj8QkEF7rcnbl1QdfA8K3kidPx0Uddp4BLwf06e1VP5C eEhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665913; x=1698270713; 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=G9nUcdEt7w+NCkvnMW2YnG2igY5bd41b5qtUzVj7Mew=; b=ZN491XaWMaTNoorIkxrC1L7oPUOtht3Ooi9+jECXe6mKtyGNu8a6CBuKK/uqKe8hxR ozxzI2sHt/JbcArEPXv+uKQWIG0KbgQgSpmwuyvQBgOBFjM9EzwzSOBuWQgs/Z09pwNC jHkafhgCrtKAnccJ2J7oMfUxuzQMwKU35qPkMzq2Npn9g/vYD2sIASuoSZHpyHWQjGvy nTVrAfCKeyzqBPvRzax35xMzEuxf+FRiHc5nI8OWJtQdh2m2UMUoVwDCh4mz49YQk1RN o7ZF5qYkQL6aj7jG7ddXlYEVcdHyM/DAFW1hzl7cUuNRHQzi9p2EOUXBGsPNPruwgIPr rfKg== X-Gm-Message-State: AOJu0Yw83egH2qASlM+kZYVmgKEKYxyq4Q7qHFtpN4jTZRkGAe3SHRrw wBAtzM6KzuKlVR6rrz+5dH/ujDeFBsBnRVTAwD4= X-Received: by 2002:a05:6870:98a7:b0:1e9:d8a4:5523 with SMTP id eg39-20020a05687098a700b001e9d8a45523mr543486oab.41.1697665913171; Wed, 18 Oct 2023 14:51:53 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 20/61] target/hppa: Fix hppa64 addressing Date: Wed, 18 Oct 2023 14:50:54 -0700 Message-Id: <20231018215135.1561375-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::30; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x30.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 671e43ebd8..1a12b2a186 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -272,7 +272,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 } @@ -313,9 +313,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 9d6670f91c..ace6fb0ab2 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 Wed Oct 18 21:50: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: 735113 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226898wro; Wed, 18 Oct 2023 15:01:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFG6ULceIK1+aieqtPU80AYCrniJF0MO+26HM0rxwT5baut97HAT8Z523t6uKHXrIW+CZ/ X-Received: by 2002:a05:620a:2603:b0:76e:fea2:cc79 with SMTP id z3-20020a05620a260300b0076efea2cc79mr373293qko.67.1697666463036; Wed, 18 Oct 2023 15:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666463; cv=none; d=google.com; s=arc-20160816; b=Dyxs8fb9p7kN8Rn5EmUW6y71KSx0i2uZCOO9ioqG83Rkt5uHVxCJpwFLLHuE+VWLPU mMQ9NN9e0DeID7pSKyAGdB3u9ttyTH/eYUcRGcI9GkJ6SxxvzXH2aKO+zTl678X0CV0U EkRz3ilo193v3UfAgpMtxzGCZbo2sCDLpwS5QHPDrKWeCxLFVWBtajm4mXZCn2B66HSG Q8cqSGFSLIn4I/wHOBnkyXTU782gozOOJ+IgMUpGgIJ8dZgMtURdWN3yFBsJ5srko4qr 8iwIVLA822CARoFwEdhoXmPaDWLHjvryd6lWZK9Cs+hYXE140K04xxLhrY0uuVt6EKpF 7NSg== 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=WGDc36lTRQBdhZQkVmDvdtL0QhZmZu6PdPoUP7sd7r8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=H8qdisQkmHL3PpbvYubUwAj7jGwFd53ee7SUrA6kjW0oY49lWJgzTTflFnPknCV7+w d1VTdvWse56QZhqz5a4QoZ1BgpJeje0bK2OBoMnUIa0Bvw03LkpWttnnwUFk+asie3Ir JIoknyt0kn47hxgiwJBbIpCCVbuA1RteSZ9JWuT8+eXB+3a1aevkSYQ1EoUJtEmhcQLn xp8r3FWL3J74ynKhllqCjD5VdN+r5K6ruVWYOdIFgG30HDTmMGSDCeXEV9yBT0PcUJHn lgIjmijqjcX3bJmYmQE1Qd0U6c8dE3Yocw+2+jznKCrxvmH6jdAx1xKFE0wMYO8S2vKa brRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JyXQtQsO; 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 o27-20020a05620a22db00b007756e742c01si576648qki.265.2023.10.18.15.01.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01: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=JyXQtQsO; 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 1qtESm-0001z7-FL; Wed, 18 Oct 2023 17:52: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 1qtESL-00018s-8U for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:59 -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 1qtESJ-0004Qw-Gp for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:57 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b7f0170d7bso4677528b3a.2 for ; Wed, 18 Oct 2023 14:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665914; x=1698270714; 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=WGDc36lTRQBdhZQkVmDvdtL0QhZmZu6PdPoUP7sd7r8=; b=JyXQtQsOMxFSd5Mxfs9hY4yueiVg6NpOyncv513blOTqoKCy0/MMxkC9T5jzf63iSv fjaj7PyrkBIuYKB/rxViAZfN1T931RdYVc7+hzJ6goPalEiZyiErWXLuAHKJWEHnLoC1 R69fwuezVcD5eDiT/KUxnfy8/ejpkzozyLZrg85xZDsYThjlQdNd786j0OPSI3PRzYG+ NRL9nhjL8vex9cKIMA7CxSFH8vaSIPM4TRMxT1laGtVbf5pLl+9yWKNeQJieTQaSz/sf yPNqThE7FL1Dd3xruX/XDWW/bk6+ifwEIcyyQIbLcZSf1u5pKVZbWcOZslGRGybt5ynH SaDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665914; x=1698270714; 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=WGDc36lTRQBdhZQkVmDvdtL0QhZmZu6PdPoUP7sd7r8=; b=s116RtT1sM+l4/LKIDAT6a8+LL3Fw9a72fEPmi933hM/W0EsreSGgUM+q5C7rX+gkB qJSzRI0OiyzDO/iicHEDuRzVfIy6N30ykmDmfxpUZj/53eWqMpr+6L4KJMOTs3Y9ncUg 6gTjouNbVp6nMHeNUx5AXXj7cHZRodeKN36tZ1oYBA8CAfTVInrMkyekkkjNCoohpYlK I2DCDKfobPvSx02P9ymTVkCW5bPnaEnrvv5wn479VGYVuyTCR89qKmTQfhpKfuHQjosk rdF8Yupli3dtZu5YvjT9uir3HT9Sjapc8LPho4wYS2kKKbjcOdMJvtqL3aWiO4SPvK1m YZbw== X-Gm-Message-State: AOJu0YyJBUwXuC6NuLz5BJgFhW91Q0daeVm1vIR+m22MSwx1YHDl/zUr DLwZ6aDklqjac18g7OoVgRWNI0wJbmy+qrhaOBI= X-Received: by 2002:a05:6a20:6a1f:b0:162:ee29:d3c0 with SMTP id p31-20020a056a206a1f00b00162ee29d3c0mr393529pzk.42.1697665914139; Wed, 18 Oct 2023 14:51:54 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 21/61] target/hppa: sar register allows only 5 bits on 32-bit CPU Date: Wed, 18 Oct 2023 14:50:55 -0700 Message-Id: <20231018215135.1561375-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 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 ace6fb0ab2..e2b692a6c5 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 Wed Oct 18 21:50: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: 735088 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1225018wro; Wed, 18 Oct 2023 14:54:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmigF3V+rDlVzHx0nTWgDBb9runRN3Aegb0ym3h+OAjRNVNHQwXrGG6liC4Rttm3HYlvfE X-Received: by 2002:a05:620a:424f:b0:777:74b9:219f with SMTP id w15-20020a05620a424f00b0077774b9219fmr537958qko.8.1697666087773; Wed, 18 Oct 2023 14:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666087; cv=none; d=google.com; s=arc-20160816; b=l8z2o1H7l+QMfHEvMnYHgUeZDLus3YHnK0CuHAF9Midg+d4QMuVpPp076Jwu9Usaat tCy1KKeWiJ87uEA4pZ8yCVJb4udi/qRK5ElK8Y8fOgMEeucOow3I+3UZQQqqM/AEHe5H XIqBGFFK6Mv/+FpGhxtBwb9Ui5FtqnB7Alczlxqr77xZMtEiby3LkPbCpAcwbU6mhb6m 7Mf8m0MJc6FNYFQ0d9BjLvmLb3WyxggfCGeSjNDwQ+U+GYg+mvbftOElK3n4zwJlrFGB UWn8aazKzB81s8MiUfMEo4V/jqhpCML1lojW94rYCsCfuXURYtiC6mX+MGJtLsqDsynB 4qqw== 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=io7/0k/pOO+TKp7Ec9Fj4OHEiClXaVK9yG3Lda49zh8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=jl6F1oRaCoge0bJb98Si9+Lku/rc33na7OvsLtuuq7onl5GWxyB2w2kmdoeYIVcROT QNtTkqNgoM1bLZqxVamJuHBcjpYOSUy92Tp+JLRLvd3qAanNj0v0BU2jLFU58qs4kUrh /4Z6coHFHvIGPkRhbI8Ck3hnuUnlHtSuh0jCjiAKm1Xqsf0pTMpvpizNqGsUAreabcJX fiuNMiHURk5VbQ1ssp7CAfPkYQi7ZveJN4lugfRF1174mk1tpJHZvDnGI04ObdOFSAE1 B005m/RA5e9UoT6TOloHbhrotOqd9IDSEssXEuUV7Y9nM+yBNpoVVBzls8IODZy7ksry Jr5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zr2PzKBN; 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 a28-20020a05620a103c00b007756fe9b8desi561118qkk.588.2023.10.18.14.54.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14: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=Zr2PzKBN; 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 1qtESi-0001n2-33; Wed, 18 Oct 2023 17:52: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 1qtESM-00018y-4E for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:59 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESK-0004R2-4M for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:57 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1e9c9d181d6so3933298fac.0 for ; Wed, 18 Oct 2023 14:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665915; x=1698270715; 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=io7/0k/pOO+TKp7Ec9Fj4OHEiClXaVK9yG3Lda49zh8=; b=Zr2PzKBNK44CINttQlE5jN5RD74XF9JTJpe55i1/Af8yuM90jY570FLWFN2VOiH/wi CR/L0LyGcB7vposOfVTWh+c9lC3CIEha8ggO0t0ED20kBznrbk6RER4bWH4YqT73x4zS JAtoEu9zUGDZStxUDuaLi4MQA4bXrjLi6rSf38/XJ/Sfuo1MnK2w5PsbQeXbfk95MErR K+TfKnTqEVTjKd6cpGjHaA7xrgiKvfofoGZ3kIzFcafu0AD6srknCu5zjiYcPkkmsjNe e5lS1Jdl1/+vgppJSy4y9dj06JjUlV7ATONOjnCcdewHbLZaCqRU4n8BbrfwWvCnh2u5 2YTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665915; x=1698270715; 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=io7/0k/pOO+TKp7Ec9Fj4OHEiClXaVK9yG3Lda49zh8=; b=uYo4up3ApLrtJwE6u9WqHqEp/XCGnUjPBdtmZWtCUIR8n3/oj1YISpMw/IO+HbHr6d 7lsTHJTYZig+m/gRzRC8oPNJJx/W7oGrzP74CeFzWcgBpUVJrODHAA2OtVh8Gk6pt16D jl2ombI3uDi5wa1wnuUyLJI1zhMBZc7ouCBSkX7/JDdMSu/6S3y0T+HhltAWLK6qFFDg xFygFuVtzdK6TMl+HXBvGX1XW6JV20gLFAMcDgOKF599D7ZLsnBXRPc+/r5KlYgukoo2 MI75AMn6A6NSzNbS2kZIl3CGKjn4bDTdcSwTXIPxUvBa7IBhws5rs3iiAdoXYeZZIAGA LogA== X-Gm-Message-State: AOJu0YwnCYhDX+F/2oN2HoY2PHmtgZWhVDxMaWljmITy1lye1CUz5hlz 05bK/5DNA17KXO3AM7jy8X6LBgrZvKmone+bbQM= X-Received: by 2002:a05:6871:6183:b0:1e9:a8ff:67e8 with SMTP id rb3-20020a056871618300b001e9a8ff67e8mr608688oab.50.1697665914999; Wed, 18 Oct 2023 14:51:54 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 22/61] target/hppa: Pass d to do_cond Date: Wed, 18 Oct 2023 14:50:56 -0700 Message-Id: <20231018215135.1561375-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2a.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 e2b692a6c5..d6edad9adb 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 Wed Oct 18 21:50: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: 735135 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1229385wro; Wed, 18 Oct 2023 15:06:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKpOP8ikDbi5mIWJR9xdT0ZO5kluv6qPk7toBuFKRzT1OvdA4+3+F3sUgbJU6czqLK7ThA X-Received: by 2002:a05:6214:c2b:b0:65b:765:254 with SMTP id a11-20020a0562140c2b00b0065b07650254mr585077qvd.4.1697666774303; Wed, 18 Oct 2023 15:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666774; cv=none; d=google.com; s=arc-20160816; b=PYYI5vCdI07x04lrTiS0jX++Qwd5UDkm3AFzaszuexvFPT6cEBaeGBCMnhTGzCOA4P RaunodncsK+oKq2VnL+RVrMrkakb8dUugSog+9RTFPSKRmY7U57X8VqTv+VVgPqAiaUD M6dzODnSap+2UCtCzukCRj9sH4+sqmQem8XB7TZPzVYrmB8CuwErjkBx3seMXPywqUdS 1CG2YI9NRkgXmwz4gfs7Sz6A7Id2fkeUZd7PLAm+1QhYEnItJgcpxdnawO0BDEt2oxUp lTl/mb5zOT2jEWXcM/Uytw+Mtr+5vfGlb9rCLcJPrBpT51sAHpF8D4hRArru0RRMPqxC v/mA== 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=UwyqjJ9QUSpnAuYnVaYNZPjS81j2Avs+ZfX6KYX0BS0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=RKMezbXhwEbIeRqyMgEvdXh2xamxicdN2GuW1xkro8lRKMZUpB901blncuo26Iy5FM Nkv36uQ4Jp6o4wOaCVy8H0sZEMp/HL1ovypP8qAeNQdRzoR9c8ELXopr1h84RRdzyqfc D8NaTe1JhQ/dqZ68qH3E55P/nnZMG5A35VDRAMdRNQrjlFxAa8s9k949pJWIE7ySCe0z jZG2EmXwOdCjrA38aQTtTXPLWwNvj38Zuz/PRhSTR00CmUCnD7SuouI+0m3O9NeWzKZq e5VnFzgiKeuJ+WqWxfEUo0/GKxiRgS6BdctdROpQICz6BLabtH5AgspXbNkaKf/jCJ0L IYHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zx9HixpL; 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 bo8-20020a05621414a800b0066d07dcdceasi633653qvb.220.2023.10.18.15.06.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:06:14 -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=Zx9HixpL; 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 1qtESj-0001tI-N6; Wed, 18 Oct 2023 17:52: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 1qtESO-00019R-0f for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:01 -0400 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESL-0004RJ-Lj for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:59 -0400 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1dd8304b980so4636182fac.2 for ; Wed, 18 Oct 2023 14:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665916; x=1698270716; 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=UwyqjJ9QUSpnAuYnVaYNZPjS81j2Avs+ZfX6KYX0BS0=; b=Zx9HixpLkS0tmEtuq9kMXnwQVGGyfxpWuKSrjhmZyKjBxOpTR6Fx8zvECnboEgRamh VxjU6kxaWixicD4ABfkjL7tnurTLHbxxC8dpdgZ2jlKfg0ZSqNCHm6r2xv6da8IPbrPy wr8QiIhFNe9xVNFQdY7Y8MQsaRIaZ4fC7CtfcUsJtpSCzAamo+M5Vm6dyhsB+QDb9l4I DU/8CSU8m+I5hQutZ3MOD4KNMjYJiljEz1VeUcw9g18fvCzXt2yFpfE+hv3dnBrnr7i3 i+3MVa8n7RI7YopTmhAMPqVgFKyzTY5fK+kjH9WlrOpNJ/B9jBsWbk0+T7oT0qEQOrrR YfrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665916; x=1698270716; 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=UwyqjJ9QUSpnAuYnVaYNZPjS81j2Avs+ZfX6KYX0BS0=; b=o4CU4vx3MJLx/z5kpsiismMpQiB/33zR1dNiR235G3nDE2hnvghALRcyJuqTXJgaIj NrbyPN67rC3y7fvS0LCqhRMTqLaBU3OiOFSNJmOtThRddBuGYNpvz+nHsY7gGCX2sCHK yb1Ml3Dp+JOnNYzC5pz/+WkqkCBd/zialxqrGFBUbCs+JN8U6tw3w7ReRAjS8bQ6usyR oz9MkGHAI+BInfOrxrXR4kJIwtXwaE3RdtwsPbfEu/hqAolw6Sr97rjf5LRKYTeQm3Lq akeOj3ZXEhiBWaiNZ9kjBRIbvIrgRpIRalysSb4fs5dozeB2kBH8iCZura6KX+pZWmUd ytiw== X-Gm-Message-State: AOJu0Yz5TYRmODxMciIwGR0Y9hqs8nG5X4U9GWzqw+XdKnvVBxLcf8AR NYVtJBz3+3O+AI/bXiG7lttl/Z0d/FezElm1nrA= X-Received: by 2002:a05:6870:aa88:b0:1d0:f5bd:6d2 with SMTP id gr8-20020a056870aa8800b001d0f5bd06d2mr798424oab.38.1697665916443; Wed, 18 Oct 2023 14:51:56 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 23/61] target/hppa: Pass d to do_sub_cond Date: Wed, 18 Oct 2023 14:50:57 -0700 Message-Id: <20231018215135.1561375-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::33; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x33.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 d6edad9adb..7c95c479dc 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 Wed Oct 18 21:50: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: 735130 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1228640wro; Wed, 18 Oct 2023 15:04:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfFs7yRXnQdRt/2t+V0g6WQ5yRg3hXsnzl11wCt8L5xrQEayLPn5KH+Hf39Gb347M0JXQW X-Received: by 2002:a05:620a:4092:b0:773:be2d:7cd2 with SMTP id f18-20020a05620a409200b00773be2d7cd2mr561115qko.45.1697666671875; Wed, 18 Oct 2023 15:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666671; cv=none; d=google.com; s=arc-20160816; b=nQ7yzBW+w/PqxAPDIMWfDSNjWY6p6+jdwecmusgObrpboxf9AscXHc4PkxduN0NEiO X9Mxs7Zkms43dONK8MkHYe/Ub3kc55T7avXyT930P4S/ya08+L9lmvi0KoNUG7fxnJVU /XA8reO+hUZcxiP+GmOFMiqEBeVwNpKmlIlHU6RlNHmx9rbJ5pWuUskkhR+nJIeEM5pI MLnzRT6E6WrQk+eVUqkKA9P2Rx1ZMYe0+PmXKgA45staYzavZvUWxiZZQGB8Kzu4nLCu C9nxEOFQpcYoBQJrG2NjWa7mZ6vzBcJxKhRn2R5IyKDasSe3C5Oby78MBbzgLQPdMFX5 Q7tg== 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=IzgNOQnYTPtvhWHame0+1TsFsoAlkTYKxkzC3eocI48=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=YanC0fZ6GcmourjfHp6tM8sfFYP0VrN7ElzkRw8WoN4cysh1nh9Qc6DcedIDtZ+t7x A7mRYRon08aLiDuKKDxwayW73G51RHG51UX9EDzH+kWD8lpXbM2wksfPJ9e4WiPtvVEQ /P65T4PJsp4ItV81r69HLXrl687s+AJw+wnN9wVH0Wm+FfTJ8WTyIBR11kRLsegL8STp v9D6R6TPHrNV4vlOS3QjfZYF6VtxGUDFRc8qzHh72aIUFE+PwqjMDkC6U0tWc50UNvU0 XLK8EKNJ+3l2OuLVn8WSFO6qNAo4sqwm7/aoGTj+YuneB3N4POojIve6XgePNLExTbPO mvfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XO+OaPlE; 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 m13-20020a05620a290d00b007758f54999csi641796qkp.646.2023.10.18.15.04.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:04:31 -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=XO+OaPlE; 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 1qtESj-0001tR-Ox; Wed, 18 Oct 2023 17:52: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 1qtESQ-00019o-Aq for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESN-0004RS-29 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:00 -0400 Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-3514bf96fd2so29603295ab.0 for ; Wed, 18 Oct 2023 14:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665917; x=1698270717; 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=IzgNOQnYTPtvhWHame0+1TsFsoAlkTYKxkzC3eocI48=; b=XO+OaPlEVOURV6KPPhALzuBw+5A8nUD3Brb+1gCYuGvbVDULSUSx5Nt1MWOp92p/Y6 q/UQ9LmPYfB+SkKPMe8bvibxTz0E+oHfMRqJtB4oi7/W+t0jh+Cw+Y8FTy8VflMpijwv 1IIDUSKXC2+WNqbON/HGGtlYOPJTwZXxYEyIWKZqzuopS8j8kSmHetGa7iRefLfHDf9v 2NiavH1HuhD2TNuIzmZEoVKRDFGWbbpMlNyBg0wdZH0uGcWsZZk0GYUn3xaZP0+f5/Lm u5stPykyKOcnupH4AA6te53JcKsFSEmVozN5iOrue40DXF8mS2118XkR1symf5BRFmSm IVFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665917; x=1698270717; 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=IzgNOQnYTPtvhWHame0+1TsFsoAlkTYKxkzC3eocI48=; b=iJBCpdQMM0SgpZQz8ZhAir/W15HdXnpaVFsHgQwyzQ3ADd+vgSwm7otSkMRQNXlU0q ckQCAJY5Ma4Ri9AZ/SwB943VEBMERThAXJ8oAu9exnFE0OpbC8w2mLo2bdTB6lG3pYwp RB21uHBxKXbeJHv2DbyX4oJA7L/EVZ17aYwV+amt+CYJDzZjSonPTklPXPHYLHkwLWlu 0gWgd2tdeEJ8UZ0NWQ61NdCA5H3+pm1egfEcweAFE25hhid5smjyFQcMxiaNV0cEdnz3 mup19x9nmMQdM0V/txgHkuYluKgPu2TtSR8i74+vY5xwYNWgFc+bIenBUZq5Ms1419fU b9gA== X-Gm-Message-State: AOJu0YylHit97kIeCekAYgkK5dmwDCxgc63L1T0WAQKF2tRpbjWWBes+ fY1opA+tB0XMo/13ODs2tARhq9LN6g5UzTqrcQs= X-Received: by 2002:a92:c14a:0:b0:357:3d32:bf76 with SMTP id b10-20020a92c14a000000b003573d32bf76mr658827ilh.1.1697665917234; Wed, 18 Oct 2023 14:51:57 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 24/61] target/hppa: Pass d to do_log_cond Date: Wed, 18 Oct 2023 14:50:58 -0700 Message-Id: <20231018215135.1561375-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::12b; envelope-from=richard.henderson@linaro.org; helo=mail-il1-x12b.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 7c95c479dc..7a3b0f1de7 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 Wed Oct 18 21:50: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: 735085 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224793wro; Wed, 18 Oct 2023 14:54:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6WvL6JroKNCHEz6aojGkgUtdX710Tv4A2duuh/3G+/p/XjIFybj7NHC/k4vc0LV2gNPzH X-Received: by 2002:a25:455:0:b0:d9a:b522:a4f5 with SMTP id 82-20020a250455000000b00d9ab522a4f5mr559890ybe.40.1697666042915; Wed, 18 Oct 2023 14:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666042; cv=none; d=google.com; s=arc-20160816; b=DhGRHOdo1UvoiMIJZRLlsHxcAl3CvAeUhgX9KHZBocWN1hmlU9kq4zRaIhFG3Lh9qH aeBvPYvihIrPTi3k04z6ejbOxzdQ/ilxMLL8PA9LocLsYHQxjufpQGKQ7Vo4Tv2UwI1+ LwK2zKCwD6dxUjGe/aT8wfv35t5oM1KrrmPxzmz65V+j3/Jw/a5iM9sewiyiAJUZ8gW7 F0X6F5bHXH1ikIDCvDCqAp+fyt3G3RgOIsN6NWLg6CwjpRhuyJ5/MMGn5DG7yOtApjR6 +Y5LUmXueB9ZBRUmm8KqYyAekXKPHULSTTXQJTtLYb82vQIawDRxslb11u23dvX2Z2sJ CpPA== 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=pahNvfSbaXH7GCmgh8txSi9o/B1oidjE9rEfxQaDzTc=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=D3jnwWLoGwETgXkq5Dzvr2m0Du5EUKWnPz3J+Zoc/FyiiQsyj1X6QHfRbc/uM8p3iK kCRSx7WtDiB3LEXmfA5x7HmaF+bY1YSsrro4t3eUf2NHRuuqWYz2IBtISzOxAjctjVkn B77SH0vRPf6inzUA6Uiugw4RHtgapFhABjqcsTtHqUkGmp7o4HitrDRrHNm2FDbwcdtg 10ZmucJUwHSydiJjXHY3h1W9uwo5YJaFCZGrPdzn5PZcaA2Es9o/crfZc1ZtIGDSFnGp MfEuRO/SU4X1NpGXIOacDsp0CE0vahQvRpmXrgUMfTUs9Tl8fJ1SQ0SIb4qB/iZOAazN DGQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Crh1We5T; 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 s5-20020ad44385000000b0065b0fd973bcsi581489qvr.271.2023.10.18.14.54.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:54: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=Crh1We5T; 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 1qtESk-0001wP-FC; Wed, 18 Oct 2023 17:52: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 1qtESQ-00019p-Ay for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESN-0004Ra-6y for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:01 -0400 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-57babef76deso4060173eaf.0 for ; Wed, 18 Oct 2023 14:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665918; x=1698270718; 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=pahNvfSbaXH7GCmgh8txSi9o/B1oidjE9rEfxQaDzTc=; b=Crh1We5TM6avpIpDTdEZaZHk5/WK/BAj4bMe+eHLo/FETb3TWr9uCy5cJsbwiSZhuq UsBvF61sVudl4y4ZRGGA90vSJZc6QPoMXxSG6ga73eJppyHiiG1vKYKSsFCtaX/DWOOR ZEaO0Y20Y0QfAaUDHypIPZ0J1LZEFC/tJ5uVP3tKW33zjHe1RqTZE09zLFM+PZoW0cmV 1Bfpx2O7NW/YkL1+kdbXSM3mKWl6nZ7E7p8G8LBSMe6BR5xYY6ss8IYSZDRMXhi+6v2E XXJbm2tYd6m3m+3nnjYw1BiNpPv3Jvi6fNpEgLhrcd5/jvidXsxbZIIjyuuMxom9O8VJ 8ZbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665918; x=1698270718; 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=pahNvfSbaXH7GCmgh8txSi9o/B1oidjE9rEfxQaDzTc=; b=nkZe47GGAEL0gozueS2sYR4Lgy4FY4gqFYkT/WPzD14vao9bUqLXAw7tdX3vb2DcVN E9sHBOtz6eve+nfC7y0i0bkd0LkVjeSnL6wZn5NtWNk2BMHCbatPdw2BEKvkAcMxkqlw /V/wAv4pvUFiHjKVQZGqaO6Qg+F65heQagtUrqj3P/USr7Xz8qNfI8Sx7ZFEOhzxn1eL DgQHZ9Pu9mUiQ5btf3muOPVSSqCVDQTM8NcP3jHxLjMlcTvcSM72cDBEfguBA9F3iKg0 OKapwVx0sMGQkvyltUxmvH5BxoEvaYrrFvbGZmIefRAT2LxVjzI2gqGusL5gx9lgUnSn aC1Q== X-Gm-Message-State: AOJu0YxJtB8mYHqmxt27iE/Rl9kvuWGG1MNm+11R5AD4k3hSn0gur/10 /urhFhcLiFy+JxedFnaCnsZuRR+GJKRQ6gZmsBU= X-Received: by 2002:a05:6359:3015:b0:166:dcf6:cd82 with SMTP id rf21-20020a056359301500b00166dcf6cd82mr248039rwb.14.1697665918070; Wed, 18 Oct 2023 14:51:58 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 25/61] target/hppa: Pass d to do_sed_cond Date: Wed, 18 Oct 2023 14:50:59 -0700 Message-Id: <20231018215135.1561375-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2a; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2a.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 7a3b0f1de7..1a51ac4869 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 Wed Oct 18 21:51: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: 735125 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227485wro; Wed, 18 Oct 2023 15:02:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcaUKAY49mSAxli4qAWa0dNrRRHDoi0q+//0L10gP2MEVeUysWUWBWwTnjn5uEHNUAGh0n X-Received: by 2002:a05:622a:15d5:b0:41b:b7ff:2342 with SMTP id d21-20020a05622a15d500b0041bb7ff2342mr508144qty.44.1697666526377; Wed, 18 Oct 2023 15:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666526; cv=none; d=google.com; s=arc-20160816; b=mtBxT2iRzzqAn4+0+4ibwarZ8+EpitZ1n978k6Drnni6V07dO5/I4MeC8fenx4s4Du DB5ESBAahFQjr4HCSaAYqMlsadx1y4MKqe0Ue5JGtncsqJP+thFjNWdFheiBnrWhedfp zkNSV8LocBDQkEHPP3a3Xzp0SAErDFCpC5HkMFQnnWf15a3hORH7knHKgGRL2a/exGzb 4yGFkiOI0L4iIhp9h6khZRhMPRIu4A1c+5zUwTwSCGhRZXwqv2a14NPakoKuzz/vBlEm ++zMvB/AJJ9AJKFF8r+KfSpffZBlcb6YTI11PtNJ9Q/c0Ua/3nhkO5Aydiz2BrBUb+TT NRiw== 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=J7IvWHKNslLXyxg2gDsUoAZIYZRNssROan/QZtA5zx8=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=pOyhlzcas03EHAllFPlP7bU8dr0syalM/zFaZwc0Ov89knlxuQ9tOvvbij/No04izJ gbFYLZKPtuO7rCGBO5x0DdksK0oAApZAIjJFohs7rZh1SoySc0fdNcA7dUliqQETlLK9 ihYmpJt+ws2kekVhLWO1ZHd6crmtilYDSyDLe9vX1pk1LlU+tWb8OD9OhlxIawHtjMG4 5Ix3n2DZ45XO7Z3Qxoyzhp3oK97whTkd7FnnY3sn/yzRt2KjQ14jx+a+YT2UIjukH1oA f5Rkl3jJzYR6OTu14xV585TdQajisxDdbHzgzJwM6Q/1HcmMEJaeyZG8QNR4Ov2M1aG0 3Fcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C5MnWHZo; 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-20020a05622a1a9300b004195f8e5ed0si608327qtc.164.2023.10.18.15.02.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:02:06 -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=C5MnWHZo; 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 1qtESn-0001zy-1v; Wed, 18 Oct 2023 17:52: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 1qtESQ-00019q-BD for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESO-0004Rf-53 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:01 -0400 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso5473239a12.3 for ; Wed, 18 Oct 2023 14:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665919; x=1698270719; 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=J7IvWHKNslLXyxg2gDsUoAZIYZRNssROan/QZtA5zx8=; b=C5MnWHZoTGAv0Z3nTmEM8dpenBbjFupjo4DxWkzPdQar78cyjTymNq8VglYO23Dkfu sTnfQIEE6oWz+nawwK+NSxTpJ8xwWNXh+YCfD/nId+VVwNnG8FiZGg35JfwTBWXlNoco yMVl853X8qiU6ykwCpnBysL5g9zBTWNQufWwsND+VZpQhAGgIC/nhWoG5+EQh1TrquWj IJd/7HqekQ/mteeHxpqxwkTP9AgTJBIFS/4IL3EOse20Z7eFVHR+6TPGhaAKdhFTVnGs PR+DQdqqdggWoWXlBIWccSRwJYFKbXIum71949tFF99k4M0+rF6aWhN2toxCwf4MAz9h QHqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665919; x=1698270719; 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=J7IvWHKNslLXyxg2gDsUoAZIYZRNssROan/QZtA5zx8=; b=WO4TrnPht+d7KRi64U17dZ2qMbuSS//+/dWQkBvgkzy93uKmFNOcHHzgGXxM33wEYa L9B/MEEqYpQVsXvzGRRD8o5u/XN/IYJCOkoRwbez7O46mWt13Olt5om9OEPcSy7n9COw GHqwmkzRKmBq+n/EBa8H52oLdXC0N7eWyWVwTuWjgtrqS8P+BFePRcwvjoiJDNM2QpP3 l5aPATzaUABfOaxbaEqxjRqBivraY+942tib4kGTLx9W8k0IvOfGtw8x9KdK/ZnXtkFr NalTc4cyK5ZgaZx8xYYzVBrE3dYPmhTopEhP3acWri9GaXpkSRjB3JUakcVbvmTA4pTv I+2A== X-Gm-Message-State: AOJu0YzDckaNj1eoIPYTUq/fQzc63+xfcC99ZRbS2B5yVp97GyieR3K3 DzhQMSSbin268cU8zABU8nYaCUEMEV1GZduqO1o= X-Received: by 2002:a05:6a20:42a0:b0:16b:c9f2:b632 with SMTP id o32-20020a056a2042a000b0016bc9f2b632mr456356pzj.62.1697665918873; Wed, 18 Oct 2023 14:51:58 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 26/61] target/hppa: Pass d to do_unit_cond Date: Wed, 18 Oct 2023 14:51:00 -0700 Message-Id: <20231018215135.1561375-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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 1a51ac4869..8bea28f0fd 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 Wed Oct 18 21:51:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735102 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226148wro; Wed, 18 Oct 2023 14:59:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtyFSR6oVePReyWNTE3n9g8jHvkQ+Z00xRr2TgAKo3t/5dow2NGlnfBD57XeSPdrkq7pnZ X-Received: by 2002:a05:620a:994:b0:774:20df:8b3e with SMTP id x20-20020a05620a099400b0077420df8b3emr369693qkx.78.1697666349135; Wed, 18 Oct 2023 14:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666349; cv=none; d=google.com; s=arc-20160816; b=kbj0wXa6QLxk4AfYIrGGKksGpQekI2VIdf0Z3xcq/3lnENLng4mfixKpQXZHB0tkef r7unj3rt0wPl/lQDU+ghLw/mYPxaXggOsgss/EqOC7eV/iD336T05kMaBpwgwPP0cERy U/1N0NvEfq14btMJfDDeER6+egGA0b3smllYsQG9vdTCH8GrtB4S1F3hvCnoM1hTGqCr dvVt87HQd3PqpJi6pmZce2C2DayPHbQXDdMNb9wJ9fbXM+WNjOqyGj3m7NDo1ExmQy3A N7bKpeLfwP6Drgxk3qVEmoZKzia6cV3GYm+MrCEMX/1gKVM5VkkcgQ4I4gM+l35ujux4 tlGQ== 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=yOt4L4RU9DBVWKbMxLcMk3VZCZC7MfUNBnEhx3kY+Fc=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=y4hLdS8j1JmKGSaFvlRuzQbqA5YmrCt0nRQSH2kf3Z9wE75m8qo0fHhAXViVsZR/ZK Wdx0v2230O4STrCB0UHcq7kGwj2MDxlP1kNkMqRXjoDCtTpXBHJMEzXKS6P7/4G+o9RC GfmvT5m7e7Mz1tNGz4JHL80oBDmS63huxKqxaXDzYaMYtwsu10n4eXI5/tkLraXhiuv1 Opzj1uKlHEhazAIzZBysU4bkpPYu5kZVLVtl8w9ZPFcsOwARSnC4diCQJPHpgAjlVJlW TawTN574CNe3gdaHzxKd1w1IQYwyVRO+jfoy74vqp03y9BPVChMCJEyFKWTVcZv7xwgE m1sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SHniBY42; 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 g18-20020a05620a40d200b00772638f486fsi642514qko.305.2023.10.18.14.59.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59:09 -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=SHniBY42; 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 1qtESg-0001me-9T; Wed, 18 Oct 2023 17:52: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 1qtESR-00019x-IL for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESQ-0004Rq-3M for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:03 -0400 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6cd1918afb2so459275a34.0 for ; Wed, 18 Oct 2023 14:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665919; x=1698270719; 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=yOt4L4RU9DBVWKbMxLcMk3VZCZC7MfUNBnEhx3kY+Fc=; b=SHniBY42fKvkFZkXlqSSDnyFbnOI1oRYeApv7cMj5QslXTWlZ6u757kcceMPj8qcBQ 34dVaAKN0cLSRtq8Mmc0B0jygMsapQUIXiJ9MfVfD9WASmMYzpDQGVCPc111zpiXErYt +9e2a4KVn7ehfMikwaZIYoI9+orAcEBKwcpjtnDDeKBMCGBDLzw10a0UnNg1QikPN+hr /bkmulezy7KurS02gVUkGyTcy5/Q42TISAqG+kwlsDPFcmGRYMpYsEdlciZkq9fDajFO NyqhdmAv2qqN19yZrnC9U1HH0vR0az3EhaiJdDd33Jk9or/1k0AtCQr3BUx3wK/kEwk+ K8Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665919; x=1698270719; 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=yOt4L4RU9DBVWKbMxLcMk3VZCZC7MfUNBnEhx3kY+Fc=; b=Ke8Z0/imzeLHp6i43kkKpt2TgXlccGi3tzLXAYY9sxNZUF/OZcM8fxEE2rtMMjrGlm oJ2/3rd/+77pofFFr3T0aSgaWW4aW5JP3kXXB+UGApHNhkbeDVAipBwMhOwkwXhvlA0h eNzWEo8efygk6hK074zr8hV/i7cxgBzdMPnqoTXqNqxJjIx6JclbW84fjFVNdK89E3DN xzb1sD803c02VuTKR1+gt1HR2bd0yRpLRVu0wP/JnO6PDlB/hc+S8eUG0nW+tywPSGeH OuSZSYBuEvRYeyPt0KEjfHzzfuJykfJDAG7ilBFb2ouYuN1y+b7SFOXf5W36astWwODA Q2pA== X-Gm-Message-State: AOJu0Yyy434UgniAjoga0Syft67Lx0130Lwk70kCCi0ucthQiiN8ZR3D cA4zKzE1hHKch4jrY6lF+HMb2VZ/+feNi/xlPcA= X-Received: by 2002:a05:6870:b406:b0:1e9:b496:ce2d with SMTP id x6-20020a056870b40600b001e9b496ce2dmr862259oap.12.1697665919588; Wed, 18 Oct 2023 14:51:59 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 27/61] linux-user/hppa: Fixes for TARGET_ABI32 Date: Wed, 18 Oct 2023 14:51:01 -0700 Message-Id: <20231018215135.1561375-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x332.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. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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 Wed Oct 18 21:51: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: 735089 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1225748wro; Wed, 18 Oct 2023 14:57:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQ4arya/Xc02QkMZWIUCuZomijcZ6LOhi2ufCV/bSiiEu8FMjZZTOa5pEF+vu8IUpCN7LU X-Received: by 2002:a05:620a:480e:b0:76f:c24:5450 with SMTP id eb14-20020a05620a480e00b0076f0c245450mr463482qkb.2.1697666259533; Wed, 18 Oct 2023 14:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666259; cv=none; d=google.com; s=arc-20160816; b=WTiDq07fEBE8BkUT8Zl9OmaI2rmVGQhD+MebdmiO4FYSm2FKNAXo4Py+NTEuwoO/Gl lN5Onw+tS3lgCq7q/3wdnP/XoUK5hE1ON7sqokDxHntCSe95Rx/ouhJn0dUrZ00zlfJ5 SgyxSj7CKiupgw6tBe5/WJq1OSlRfNqRC8acku297rmFz0d/VOoO1v5RDfgHVKbpDVCu r7WApodLXJwVxW26FUitatoZryiPCHnheK/EmOuauzffEyaF7l086oBdIT9yYiP8bZU5 UfXW1imuEYCEXdaBZ7ZFRdqmmNY62J2zW03ccM3roAzKhSgwXX7kizKW8898U3ibabGX 1brg== 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=q9hX0qQk5CZemXO2IHvqPOvMFc4SeZE7uxuiBohTGeQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=W3ytwTscPuGEofT2Ld/BMW2UowxrTpEYbzThS+XxT0xD9LBLGNGe44u/19GfRWw1h6 6O5cybwnRVihF5SYw3X1VizxDL/ST2GBQA1nmIaJzOTcgawX+6hAIZ6yQUE49q3C9ofK UgKUIg1XQf8IcYTD+7p1l9I4Xp1QrFt159udl4Kmm+G4vyKSSJNcaRaIzzirZeed+e8G hHRr0Bhcnz9EiuYR8y6dr1VzWhVhmFj9c5LLnUiDsZ2gIbJkEOgolJcN6FnwufUvTAlc loUllLgv9JlN+E1DfD/q2B2SJHNC6laK+vv1NIDLiEKq1U8ySInB1p3IxhbniS7uXPVs ISqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rP0aYlJL; 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 d14-20020a05620a140e00b00773af69e605si595132qkj.85.2023.10.18.14.57.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:57: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=rP0aYlJL; 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 1qtESf-0001mS-B2; Wed, 18 Oct 2023 17:52: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 1qtESS-00019y-Re for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESQ-0004Ry-3f for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:04 -0400 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1ea98ad294cso1059494fac.3 for ; Wed, 18 Oct 2023 14:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665920; x=1698270720; 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=q9hX0qQk5CZemXO2IHvqPOvMFc4SeZE7uxuiBohTGeQ=; b=rP0aYlJLBYRj504qc9z1I05HOSUqpF3the29/j95i84+dNWVPpd+nidN7KD/8GZDqF u+Y10DWf76k5zZZ4xQCLggXvz5xg3L8o0exWMl76c2hIgBrAjwyjl4Na0YVg+GT7cuYm nwTZ6UDF2YSKdKvRHBvqEVPANOblpPWcMXEBKZHwrGCQEsRM2ye6/eHrXUQXzamGAOud 1TGGdQWY11BANXk/thDDupfQPrPO8WuKliIe4omDCJrJj9qxM3GTaW95nARmq2+u/qXM Il+L4CgDwtEJM82aXazMpWsl/2W9XsyV8BgUMnZX7mXFLJ5bsIhNL+FHK+4DZoEgsAQC U7Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665920; x=1698270720; 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=q9hX0qQk5CZemXO2IHvqPOvMFc4SeZE7uxuiBohTGeQ=; b=h2su3SH541tw8wggf7QI81oj/pE2R//N/LDbmEj8YEh0JGBL/ZX4JVXgJsiv3yzNrv r5wXGGVhVeKH77Ox6/0JVcib13lPTKUINbaKfs7sx3im24WD3jxaUwpw4FMj1MfuVbRe udmU8KsAv4B790WQqjsuDE0fs2TESJT1ZHKGbmiX+b38PhmBnxHhxYbRyc1jqX07pZGT 2Emnyjf5XCSrIXa9IOzUZ7ybQAr7nT+5g/TSiiFXpAC29hFRFCMGZ0K1kdI0twc32GKl DVDSdYMICHVGlsCjv/tpVbj5kbaVatpnEmXQW95qIHLbPVBGl49n+lrPFThhvWXfu5ER syTQ== X-Gm-Message-State: AOJu0YwytO9MyVCVY/IwRMLwCmbOte6iBdXxNsYFFuB1iyCAQmp9EeH5 k1FU2xAa9XETefa2JPpl4Gs1XO2MZmc4APKNx/o= X-Received: by 2002:a05:6870:ec90:b0:1e9:db34:a573 with SMTP id eo16-20020a056870ec9000b001e9db34a573mr600614oab.26.1697665920325; Wed, 18 Oct 2023 14:52:00 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 28/61] target/hppa: Drop attempted gdbstub support for hppa64 Date: Wed, 18 Oct 2023 14:51:02 -0700 Message-Id: <20231018215135.1561375-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::29; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x29.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. Signed-off-by: Richard Henderson --- target/hppa/gdbstub.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/target/hppa/gdbstub.c b/target/hppa/gdbstub.c index 48a514384f..748431097c 100644 --- a/target/hppa/gdbstub.c +++ b/target/hppa/gdbstub.c @@ -21,11 +21,17 @@ #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; + uint32_t val; switch (n) { case 0: @@ -139,24 +145,14 @@ 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); - } + uint32_t val = ldl_p(mem_buf); switch (n) { case 0: @@ -166,7 +162,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 & (cpu->is_pa20 ? 63 : 31); break; case 33: env->iaoq_f = val; @@ -278,5 +274,5 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) } break; } - return sizeof(target_ureg); + return 4; } From patchwork Wed Oct 18 21:51: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: 735112 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226871wro; Wed, 18 Oct 2023 15:00:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoYc0vv6yc0vWUivy9NGFpg1eMjJwGPsKK2mZ4fE1VIZFgBtYI8sZVdWYk++5x+NlAXvL6 X-Received: by 2002:a05:622a:1a09:b0:417:70dc:ad5d with SMTP id f9-20020a05622a1a0900b0041770dcad5dmr405951qtb.48.1697666459306; Wed, 18 Oct 2023 15:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666459; cv=none; d=google.com; s=arc-20160816; b=R7UPLRJ1/D+hjtePtZtkK24VRa0w20N9LTzwLMSSxeeKVgDwUf7M+gli/Q+8m3gx2u yba0BWe0nZUercEVpxY392YJmOXIpp44VJ6X+L7KCHxwXABgcYTH07JDp6RX5pZOnIoO OerUur5IxSECNvgwBVeH8DCOo0nJF6yUxWylgh/VSHa4hhF4RUsQvIubA6xR8drIKjF1 jyPvAJnfl8YrGftlMVfwsjiL0SGCv4MxeUVShJe6zaKkOd5bbrCAz2RY7Caw+pGS8kRU xDe20GLbvXE4/kH1OCe+VawCy4gqRbSOL2KSWEqica3jebjnp/+ZaMeuewD5T2rAX64z BINg== 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=HV5pYQwKSuXLoav6s1Qqsg8a/tXHn3qomGwcXH2ymT4=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=kvVd4mcjs7k1RrVlhr1ZJyD74YduUgL3Fjh4pEhtQN4P4hf9AD61AJHDKLx0lNIvGT mFgZ7LYSCjr8IuKmSjBP51ZmbV9bu0hFnfByKRplI8RAeUlU2zTybZE5j/OLfPGrY3dV zfMwqhmLbQxmUpPu+ZraF5hudA/oxmkw//a+dRx/QlNrOflNXQSK3d0OIPcImqB4ZQna Ai+/zwQrgl26tBzWnRCs0SnrUkxu9UghIpCcrxS3DLhwJgtrhYbWawQziddW6og1JU/H 3zONYi2P5KF1vsGhvHVJLDrW/p6fDVThqvUVrU3cbeAPNWEIT3cQHKyOnpdcpYnqA1GT q1mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FXEbzw3/"; 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 t5-20020a05622a01c500b00419544d5898si640649qtw.65.2023.10.18.15.00.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:00: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="FXEbzw3/"; 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 1qtESl-0001xf-2t; Wed, 18 Oct 2023 17:52: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 1qtEST-0001A0-4L for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESQ-0004S4-Hx for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:04 -0400 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-57be3d8e738so4125076eaf.1 for ; Wed, 18 Oct 2023 14:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665921; x=1698270721; 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=HV5pYQwKSuXLoav6s1Qqsg8a/tXHn3qomGwcXH2ymT4=; b=FXEbzw3/TunQaUY92D9mvMlzady8XDQYNijmU6HUESZ4IVUocOSxDNZQbY21VhN30Z ZFGeL1RTx95scBBv67dHpZVp+5LVtZUu6xQQSfAh8dzGsUsaStPSGEw9aP/dhsdJ50Hw ZCx9ZrweYLWy/t3kEQ5//zGn3lqv9v2k4meM41BJRHT9ImWEVrmkTkGygt7OwcazLGp0 wMbrr4oj+UlQwNJCbv6vC2Yc9gS/UpAjQeypC4oxjFIMbkG7xR+meUm2nlWrZkZO88o8 YUUWqWDZiRbdVNcoWt5AruLCCgke35lTSkVG6eBlBxoFlmDEaFGBnKGJmwJVD2gm7OmV GydA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665921; x=1698270721; 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=HV5pYQwKSuXLoav6s1Qqsg8a/tXHn3qomGwcXH2ymT4=; b=a20wjBagtUxpU4WhfnP9bYBYbzfg18/mGVOVsNDCwogbyX/G5tj5KO75LTiC2CeBlh wWa+gvxnchRGYrAW2CGJ6t/MsGanmxG7QNEI++oF8nSCTtdaJC/ucM2nu+6HRI5uQX2d YM/ZaCxAiXqmXwEjLmBLiDVIbg5eiUQAzu0yIXNAs/2G+B4Poj+wOdG+8XBYHDUqlGCz 3vTt7Dnt0ETJmGtsDW/rMl7qbS5z1y5DhHfG9LPqd+Xcxslnh/alnACzv6G/Vb2dq0YB PmBx9Sq0TR9xfYS9fDfBoiJLkjPf+auC2u/xeYpQZ/eqcn7E9oem9vhmWlxYWjLDNlpc zcUQ== X-Gm-Message-State: AOJu0Yzh0J5dGna5YahOCMUQ09iq0ZPboB0qhfEFELwlsSDuja+xPZP0 aJucSkr3waM8G4Z30If/7G1hnAxuvrBdnKIjh2o= X-Received: by 2002:a05:6358:c609:b0:142:d097:3725 with SMTP id fd9-20020a056358c60900b00142d0973725mr269953rwb.9.1697665921158; Wed, 18 Oct 2023 14:52:01 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 29/61] target/hppa: Remove TARGET_HPPA64 Date: Wed, 18 Oct 2023 14:51:03 -0700 Message-Id: <20231018215135.1561375-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c31; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc31.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 | 4 ---- target/hppa/translate.c | 2 -- 5 files changed, 8 insertions(+), 31 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 1a12b2a186..251f85444a 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 6bf415139f..bbb6080e2d 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -253,7 +253,6 @@ static const TypeInfo hppa_cpu_type_info = { .class_init = hppa_cpu_class_init, }; -#ifdef TARGET_HPPA64 static void hppa64_cpu_initfn(Object *obj) { HPPACPU *cpu = HPPA_CPU(obj); @@ -265,14 +264,11 @@ static const TypeInfo hppa64_cpu_type_info = { .parent = TYPE_HPPA_CPU, .instance_init = hppa64_cpu_initfn, }; -#endif static void hppa_cpu_register_types(void) { type_register_static(&hppa_cpu_type_info); -#ifdef TARGET_HPPA64 type_register_static(&hppa64_cpu_type_info); -#endif } type_init(hppa_cpu_register_types) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 8bea28f0fd..94969cf2f0 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 Wed Oct 18 21:51: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: 735106 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226294wro; Wed, 18 Oct 2023 14:59:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsF/LN1lUL287FbMaSsDS2p932vJ2ZbHfP/Vv8uvFqVSBF+4H8C9as5lSV0zBgPbEQY7ad X-Received: by 2002:a05:620a:4113:b0:778:8822:9a3f with SMTP id j19-20020a05620a411300b0077888229a3fmr527255qko.63.1697666384553; Wed, 18 Oct 2023 14:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666384; cv=none; d=google.com; s=arc-20160816; b=X6bFmPxThoHnF7pMUGjx1AUTnSc7MbByrGricn4g5FRmVqa0GphLAqBJRcf99qrfBx 2xtMVgYLyRP6hRgej1na09kvVIuUCowGRVPk+x8o0LPeH4S1CPWiOMTZab75v+9Gyzxa 2tyuhd6Wfq50LEgoy24PXSTakakJMO6CfNLneJbIASZ99d/ndqA/kOXWTxOwuKPGFM5J 9NDdAAfyHz9JCuC0j5MGszOQfFi9l84RzBM1QAqQoyz+gQLNNk+5/kSE2cCwg/d6Fn+q EtRa/bExWxU2uwtMdZAzubjjxHX37GV6R4BBdcKU3aEPddEBjZvym6U2L34zWYpAOW9Q XdiQ== 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=h+FXcWCsrSL2FX31DZnJU2ioV2yMKndFqHewFvzyUsw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Z+38twDvMjh8FK9QL2MCzk2HmfnAsppVezqv0BnqiPY4cuWB++Ho0b0nx/XGDXVzbC kLMCU1Hp6gA5ktydVkVyOqUNbt6MQVN/6l1LLdKYoaSQdlBeDhYbWzoMmYmJb+1qS0ss 5jAWW7zytdrjjJMFElKhA5qK9qP2WmRhJPTs9bzh4M6OR1i3or//NBOxCLFpr1pvEGt6 2sKybRu+rR0rbBkHu5POSVDzrR1sOhv/cpXMzBxw2NLlyCJGzhMBuwETcUXc4aijXEgW muMvFroLfMjAblUlKdprG75k5DCeWxwPkcwI5c1LRRF6KOeL9jT/ZLq4q5HAYEdx7k6p 3tMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lgy7Il3T; 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 l14-20020a05620a28ce00b00773c0de5682si676437qkp.677.2023.10.18.14.59.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59: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=lgy7Il3T; 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 1qtESe-0001m6-QO; Wed, 18 Oct 2023 17:52: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 1qtEST-0001A3-92 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESR-0004SL-G2 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:04 -0400 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-565e54cb93aso4818279a12.3 for ; Wed, 18 Oct 2023 14:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665922; x=1698270722; 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=h+FXcWCsrSL2FX31DZnJU2ioV2yMKndFqHewFvzyUsw=; b=lgy7Il3TIq+gVyQ+DvUMkLxm91MDsPP8vDPoi6PFrGCJQTREtHyJGr66rvlE1KZgWR 4GWh0HVKNEIshTgSS30mS8yyqt86ZTt84O1e9gbVfP4FLJlEgHiP/zj3JUQodpq9Dp2i Xr8zPyV8jvrHl9NBxSM9uWpCO8eJYRW8b3u9cgulw8mz3s3oQZJ3dUv+932WhcgPcYPp w+nV8hV71tknSiix3NuF6AhPuyY5QlGHOeKRpJdZfS0nxzHGu9yvSCq3ODj82srmJOuk JZhh6jDiNzL8nlrX+66YhkCXN1qcT+xJVYeAjJpe3JXtRA1zRFsOi1KSl7fiKKTnUxNo lYkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665922; x=1698270722; 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=h+FXcWCsrSL2FX31DZnJU2ioV2yMKndFqHewFvzyUsw=; b=sGtDcnG7B6Q/C43E6Tuv+Tx9gfaeVvDFa+66FVGhqXm7U+ry4JMeDEfPCveQXBq42R 8CloqHva+T+z0f4s9NW+mO4Y77qhotxcJeyshWBjwtsJoIDsjVUnnTYNAmrqdS/uu6jX Z19kt4W5ypjoasrUOdNwrpIihAJQsM7MynEs5wFMmHoL3iLXemutSCSrNB1XBIyxd5/Y f0deY+/BO6FlnMQCB1FcmA+JLOkVBZ0DFFDju4OWUb/m+vyPPfEmj1V0cHSrJjFPed0I vqmLvXwdCiHw7V+9xsEJ4865qfg8fK6ePPK2DlGV/bqIM86rQ8G8hE9Y4eAA6EXkf5+1 RlRQ== X-Gm-Message-State: AOJu0YwqQJYBjV9tFoX2kpq0Mr6gJ+QJ91mPX4xTRN7B5FNhl9punbbF DRBloNI3BRU4zlHx8N/P9O2ENISPohEKmRQ6z/o= X-Received: by 2002:a05:6a20:4387:b0:15d:42d5:6cb5 with SMTP id i7-20020a056a20438700b0015d42d56cb5mr499007pzl.28.1697665922034; Wed, 18 Oct 2023 14:52:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 30/61] target/hppa: Decode d for logical instructions Date: Wed, 18 Oct 2023 14:51:04 -0700 Message-Id: <20231018215135.1561375-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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 94969cf2f0..5eecced442 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 Wed Oct 18 21:51: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: 735131 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1228726wro; Wed, 18 Oct 2023 15:04:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEk9FAGpsq3dhXW8oNRWENlvT1Lm0jEeZGbjUG2smZysbrkZW8QZPsD2T+qFs/aVRUuPqP6 X-Received: by 2002:a05:6214:2267:b0:66d:1eb6:96c9 with SMTP id gs7-20020a056214226700b0066d1eb696c9mr582249qvb.60.1697666682317; Wed, 18 Oct 2023 15:04:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666682; cv=none; d=google.com; s=arc-20160816; b=XtDK4H9sZfGKT+fT9BFHmynZugWtCzZ+++eF/1anVpZiJAz+OvcGwqg8OIst1G0S2Y ODfFGJmHY/N2H1uhD0Z4W/ESHL8YhAveYwkQcghEgJCbwFe+EkhGALrI69zcHXHM5jXK sR/1bto/05MFrjDlFPznVyZwOEGf0dDLCr8yKrP0sHd/c94H6EyvEleN03LbWRlTBUzp kC6Cy/q5Jz9PY/5AWtZLdRumoYlDtEzPwB5XG/0KLR9kBvGi+w7EuQQNyWq7Q3jjrrUs lEdW/s1qhgdNQOhIGl3Khpv3QO/3WaT7FIA7eKw/kn16BpiW+k5YrPwjLGlrJ9MmevOh IoIg== 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=iZGDloHtnLt/m04cAgCo8iimUueJiT9M8I7gLtdl/IY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=wEM+3lY3jJAt9rbC4z/IWJYmZqZbb7LEqAzk3RW/h6xIGcWPmbBOXFfusYgENZw7ud a+sMEzSqS3tqUTak88ZyoPCT5oXtyJd9HkeTIC5oBAIoGlE+wGl8wlN4odVKSn2hM8Gk o2aSn7d+rGZRfOMV5muH4A7hhgIS4bEcB2ZyGgs0nmeHksGaVCoLXVpt0CzMj9jI5zHo jKdOOVovTPID7ttRowo124H2X1mV+sPscnK6YjqMCl97MYd/y0ViEm2ci0kgvY671rqu OowKvM6je2+vkcl1LQenxVqmUldftjSjYZepjiLp64KhcZG7guL2zmqNk2BGZ2YoCjk9 PoBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="u/y0vKPo"; 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 g15-20020a05620a108f00b007742e8f217asi621306qkk.450.2023.10.18.15.04.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:04:42 -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="u/y0vKPo"; 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 1qtESd-0001gB-9k; Wed, 18 Oct 2023 17:52: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 1qtEST-0001BJ-Tq for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:07 -0400 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESR-0004SS-Uo for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:05 -0400 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1e9baf16a86so3880737fac.1 for ; Wed, 18 Oct 2023 14:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665923; x=1698270723; 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=iZGDloHtnLt/m04cAgCo8iimUueJiT9M8I7gLtdl/IY=; b=u/y0vKPooJ3GUw/ERNgSRhtlaoW5VM58Z1a22m4rSxSNNfQrDZRxvoiEtZ3lm80oyf sX+5tXqRkshxpFbIYbPCYXRcUm3Q+O1Z0Y0Q52LdTF2TgmIK/ZFCnfY6LIixkrAdXIJK hHTwjgTslWok0lmZp7tBr70h40tZrf7cRm30x+IIIJHOLCApr2gjgIES2Na+I7NOnvww GMPS1JQ1oVrnrbd3b1e5VFlTBTEAC/+2H48Mzqnij0e4T0vrPJlj0oc+9HvX4xpspaiu 26U0b3CQz53qV4DxuzfOqguhuf60NAasBQp79/LSHKDCiU/ehxohECczp/DI5I+aEgSr G0dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665923; x=1698270723; 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=iZGDloHtnLt/m04cAgCo8iimUueJiT9M8I7gLtdl/IY=; b=Sy3SvMqNprUXax7QabejsLVbnQWDwGXdAQ17diWe8mwITXDETRHvTdkz84Rfp0OL3W 7ZmJv0oAg+Uu38QObR6kJDod7Nku94/3yxPyM8tngDrvizpgtCtkhXObqtEKK/iNcq/E +vxY8OOgaBKb6MC4fkPQCITIKM6dzg7kd6UGW+SSSBNHNqSG67+0VRcXHFolvuSkTmjp byx0BpjRyjK/NI87uOT6Iqhf3BLPSmBzpRw3B1gsvA2KYicZH5Yr5LYTN9j3/3HL8SPI 8ttof3zHFU6F23Fxuyo1bVoUESxK+MW1a1he2wLLOmPMhYeEgfdZNsdq3MV8yU307JHL LpfQ== X-Gm-Message-State: AOJu0YxdTrjFPR7E625QBv8vljum1JMPsLMszFTAhczpI0VfnwxETjTX aGn8gGin4cC6zj5O8MDd7C5Hn5nHVRR90ZyQtr8= X-Received: by 2002:a05:6871:8aa:b0:1b4:4a2e:33f1 with SMTP id r42-20020a05687108aa00b001b44a2e33f1mr747815oaq.29.1697665922790; Wed, 18 Oct 2023 14:52:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 31/61] target/hppa: Decode d for unit instructions Date: Wed, 18 Oct 2023 14:51:05 -0700 Message-Id: <20231018215135.1561375-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::36; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x36.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 5eecced442..ed00b58fbc 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 Wed Oct 18 21:51: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: 735095 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226010wro; Wed, 18 Oct 2023 14:58:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBBS3Gv1rXTYgmjYri84bgb7SCVgV53TL14ng6GARGB6D1qva0Lju/3RCuzhuLmTfC9drt X-Received: by 2002:a25:848f:0:b0:d62:d6c5:f5ee with SMTP id v15-20020a25848f000000b00d62d6c5f5eemr629760ybk.58.1697666322867; Wed, 18 Oct 2023 14:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666322; cv=none; d=google.com; s=arc-20160816; b=imJiYvF7h+YlhOsQsaB7vKL+UaTNh1rtvs5tpTBTzye6eDWXiFMImJzXUPHWsDXJ1X SA4rLUldqmhz9kqPuZLD2bAlyzU+fuqEoR7OAHM8ObdJC0elby8nfklPbCXkqlaLJu6c jNEhZ9Q+8R2yoFyjQ9+wjefFNleieJWm9J/K7kyEcMlV9SMs7/YL0ptbAwqHm6sK+b+k hR8HpddoHmkm3Xz+x2LOZse7qVb8258HfYAbwH3nRBL1M5TteAjYDkKWAcjOGi5syI9j ODYMBMOv6SfEK3b5a/uFim/rk9SvZiSOokMuFoX0tCO7GV9Y8B/ga3TvjT6UgzXlDoDa EW/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=leH/P1FgQ25G4esAT7/kknyUp8v25189+bLSqs43GQs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=WSEUicx7NTmQOVeI3MeGBvO8EgmTYDtjwS5gMPw1GtE96Zjw9HCA1U2neRHLHSSWMT h+ZWBkpHO/+S0Dt20HmtCjlv+Cq43b8antm1wdhtMnHPr1pBeJ0e1EcPpPeP4xd3FQ9P rZrSOJsI/eCa93W9EKCjoClNTpGoGCnoVwsQa6PnEd40Z5Hxhhcl432F+8VC/X7mx55n KGKHEYIfhVeI9PLdJGbGZGl6NdoktED7BJdd4dzmU2oEUtgeJbMnSx0LAFqFszeepgtW av1UfuEqvWwUy7oTLvciq4w0BB18KNTufCGunCo8pCUMx0yjznuH93Ecx+n7E0OaM0Mp IkrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dvkbwgc1; 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 fv3-20020a056214240300b0065cff2a4e7esi704105qvb.4.2023.10.18.14.58.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58:42 -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=dvkbwgc1; 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 1qtESl-0001yF-QT; Wed, 18 Oct 2023 17:52: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 1qtESU-0001Dc-Eb for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:07 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESS-0004Sm-NT for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:06 -0400 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3b2ec5ee2e4so599734b6e.3 for ; Wed, 18 Oct 2023 14:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665923; x=1698270723; 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=leH/P1FgQ25G4esAT7/kknyUp8v25189+bLSqs43GQs=; b=dvkbwgc1cFY360i28ZbAmMEoQJKuZ0JTit9L3s9dVSxmCgwY2hxKAv4rJxzp6npSpA 2ObYaNgSZBn5OsvUDKxtY7gxIDNz90z/f4ypY3HpM+Hts4F0Yt4ccrBKnAmwtrPrCCf4 6XtnseUexmFp2ryPf+eZSOYciI6IztQzOAgKaClMnOjogwXNm1piMjzbuejwxB5t8wMJ 7NrgcPoTNxa3vuO4bfrCzkdwTmVx/muogIZc7Hn0HP5ZAcY2Umo17sFLbC/zLBqS5f5d 9oZe7puIRiasYgnixIJue5JEykAFKycDlKv7boLR43vmLsNlzg5Jr9q0HgJZecpWjwka CqXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665923; x=1698270723; 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=leH/P1FgQ25G4esAT7/kknyUp8v25189+bLSqs43GQs=; b=vH2g0/qKCa7jqSOpld097b/wQGEu83Ckp3LE5sLoN923BCFgYaVXvo/o5Ahro91VMw DxnteHiQYDf1bcj8vWLszZ1jRrS/wrroFcAs618Ev79PKdH3O7AX6IeXLA9Ms61U8aqy MAHtShHxFfiRFZ9AE69oheCsKKMrXu+BNTmkEyrSRIKXtt0KoQW8ah+hYy4aQLfa83j/ SX7YKxBhYRopeddh6stjFDTjxL0p14WDKkb+/h/2tlwtpp9TD9bLvchRCh23AZGg1QYm B0KRWk+6KTY5+0P0IBl8A4UKj4sC7GoHhM9ctLR4x2/6TG3Nc7IUzEyttdRdLEhCVKjA iYqA== X-Gm-Message-State: AOJu0YydpENlulBD2oXADrgV/uBImTMejy3ei01bwFD2KAPkCePLWqwG cmIy/ZjWcl44Ot/4wpdk6iW0uLi90zxldyF7og4= X-Received: by 2002:a05:6808:1a1a:b0:3a8:4e27:3af3 with SMTP id bk26-20020a0568081a1a00b003a84e273af3mr532453oib.48.1697665923703; Wed, 18 Oct 2023 14:52:03 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 32/61] target/hppa: Decode d for cmpclr instructions Date: Wed, 18 Oct 2023 14:51:06 -0700 Message-Id: <20231018215135.1561375-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 ed00b58fbc..58d69cb748 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 Wed Oct 18 21:51: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: 735111 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226867wro; Wed, 18 Oct 2023 15:00:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUvNfa8HhNWgQ0UVFjDe2bahmrhuXzESjUSdQqfwWWF06eygZ8YadPTkzISNT0/mqXwLAi X-Received: by 2002:ac8:5e51:0:b0:41c:c2cb:92dc with SMTP id i17-20020ac85e51000000b0041cc2cb92dcmr605338qtx.58.1697666458937; Wed, 18 Oct 2023 15:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666458; cv=none; d=google.com; s=arc-20160816; b=rtveaAZXxJb+DlFw1mUYU2y2K6anwOhBOjJ+A8B/z85uHx8BKtkdsIMr/fw81j0vrd 3JEUMmLEW55DJm9ye5oyBkeZMRzfk7v+FLzFy/h2MkG184+3w98J/ECaH+eB80DtPeUH PIgiECK//u6oiA6+pMmzReywuhHANQb+Gm1Kh3HT48/9e4RciXdsb7EyHiyqzybnyPhD 4VPGqSf60TZfXTRqNRlCTdjfWTNe6Ulivp1i59SDB/r68NMSuVY/vo+R6FT/ingqpgR8 byBS8YmhoeE62hlqC2/pOm2Qmacyq+JKSL0AEG7eWchLyUuPSC3uZFatCrt7nFj4GH// K4/A== 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=biyRHnz4u+QbGENxZ1z6pneJoG8Ry2KV/Vovu130SIs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=tsTTZDv1XSBo0jN9EccIwherNIzAmSqt/VUbZysSPbOSa1vyJJLtWwg4ccf/Vdiofj ZCYBocpF/VwN4x8KCVh4h8D514ngAY1H4LscygIwLTUKyc0RWT7rqHMJ8VsZu6JFnjuO nZzoG21Sk3OchBEurJ/vmoejbp6elUMLf8E6UOBvt/tMbeMHjhgJ7pKrOkDuspQVZ294 eFTdgE0VcjKiJwG/OH9VJSQZkuNbAlACHZqQI3nmzwgJGesslNzkDiANqtxsuYzexNU0 KCKbHKbKFwRyn5rI43cgFtiIKzP2trKgAw/C4Zn7cMTF4UTSubrLukTPbcXME8p/ydwJ A9aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PFFwe4pD; 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 v9-20020ac85789000000b00417ba4f4e18si623211qta.311.2023.10.18.15.00.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:00:58 -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=PFFwe4pD; 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 1qtESl-0001xc-3q; Wed, 18 Oct 2023 17:52: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 1qtESV-0001JL-M2 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:07 -0400 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEST-0004Sx-OJ for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:07 -0400 Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-3513b5a9e8eso30287375ab.0 for ; Wed, 18 Oct 2023 14:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665924; x=1698270724; 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=biyRHnz4u+QbGENxZ1z6pneJoG8Ry2KV/Vovu130SIs=; b=PFFwe4pD5IdIY0Yvy88QZOg/uYLkkjfUQE3DPdCZG9WHsx7xUjCDE2YkzZF+xX24gh rIbYOfFGVOX6CxXKNPdtQt7rnyu6YEolJFA+QNtRacqQ7YzigxglOT+KBKoqJmmHkFMn OYUJcgsmlT50gUdGYoQGzMbwNkd6YD99M3M6vaspRHzLemAlaCa6paYsF4fnbPUfQdI4 6Iqr+RSVMUP1JSR9+eI1alCXGSVf1vNcmcCWaxShtIMpKsu6aSiBPmhNVJu7q2iedafV as5sqQZq0wmxsyMuLc+uXhsgAf/2aOGITxk8pXvh5jqq3IzERtl8eDurCh5cl7PWAfq5 l50Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665924; x=1698270724; 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=biyRHnz4u+QbGENxZ1z6pneJoG8Ry2KV/Vovu130SIs=; b=G6iIn2P7tC9dS+cc4P1rZYEw7KMRYwHOklApIxQk/U4JoRYObot7yXjEEOsN9laeld 3sQE1BssLlIEgFzAOUGHIglX0gzy9hb2VV2rLv8VSNzN/V+RykCXpZEtaoSgEJDmZjau mePrz+cG3X4g7hSDVRoLuepUJE/15zKx+awwqV/pne2BADInXmSuoDS7RKx2xJldd/Tt KVsXW5xjj4XAEiraZmuKKpMtmmnU5rZmBW88sMdcSSylF6dapdVpmxMkvVa9uWsMbgfA +zD2kyTtKkXxMwviHYlj3y5WzqM/63BuDGwL3786dWvy1odJF9FwAXsgEaFJF3JryCVU /Xnw== X-Gm-Message-State: AOJu0YxWtLilVNlEahYhYk2c1iB92BI+QWA+lr0EPvAwNgfg1vc81xdi UHuHyvSL8HhSKsslfmtOgNVigGy1LYte8lY2/H4= X-Received: by 2002:a92:c846:0:b0:352:609f:e4af with SMTP id b6-20020a92c846000000b00352609fe4afmr593675ilq.24.1697665924409; Wed, 18 Oct 2023 14:52:04 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 33/61] target/hppa: Decode d for add instructions Date: Wed, 18 Oct 2023 14:51:07 -0700 Message-Id: <20231018215135.1561375-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::132; envelope-from=richard.henderson@linaro.org; helo=mail-il1-x132.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 58d69cb748..1bf61628d1 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 Wed Oct 18 21:51: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: 735126 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227742wro; Wed, 18 Oct 2023 15:02:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeZlv/S2ALB5nfnsGiBkzdWCpXUWyg2sTD1HOh/LsJz1Xga5ibzNIL//zN2LNYy1dVrEC1 X-Received: by 2002:ac8:5a11:0:b0:41c:c631:3fab with SMTP id n17-20020ac85a11000000b0041cc6313fabmr635854qta.20.1697666556210; Wed, 18 Oct 2023 15:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666556; cv=none; d=google.com; s=arc-20160816; b=0u0jEoLS7XBftUP/Xz+P3ybyQat02AchdC42gsZ0k1EmTeoniZ+NzkgLso8MHnMLAf vcNls+v8SZcimFSn09ISWrHWJulxdCWkUluVK2BUTMhcDH/nJJxmbItk5rLMA8qAvX3e K/s6tZNsVLScU45uFcOOz1fq2ZnSNun67GPlAqGfxtsprXPDa1IGOlixNoaxIZY6yiY/ xQ357g5wD5O1jO7wFY5QqtGl2xN7YMY6vREDiLfsmKdP1I4OKbwTPR7f99mtJW4EtKex cymV7Q9JVXpIOejzgozy/n52YJ5kiF8mqL8tV3H5rALN34gIpPRQip5I8Tye5EkWyQCb kJEQ== 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=hXC/m2cfeyFglevkvGf9SMDY8blHKSFBgtiFx7rF8fg=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=kpPblr/rH84CTG2lyRY5SAeLuw5028tDS3QXtKU2+HYQ1DL/hlZeneeI45J3zlSIEJ nYW4Jo4a0pF+50YvYWpxcJBG/RYxRyJFHztnL6Hv9N9hfjQYTy/YJ7l+/m1EtEFi0ncN 9Z+5EAK7t69HoNy/Qg+VZabRTUgOuVzuJBFAjjhTd5hkR5Q4e0AFaatF0sWrj8f2k1rn m7lxZCsDuT7Fdm8wQZH5KNikmw9R5PFVDt9VeWoSpLtFoV0PUbxshqM3jJfi4OayDBvG pDbPxV9kYIFiokOImFBbWcktN0UpnSZUspJ4mKzaa2VgbSBqWShMTCgPm5jgif8tSz4h BjdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EpHMntBB; 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 c3-20020ac87d83000000b0041cb9401ca9si647428qtd.216.2023.10.18.15.02.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:02:36 -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=EpHMntBB; 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 1qtESn-00022w-Ma; Wed, 18 Oct 2023 17:52: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 1qtESW-0001L6-28 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:09 -0400 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESU-0004TB-7r for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:07 -0400 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-57b9231e91dso4348205eaf.2 for ; Wed, 18 Oct 2023 14:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665925; x=1698270725; 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=hXC/m2cfeyFglevkvGf9SMDY8blHKSFBgtiFx7rF8fg=; b=EpHMntBBXgGi5lI9p1l3KsFWotYu2aiea7RKVH/bHdkOPWe7VaXHTzyefjqxeGCY0L GRJi5IgujTNuibVbgAQH9dLQEF67UJAd30JIxeJvch1sOr1NpXZZ2wag49TWw2fnpSk3 689WRr86XxXjC0l8IL5D5/clYaRWEl5zvTyDhrI1NBFV13TP8cMSuJmkb74OqzjtfzkA vMqT6BTe8GdFDm5+dNK9hdLmC8COVGskN8lmj03aUfsc0vEnHnn1yHdAanoms2tFMcTX 6sQj8Xl6Vp80ky9Z6UVpxUKiiLe/MQ8NRAALfi8LYHKbZRYnpFMiOlNtVDA5ojeQj587 TTng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665925; x=1698270725; 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=hXC/m2cfeyFglevkvGf9SMDY8blHKSFBgtiFx7rF8fg=; b=CnMfy5o55GmEY+abUB7DY2/HBD4fxjWL7/201nIHV+3sjeR6nUWD0xtWxFxHJNu57T 4gEwbs+xviTZLxxIacRZvKyX4gSZrQotcubdwxVD9kkUHdg1PbnJG2iUlnZvOuov8Ers VmO79uQzFpdwsmUlA5fumA7sDcj4erm9b3rfHODRsD4V7X3HwhLLS0Gy1+ECJf1pitJT PETL+SfpOsUTPeUqIR4x4bEDRLPjFsBoMJTFwDdqocXH7WhXUAvOTkZwrX/mWUcIELv0 oUQ+2+DkcjDxdQbnTOj9tgHo8MAmLTLc94XE2vmkvFmgH0aeYvAoEhfyOkz/K1y8KYmR 9p9g== X-Gm-Message-State: AOJu0YxasFATSKh5dd5yJrPyF/U8JWN/OkQN9qhGBEjqYy/py0shHw64 /O/oUJcc6A3Ppg68+KGBZe7dtRrGLMEl6cEdbLo= X-Received: by 2002:a05:6359:3015:b0:164:953b:35a9 with SMTP id rf21-20020a056359301500b00164953b35a9mr217504rwb.23.1697665925071; Wed, 18 Oct 2023 14:52:05 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 34/61] target/hppa: Decode d for sub instructions Date: Wed, 18 Oct 2023 14:51:08 -0700 Message-Id: <20231018215135.1561375-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2d; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2d.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 1bf61628d1..e21a206466 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 Wed Oct 18 21:51: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: 735132 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1229146wro; Wed, 18 Oct 2023 15:05:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSVxHg04LNSthI5O7sPUUqGNEoLowH1BAVOjQiS1WcAEEoIh2dV2a8U1SKx4ykq8V48fUo X-Received: by 2002:a05:620a:280b:b0:778:9888:ae6e with SMTP id f11-20020a05620a280b00b007789888ae6emr499859qkp.19.1697666742810; Wed, 18 Oct 2023 15:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666742; cv=none; d=google.com; s=arc-20160816; b=kJY9nptRxdGmAGaZCXeA3Trz5Rda9G79QbOlf+MdPgTXCWR1c+41fpkAy6NzyZQ63A pd7+GSBUcfcwfgihL1A+ehPiiQsjX92U2rYs/fz2mJ6GoILnLeTDNXFt+jA+V+AN0aDm x9OGYR4Sgi3wW3L3pCbQgKJ1zKmWtvVRu1vnvqS4k21XDej9onjWRSM+lRbBGxxzjeXA VyBVswxssee438MiuK++PNb2h6hngRsp6n+JSaeTi5CdI00+j96tV+KTmTIPVXdSuP8d dqEtNiMdBHfyDJrclFxUSLTMLvSF72ggrVof4noNuDNzp6RZJbpUveq0FtAgu1HTPfIC hHOw== 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=Q6n7GVKKY6z8LBEya5tH0c0VXc67EOQvAcHfVl9Ri+0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=MX8UdACV7hBnU7rUZBCWY/IrbSPDKXE89Slnk1tXr1fdeHd4G1NbYFMJFzqYdZWsWo 6bTC0BEGUqNonCuUURQua2cMAswXATCA5l9dR9mcN6PCSZLgRoG2m4VNj9nGLBicw5z2 sZawYJl2IQrBRMslCqB6hEVrxwPx+3l1Q6vUdwLH1MS5eHroVGtfTe0ag/YUB5CJFTNq CX063rEEOiz73GSh2tfItEjFi51t0dMzeiuEX6ABwW6sk2nF42qWZpucyGu16w/5eyZK V3+vx5BmccEfEcIzcfrfBsRlucBTBvhQTC6MInrXig5cRmwvFduhGi9pUMJF+KQ+l3IO bwZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iL8rtsQO; 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 t9-20020a05620a450900b0077099ee8b66si676888qkp.349.2023.10.18.15.05.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:05:42 -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=iL8rtsQO; 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 1qtESj-0001r8-7r; Wed, 18 Oct 2023 17:52: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 1qtESX-0001Pi-Mk for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52: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 1qtESU-0004TS-VZ for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:08 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so4161913b3a.1 for ; Wed, 18 Oct 2023 14:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665926; x=1698270726; 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=Q6n7GVKKY6z8LBEya5tH0c0VXc67EOQvAcHfVl9Ri+0=; b=iL8rtsQOtwHTiulIopu522qZPTVu79DyJsy1UTpX7XSeR3JuUVNpsqmP10bxsRJEuh g2tA5SY4Dqu9B1GoGe1fxELhVGby4VLRHRZtQwpFOu2ECrA4Qsg47t/I3PSQ/0Zp4McF Bz7hwxmK0AzBXWGeqPY0M5ownq0Rv4fuQt/brtNNZp6BCFmDvbT3iXfGCkBbiy4HizPz uqXesec1pyyOTET0dtY460mHNmHfCKd2bd1QueEUFPBK+IVb2ruy+HOTxKnqQlKfynQI A5zoMKdNm/EoWMFEDewykhpdfMyJwm0W4hpDNBBDy7PiWnj6GHzwyxon6+9PobdanC/i WH9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665926; x=1698270726; 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=Q6n7GVKKY6z8LBEya5tH0c0VXc67EOQvAcHfVl9Ri+0=; b=liUZus9Mz548CZ57qXintR1PgiU9Y6wjVRPkc8Fiko7OyVuA2ky/3SH8yXM1X1WJys PoUtRKYvCFK76Ix6dm8cumDcLK6ubm+X2CkZlrVWlYT4Pvl9AmeKtWXD6yKYy1b9Lmnx RjHOiT+ejFKvVcBD9gWAqlIfuVpRgNqrnILqcZq5pZ05VuTyqE1g6d2HY4W7F4iptsM0 TbVfpNPWP6eXkekYporCs/JreSEse9asGbCssMMvdUG6XZ/BAaXJ27JuHi+yVhanAy9b 2nSSZ9V4IPYI3sJGB+10Mbl8FXQmi1nrat2NtlyNYf1hr9bND0pgpd1jDcMe4AAaV5kV Zqvg== X-Gm-Message-State: AOJu0Yx99OLAw+b8bDZbue5aalXvDJPeH4aGvn7Hsymvu5GZUMOX79X9 /PcoeC7pjPgkIv9H8/PCKB1qepSEk9y6OcS+yO8= X-Received: by 2002:a05:6a20:3d8b:b0:158:1387:6a95 with SMTP id s11-20020a056a203d8b00b0015813876a95mr454354pzi.19.1697665925737; Wed, 18 Oct 2023 14:52:05 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 35/61] target/hppa: Decode d for bb instructions Date: Wed, 18 Oct 2023 14:51:09 -0700 Message-Id: <20231018215135.1561375-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 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 e21a206466..33da82b7c8 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 Wed Oct 18 21:51: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: 735105 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226272wro; Wed, 18 Oct 2023 14:59:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPPJloP3MuQzWr5cNveod53QY2/tJH2mmxIZCV7r9+6I1Dr+9UOHKuIkBZ4tFlRrdEyjH+ X-Received: by 2002:a05:6214:2461:b0:66d:2904:955c with SMTP id im1-20020a056214246100b0066d2904955cmr650904qvb.18.1697666377725; Wed, 18 Oct 2023 14:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666377; cv=none; d=google.com; s=arc-20160816; b=gH6fDKrD4MxJV07zySqs1DaI6ZZTX+tB0vGxXse17wV+BD9L6GNz3o1CosoHBv591f gdHaJIIlHtJbFWmWkpOM+cJ3SqX9x5yQnZwaWZzLI0WUOJFOh2YE63M7c6/Uhi5WvzPK SJKuDjU4fyHeBSYIBMhbF2RTHmouh1ZfYyZK/0mLdw4A0oW/DLhI3I5xkCNhV8+faznh YxlImQWyeLgpSIS+ZIZoYjahvPGCrxGtQ9/xxbFj53aABJsHzLnG1W7c3O4jLryKbZD5 i4U27JA1GTUGGe6bbidUtqc4nZRNIvZKQxPvG1zmcNVmc/RjTf7NWlTwf6dO1kWd3saU U7Aw== 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=QJvdFesDZvRn5V/HgHv8lkINBr9ZJC7sBp4BrdViQcI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Isq9Tr1KaHtYGid/jIE3qngbDgqPtlV6yfs1Yv2DpcO3SrrVrXHFnbC6bcWmyoXEIe XGUx/jNQAWj75fCc2PdzfpxVqE9RY4jF7XsDmMEkvBTXggPwBgg1xKlijDEV8vC74hiw YpR+Rmz/E4Zga0a087egID/EqiffxDixWwr0eHh5zvHOPj0qEGjkxVQ7Eo/8vX0Jx3I7 9ub/gFwpgGj4X30ryFzeJG7+X5BiUpPyFANBtzlJYxKuKE+bJk0gSv6WCGXRVEKdODeg gW8T9tO3VGpLb7ywFlmv1g1E29iZcBBtrOOzUFqZojh5EYBR7NtgCbCa6q5TW/fXKEqJ 8K3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NV8bF61m; 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 u39-20020a05622a19a700b0041986d6423fsi623258qtc.195.2023.10.18.14.59.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59:37 -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=NV8bF61m; 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 1qtESg-0001mq-Tu; Wed, 18 Oct 2023 17:52: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 1qtESX-0001Pj-N3 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:09 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESV-0004Ta-QI for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:09 -0400 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6ce27aadf24so163075a34.2 for ; Wed, 18 Oct 2023 14:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665926; x=1698270726; 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=QJvdFesDZvRn5V/HgHv8lkINBr9ZJC7sBp4BrdViQcI=; b=NV8bF61mnfGyVvYPauYGV61vntI6lZv22SmiOvRV+WyThvL20FSBMT/u+e2VVOtkr8 p99QKM9AC3wh9M/SfVDhP2F4hCwnBDjup/0xM1Uc0NtYQogpN42Z4MHpSYhdZ5czBvgT afVKTrrwwJQtA3NrOxr/Am+YqjcsgQGOLXBCZ/3znmYt8WNk/f3IPRjZAM3SVCQSZERC Oyx7E4lfIjU2y0fjueNewuSEa4goDYjBw4tHXR67BgNamKJ+maDkU8TWGyDyXveqzYSR HyRhoSg6EPE0M5A+Vb2K5bwDlRZY5RKWpN9rAbBLYuBQ2FWUE+bVcWcCbFeuABqlv7wJ A6Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665926; x=1698270726; 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=QJvdFesDZvRn5V/HgHv8lkINBr9ZJC7sBp4BrdViQcI=; b=tBEbbaIaPczwDueUIKPrpN112MjjH92BfV007QhI6sZ7lYFwNDLff57NrEBo4/LLnD YWJyLmsy29WjHlRcziP/Pjx+dtl7SCEs14aSzB+m+zlaZxdSWLtPXzxm3YDdWwv5eHfs ZGAHrYiOHk5jWPtic9iRXaw7hpvFx4OVArGVjDBj8ehGYXy1zlfjl59b+rxWF69GxpxF Uq56AqUqNOns5VMbbFSCH9SyG0FjtCGrUXSa/Rm+Y+vAtaKtzp6zkmlJPTooPKT5Lcx8 Adyr1v61l92sDimKA80WxkQmbpZIxSuKepiJB+J8XzpwkE0OxCS/DuXc/lWeSM05CkMi Poeg== X-Gm-Message-State: AOJu0YzmE+p/eX2lvZMWrNroI4zri3a60tXPLp62efJDwsGkFQMUphwd afi0drFbqYhdYPGaajl35/qew63EyTd6sd86u2Q= X-Received: by 2002:a05:6870:f153:b0:1e9:b6aa:a629 with SMTP id l19-20020a056870f15300b001e9b6aaa629mr700843oac.6.1697665926463; Wed, 18 Oct 2023 14:52:06 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 36/61] target/hppa: Decode d for cmpb instructions Date: Wed, 18 Oct 2023 14:51:10 -0700 Message-Id: <20231018215135.1561375-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x330.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 33da82b7c8..681c955125 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 Wed Oct 18 21:51: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: 735081 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1224683wro; Wed, 18 Oct 2023 14:53:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG67pbg9vwyUr8EgjCb8thXAtDRvz6jQq9W12ymPc2UYN4+NBOiDr5w/xN3AlrvJttisljR X-Received: by 2002:a54:4704:0:b0:3a7:3ce0:1ad7 with SMTP id k4-20020a544704000000b003a73ce01ad7mr444482oik.20.1697666020350; Wed, 18 Oct 2023 14:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666020; cv=none; d=google.com; s=arc-20160816; b=muAV71vfqJSIZsqm8q9ljMb0U1MSNkdk5ztRFG2rhuR/zH9yTcJ7Q5ao9Pqj1v3I52 /RJek/4zqKTnTHJ+pADadnV277+5fY56jEnKo+NOmF3aVGmlyCh9WKKTx2q0qMEq/s1n X9h5HkjqiAD/WadgaUnAVgHrt7uFwSyaxmVOOWk++a+vYxvv9xvBzsCZWEmT2VVH35fa jo2F6OaY24BsFTMDBSKVERGN6LMMQ9zug8eOSln3fsvPr4OJbXJ+M0zcklU3EznvzT8K mpeC0ZJM+kCRonuSq14jjgBUmWf3jXNMN4GUgyYUVj+Dy8G3dnk9HVVU/cAJ93f7eJ58 VDTQ== 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=X8D0T8IVajXJnrSYefRA6ZV+yd9zhaNhLNtJGAv0oPE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=lvhpBh6tpg0twg+PpAdVRWIhVvvmX0d3ZDxpQhsTvNiXBwTgXgRM3sP3cOaocJq/jL tWy8cT42aBEaR+7YWarbNCwrSPR5CY14t6fKLuF4fB2FHXRxtEdLKfMTPwDbkKSZs7mg U2kjVb23Kgsn+LuS7tjAid72q6BHyzVSLqMm2+/KueVPQhRbnU114CjET8/3zjoYiOk0 ZnCEPuTWUSWMYI2etFxiK48r2F2KIx+cDGgY/1d78P+vpHdDYd+sqI+Sp+DauRS3ypnL DLunJYNfK8Igm/wb+oVmLerWZedLGXy/TdqeKivhJiL55Xxa0WgT4r4pyA/T0xjSiwfp b0cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wi72Nawy; 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 fe2-20020a0562140b8200b0064f68c194a6si617034qvb.73.2023.10.18.14.53.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:53:40 -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=Wi72Nawy; 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 1qtESo-000248-C8; Wed, 18 Oct 2023 17:52: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 1qtESZ-0001UJ-94 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:11 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESX-0004Tk-GJ for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:11 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1ea4a3d0a44so2317582fac.1 for ; Wed, 18 Oct 2023 14:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665927; x=1698270727; 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=X8D0T8IVajXJnrSYefRA6ZV+yd9zhaNhLNtJGAv0oPE=; b=Wi72NawyS6YK63OBWyi/HgwfGbqA47Q8yvJYw+6xpWsJm7ekT+jfJVJVSu98rqBijw 2C/GMCO/kd4EKUgMLQINTsDFfkm4DrYiXu4nQd5bErV4phqNnpSbW5zG75jzVbkvdjd5 Ci4QLSQ+liHivUlH8MHmCMhnHovYB5AsYadgstH47EDhiCIczSusrA7y6rQtSxkfH+e+ uQ+8LtDYNpnWUAsQqnIC8pK6CdQrCh0NQx4RyYipC8WJHZe8IH+bC3WGjSIuW/WJmHUF V2mRQ9yUbeQhu+ITQTjuXOuZWYEw1OeIjqv52VrKXFPiQXiHzUNAg62oggotbuzeKP7e XHOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665927; x=1698270727; 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=X8D0T8IVajXJnrSYefRA6ZV+yd9zhaNhLNtJGAv0oPE=; b=rEl0E7ANXZpq7de85G9LqAo9N8o8OprQwKOTHMr9UmgyYmGzkNpOC8NvucaXSeAE7t jnEPkywFMVtIxthqhfegq05yln8bcp3FGGC2XssPqu7fHVdrxFQNwDEvyc+MhYYVSkWO PJcZJIVVZjqqYEI5hQS3bvDX6J2joyWZ+xHsP7sBeWsmyls6HVlHfUWoEE0uAcMs7WTo KN3sUy+V9+vLjxCPkgiollb0QzmGnOlqGsfEPZVU86HL7lD9IKRR8sz0lfkL3OzSrpEJ j59pPmF8iJsYo0PwYxrzr8wxVSMLarpLyoA8crprMLOLFHBiNyZ6s3NCyFdVh+qUGlkK c+4g== X-Gm-Message-State: AOJu0YwOjZeeoj8R6jqmERAcrZ6fAhSULFqQnHTBZDnp64X81lsmpuZ6 Hqk4lVg+txmK551bMGnl/N4B/PBx1QBhxmh9+wY= X-Received: by 2002:a05:6870:be99:b0:1e9:feb7:71db with SMTP id nx25-20020a056870be9900b001e9feb771dbmr636418oab.36.1697665927272; Wed, 18 Oct 2023 14:52:07 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 37/61] target/hppa: Decode CMPIB double-word Date: Wed, 18 Oct 2023 14:51:11 -0700 Message-Id: <20231018215135.1561375-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2a.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 681c955125..753748082b 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 Wed Oct 18 21:51:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735096 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226029wro; Wed, 18 Oct 2023 14:58:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGpjI8QsS20py0My43j19k1KAjbgfVpEHK6Ow3Zxf+MMiBeqGUNtlSCtAAIsJl4kwST0Jo X-Received: by 2002:a05:622a:1756:b0:418:4e7:b82c with SMTP id l22-20020a05622a175600b0041804e7b82cmr612391qtk.57.1697666325667; Wed, 18 Oct 2023 14:58:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666325; cv=none; d=google.com; s=arc-20160816; b=xeYpvKM61BDpGVPuRv8eNPPqHggI5Uaelf9UhnMY2TyvoThMjCqv2B6YFEVzj0/gOD zHZ8Tfd63ifyKydARykyZfBgQngONOiSBynqVC2fxWVdhUVZ17SM0+WnPZWygArNN8gM xgoPLXQ568BjsMLfjTAEq3Ix2km/vrW1TYy3xEWVadNkShSEmcjerm5cw65Qu52E7wAR AlM1qNDjCoKjdUxvrzvIc1b4HyRzM6r05JLM6d8i8E56vrsk6VrljSxrDSvXSuToePth NAc29xrBWQ0jNeb1LneYYhmidIQbMHUNyKToTonPTzqLumqPxlNb1aen5GcLp3OAod4M C6WQ== 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=zRIf7kxBmxh1/shdoAtqyWNqtUTU3VEXUB+/Zv/YIyE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=EdrEuSLxOyQA37bT7Obqc/sEDI4LGdwhz8T1fepDj4guHsuJu890Xbz7fzOydKPClW NQJRtuO2/YmtUFZjMednZsO/YTm3ACyNQz4DTkxS1XxIuybgfJinueQCL+DYnarMtmlN DMx7TOgueUgVIEmEjo0HLPlyI/MdY64KHCNoCkPqQoSWU7H+GjJ0Fr0n8mTKQYaVTJmb BkGabk/G9VMLtfyeMSR8i/0dPujnXsi+nt3PQ3b6yPUAuOlnVhuKZ5wyTHoSFze72RHq HLrKl6JtAPyZBu0PgfyoNtjrS6ZTavQXyn3T8z+eFzxGsqtSpBu0X1XDlkv675SOhNHW AN1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XZ92CgZc; 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 y18-20020a05622a165200b004181c16dfb8si639444qtj.221.2023.10.18.14.58.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58: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=XZ92CgZc; 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 1qtESh-0001mx-Ly; Wed, 18 Oct 2023 17:52: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 1qtESZ-0001UI-3Q for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:11 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESX-0004Tu-GQ for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:10 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6cd0964a994so634817a34.0 for ; Wed, 18 Oct 2023 14:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665928; x=1698270728; 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=zRIf7kxBmxh1/shdoAtqyWNqtUTU3VEXUB+/Zv/YIyE=; b=XZ92CgZclert3cgqBL5tB79Da/Y3lv+XTYEDjjtgyiyar+wh8g65AQzWxHljssM4Jf 9RnKi78/EdAf3OYLYAXhVE8xCPd6e7qEZ8LkFz1AABhqVpbZjPlDph4NNZcghGYHysjX MGKyZVrGPxAc+LqT70HzbGve8DfyUYUcH15qIpSXOnx9DsZsoj7gysnm9wRHR8mr6iE/ ruB5NOo8s5cgWOVLSz1SP8BIh1FGQILTM3mHr/inoIpw/Jm2EkPYlIbC1rzh5KPCaVjX kuQv/j2Z+yhD1ljGexxb3umNj7P2pzUdPKvRyfgGWQR57AL2zCbqzXQE6HplGSoVaGX0 v7MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665928; x=1698270728; 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=zRIf7kxBmxh1/shdoAtqyWNqtUTU3VEXUB+/Zv/YIyE=; b=pXr9c6pgBemWOjQBSgl6wjdLmalP2v0a/5NsZly+1yuyvpGyoq+wOP1mK3sJkq7jiw awCFUUYdjIm5cr+bGc9gZWLwuGeYlqSON3ypNLMsY9hoaG/uigXn6s2yKOro+WQoBzxC oymjYxg2VkOc/l+5mgTlpFpaLXQOjRXG8UkYAqnYJbf2qjZq/6USruDbkY+aFWLe0/PJ 9PSCiQh6EYtM6jHF0Z1S5Rx/9L1z/wWX4x+aNtw2QPBybi4eKW0Qy6vxGmkhOQ43t4qm srmE/S6vl5gUU1FtEsFdKSqqDodrcjhgtfWi1Z5oF/7W7oky1YBc1kKH1TMp6eCmijYz IjMA== X-Gm-Message-State: AOJu0Yx45Y8Eg9QKGYgPeztxZJkOOCGg5hdn6kMWlIb5jzIVpArHuOb0 19gSj1aUmYODs3tCeq088eAH7XZ2cDvpWrDNSWQ= X-Received: by 2002:a05:6830:209:b0:6c6:50d0:1104 with SMTP id em9-20020a056830020900b006c650d01104mr527805otb.27.1697665928091; Wed, 18 Oct 2023 14:52:08 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 38/61] target/hppa: Decode ADDB double-word Date: Wed, 18 Oct 2023 14:51:12 -0700 Message-Id: <20231018215135.1561375-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::336; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x336.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 753748082b..7e723dcd24 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 Wed Oct 18 21:51: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: 735101 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226119wro; Wed, 18 Oct 2023 14:59:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8IimlaxtM0m4qoJ7EpmXPmEy6I9HDwQAwBjppYr64YmkQA0w0nIetJydvxB/KTOcPr06r X-Received: by 2002:a05:620a:440d:b0:770:9bd2:b3be with SMTP id v13-20020a05620a440d00b007709bd2b3bemr611724qkp.5.1697666343223; Wed, 18 Oct 2023 14:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666343; cv=none; d=google.com; s=arc-20160816; b=mn6cvPCdk35GbJr2R3OXVS1CaeIII8j03k+BkaSatJXT7XXhPkc/d+G+kThcqsS/aR ooj9q2ApwX4fKMUhLSZW/5Q5xC7wExLL66ZGLXkFPz2Rqaa8e6YG6fpVYbUF+VqMlC6w +hW7BZy5z6iMOl+hPWqj7Nv5J2dfjcnxiZCEbzsRNjm7STSgWTxyc6jVVgwZQ3iwUv7b sRgG6S3Y0dl/oWS+iP/faZHy0c93tkewOM6nbSgEOSdrLJTDzeMyMOWimibWnZmmVJFI MWiln6pcG6EMePYJNHiYalaqGba2WUtNT37WroPGGkWyRcyc0uL5EUk2ma62+ooEbNTR vDrQ== 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=BTsHGEmbn21c10ys+IjqGnSmEEiyrrhk+QQul6l60rI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=XQcRF+UJTZyGM7+aBpXNAXQnk5lvYlH8ry91qf06NDvWoGlLMJ07paAcRwHyI5a21p KKIMM7OPh8gBEHCir/QvILuoUv7mSUAkyBGx20em47NNPY9mFlQMppmfmUU5Ojji7/O7 J+Qu44gDy6OSSbsKoOTQRsf5iWdvYHd48GQ2wCRwojd0NkaNy5Xmp3kK8sPJv3SQms7v GV4dsxOS2T3ziQbyHfmRJE4QpDqLrF8wZTx/T8gY1XhtTHXIE52Qsd4UDZfvJcru7+ed ySldBELv+NiJESZ1mRuiuTOGyD7cS8dIHf2d26Z4uZehtklOn/PnF7Gj9mgQEp++6wB4 uFuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nKnKRpkp; 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 h27-20020a05620a13fb00b00775869cf15fsi587653qkl.521.2023.10.18.14.59.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59: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=nKnKRpkp; 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 1qtESp-000253-65; Wed, 18 Oct 2023 17:52: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 1qtESb-0001cj-Ar for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:13 -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 1qtESY-0004U1-DD for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:52:12 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b1e46ca282so5750796b3a.2 for ; Wed, 18 Oct 2023 14:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665929; x=1698270729; 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=BTsHGEmbn21c10ys+IjqGnSmEEiyrrhk+QQul6l60rI=; b=nKnKRpkpSWxDkshiyJr7QXtzsFM1jq2Iz4ymY6lpSJ+omHKqlQQXr6Ifg9vT5VYuzM LZF1FU5jNlicH+Gv5iethsT9V8veDUW8U12WITfXrsa59o1fIQ8fq0dhHCWYLJX8cMu6 du+bTTH6vhykQlqOg4PBgxhwKHS6Mm1hdjI1SZHagQX9LbtRtK6u1KsejK8FsYlpuELh 0UbDs9Uu04YAWjqm+kV3bqX0ZYY26yUf+6bsTcTm53b4UTuEFjaMTTVsKfsavWwgRgzt 6UAnVL+2J/ITdlAS3CVrGwnriQNO/atOGPt+R7B0nX/WYZeOYhMXCdHbyVr2tpcL+avB VX6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665929; x=1698270729; 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=BTsHGEmbn21c10ys+IjqGnSmEEiyrrhk+QQul6l60rI=; b=Z2we735haMmFXwCgt0Zp5AhcUbP73mJsBe0IdvFIr5TWn0oH8FyVhph+DeeVJVe6E7 E0BikIHZjOd/p1kZFt3c2dYv/JA88HsiFkMyufbCd7l73Rb83D8ZuCO+HxkPMhB7stbt xlIfd2z+ainRhxORNygm9HvlhHKf9XRatBouO76RjKjIUIY49ivk2Kzfko2Z1CUQoN6Y TvRHQCr2vWSI7yx1f5KN2fJjpa0jRm9EvDKrta2V4VJouZEQZls4Ox+2Q9m/Sw8qZuDO 5Seo7mtypJXRgFBPjwh+EZQPkQZc4McfxRmooVwo5CoIcV1fV7GIc2vbTC3RzgeaTmix vDMQ== X-Gm-Message-State: AOJu0YyGfc4OPOWCABUHtGOl8Pn4S32lDRgXRY0QbdyqsmBjTEFyo2vV J5TGM/Vg+bcnvnFeDYIExa1xERYGa6xAgKXDxNE= X-Received: by 2002:a05:6a21:4881:b0:16b:79b3:2285 with SMTP id av1-20020a056a21488100b0016b79b32285mr391796pzc.56.1697665928827; Wed, 18 Oct 2023 14:52:08 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:52:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 39/61] target/hppa: Implement LDD, LDCD, LDDA, STD, STDA Date: Wed, 18 Oct 2023 14:51:13 -0700 Message-Id: <20231018215135.1561375-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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/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 7e723dcd24..308b8dd263 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 Wed Oct 18 21:51:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735122 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227356wro; Wed, 18 Oct 2023 15:01:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHze4dNSK0C8doIgw+rH294NVvgRkq0qus8kSgfVCJ7WphjVsRGmFXAB13Y7PIvjlLNlT55 X-Received: by 2002:a05:622a:48d:b0:419:5775:b7b3 with SMTP id p13-20020a05622a048d00b004195775b7b3mr685986qtx.61.1697666513005; Wed, 18 Oct 2023 15:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666512; cv=none; d=google.com; s=arc-20160816; b=zhGzitts+ywZzppKHqE124tfnCKZXgiX9Pqnwi1rTHjggiLxwJJFsaI6BfAo+ROQ9X MZPdg+F3M35YofJtVYMQDCHihwpbfp4oUPGvsQgCFRK5QeTjFdv624vmEv7CNldyO+dr yGyaYdknnkGjI2+7ikKZjo7TXzoj+m8BzIVwm4HzWP/5xpNCExQSAjLM0j174P4N7t0X s1l0nf6pnpt4tJNMxszJgHXmZ0SFmBCAB6k63WKP5txo6ofkPsKhlWRSWGS4+gmscSJw hnsDz963qwsStXrXtmZBH7a+DkIge5D2VjX2s2giUMYNxYxRbPVEjwYCYMF6ZH9V7cp4 IY4A== 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=YJFEdGs915wcYeWHi0GO48pw7TVo3wCe1dYizr8poqU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=dxtckm2fcYUItikK5C26cPn38ppvYdTymYXVqFWDR63BfWozQKTpARHTUBj/cw+9B7 KHXib0LK4iD4rgvc9IVFh7oiKoYf1CT/EEfcTA95dQDaf7A74dcsbW4PJwnDV+zjSvuo kjyo92/LH8G0ODfO3UdHg1L+k6xAGa7JpnMi48CR1Fj6lK5Ovr2p36ehJYjAVvHnSZyH PZZBTEh+LnMlFvmcTu0fry6vcO4FaTrSbC46z/yyMvJtd1QvsA/ZwL3ePiC38Qa0BRIc KzwgZPvUENn+96YH1omGiOBSf56+H6S9IcxKE2tmBqOEumLOSr/BBoGg6yr2wpUYa4V0 vQUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bQtp6aaW; 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 u19-20020a05622a011300b00403b977323dsi617972qtw.18.2023.10.18.15.01.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01: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=bQtp6aaW; 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 1qtEVa-0001rW-KH; Wed, 18 Oct 2023 17:55: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 1qtEVX-0001em-83 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:15 -0400 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVU-0004zV-F7 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:14 -0400 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-581ed744114so871278eaf.0 for ; Wed, 18 Oct 2023 14:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666110; x=1698270910; 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=YJFEdGs915wcYeWHi0GO48pw7TVo3wCe1dYizr8poqU=; b=bQtp6aaW2pSIEXt6w4aLFoe1VHxmFnG/ntKNtKpL+z3cTn2bP/R/YdSb/xLqldXFMy zbjSH0lsk79vWEpc7NMOC/wnnRVgFpciwE/YYM41V0tNm8PHASkW4cdHaxFfMlVtADRm e2nAj9CDfIKvI8FFGUkqlrKPJkDb4GE3VNRabd4AUewJ25P0OqItF0BlV1Dkrkt9Iisg v11CSPj0UJ/lLLs1BRp/j5+SXxdVhU9g2Xu0vUPhwRRzMGOF2u7OGjlztJchCTWMi8RN 82q+QwOzTfAUANdu6IALnPbwCC80II8bA4h3fdnCW8/XY/P7lVa+CwTqy/Rn201gvrR0 8uNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666110; x=1698270910; 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=YJFEdGs915wcYeWHi0GO48pw7TVo3wCe1dYizr8poqU=; b=sC1uZNX6uJ9043bryJylw6TURkR4+Fu/fvjtnfhM6xCGgcdTdEfWs+2EYPVab7NOF4 qA1pGpe8DcomgLDdDSKceJ2eZd9ib/KoYsZRTuJ47M8Z5sfK0ygkZOh5/+/IiN1sYONC Pjh09mn3I9urJO1H0M6H2nmNgvKlV9g+GXFOE5/rVl0B+63/eqq/Aa4FLxXReon/XlBM a7prcmucepkqcyuxieMdYkYxE64YSLUpPxGdHbGDmFcd5Q2q0/GDawZbZD/X2aSucmEN ld3gmzTkiD5vt5p0pscvHjDIXzEZ2LmRNkLnEwWiK46ZzvkkfRLJMmTzau+hRtmeZWc4 qwDA== X-Gm-Message-State: AOJu0YzxFuhK1+TNcswpjwxFkmtPHO4+t8VHZHDCE8CU4BhLCqBoFibU tJsuxBTCZzICtAc5m4VScYcnBRpvw8oCCBQffgE= X-Received: by 2002:a05:6358:78d:b0:14b:7ee9:fece with SMTP id n13-20020a056358078d00b0014b7ee9fecemr327171rwj.7.1697666109977; Wed, 18 Oct 2023 14:55:09 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 40/61] target/hppa: Implement DEPD, DEPDI Date: Wed, 18 Oct 2023 14:51:14 -0700 Message-Id: <20231018215135.1561375-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2c; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2c.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 308b8dd263..b3d3506f94 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 Wed Oct 18 21:51: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: 735114 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226926wro; Wed, 18 Oct 2023 15:01:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgVXz4GzEQVQiPKS16/CLVFPeEJrlMTsIlNoCshqNBlWAct3qKyIsOxjIaBkezXrPMtLHS X-Received: by 2002:a05:620a:288b:b0:777:5120:d5ba with SMTP id j11-20020a05620a288b00b007775120d5bamr486052qkp.8.1697666467498; Wed, 18 Oct 2023 15:01:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666467; cv=none; d=google.com; s=arc-20160816; b=nCi+60By01w2u9tJz+DqbiPLfnzJlT+vyEpjtmoTSYL/BZZ9DxWuogZmYvxfjl+rql yFY+2LbDdFVK/bAi1R/ztkFBWn/RRO56SaFavmcq3yi2OFOhQoYDXV36B/Mm3pI4VF67 RhrSFZw6tO8YkHGG6UVaqqXh7pfoOvK8Y3w2Q8GNS52LPquZNky1ty4KQJkUhMbn9rmk WMJoapNuT9tSW+Um147r/0Fbp9vosZZjdNzWRJdFts8icBpVDirWWvW8zctgcvKbUOJM GT9Yyyh2hd1R2mtUnYmufumvOWRtlv2s1luilbtF9nxIv4dO42BkMCkLUvvmpY6tynvd i1cg== 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=78mYjhrfKONFT0vl9EP6HLOTdieHpipZhGsvKVkOOxE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=p89+tvuvHpB1LA99RSjTVTmePm/fhzs9PYufG9cAff9Ii46YAVnUoffvWCTDjPj6Uf Gz8iNS+0DfMz3ZZ703gz4H+/Vv1VqdJvcopLC7oPEToNAPT2YPpUZJAleOxHKGiDYr8M NWXzVbkKOZsfBn5p66sO8zppCjVAqlsJciKt5Fdq9v17tyZyKZ8uAa1dECwMB8Yhc+xA zYM/WREyLBR+XwYD9JIKNp6zW1FTbMdxCYyvFBPE4q9Vzu7MRF5gE/qLBdkhrweXVe55 3EpxTishOc7qVrlIt7GHQqtE1pAejHFO5Unmfj1+6/qbrEtKLFJzcstR7mAR1rrSkz8s Tfww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q24X8h60; 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 m21-20020ae9e015000000b0077748582bb4si591147qkk.421.2023.10.18.15.01.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01: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=Q24X8h60; 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 1qtEVb-0001us-1D; Wed, 18 Oct 2023 17:55: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 1qtEVX-0001ek-0T for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:15 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVU-0004zp-FV for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:14 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-581d487f8dbso1242494eaf.1 for ; Wed, 18 Oct 2023 14:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666111; x=1698270911; 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=78mYjhrfKONFT0vl9EP6HLOTdieHpipZhGsvKVkOOxE=; b=Q24X8h60vY6jTvh77B1Bqg6X3LBF6l3RCrgFVAGunsStqau97T5Y1vFe06HV7/n+Om cH/3YfVdXFekhM898ux65skTI3eIM/3pztV0xZI5FGUTdwjswtaDzREn77Sfd2wGJ/os +VybTMgqBT4eieCJztje2AvEdsfa/lMlCi+2U+mHwqEydl2vO06iBQJq9VUZu75YWe9E it+Kak7l/ZeoUzjYPS9DQcCALNO3MHMPVE8O4HyhHsxriaPyuCAZYZoWH37p7cYHmyI1 ltTcga0zEQ6ZAHKbbnS0jR7bhIUhcw2+PaZpm8u6pr6BulsyxEVgRh3JoJ/y32pfEcIa vKaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666111; x=1698270911; 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=78mYjhrfKONFT0vl9EP6HLOTdieHpipZhGsvKVkOOxE=; b=OebrRStvdzs/XOP9Z9uBMwxsE1jxpRDeyRdwXRBhC67KYB4dHkH2XCuUVLRfE/vOKV 4RsKJqtuSmXSyHhI1oG1b31oOxupvLIBpFIcSNEzSoHTYPHkhO0kEHmuVbuXo68Lozur 9iFx1lHcCwvXoCZXmsGLkHAaiaDQtX2I5WziVioIwkKtu8SC2+tr2wJ5Jb34aN4TcaBp j0QPjxYdVjOFWuLlmah73bHNfyt88e+dt6eJxPGOG1JpJAFz7ZbMJ+hqOEpoJVSnA5wl etCocZdqmS6fkigW7oRbJ/hdIWf7Yo+ussVsoga2dvCEYiiL6BIjon9BBsNDXJOc0bbt Fn8A== X-Gm-Message-State: AOJu0YxRCdFcL4Yg71v/MSiaZ3NDzXBUAQ3evc7X+SI6hKCXVNHGimgX 2Xn2LCkuCZmeNIDQquz9HUinmt+wF4vhn7kW1Q4= X-Received: by 2002:a05:6358:9d82:b0:143:81bd:c0ec with SMTP id d2-20020a0563589d8200b0014381bdc0ecmr252602rwo.6.1697666110784; Wed, 18 Oct 2023 14:55:10 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 41/61] target/hppa: Implement EXTRD Date: Wed, 18 Oct 2023 14:51:15 -0700 Message-Id: <20231018215135.1561375-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c34; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc34.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 b3d3506f94..974ed558d7 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 Wed Oct 18 21:51: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: 735134 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1229381wro; Wed, 18 Oct 2023 15:06:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFp4Sa8huddjWvAl1ThwHNnBIeenoGC9hw8l1I5ZzIpyN5iD6JZCsyNHdLHielHc2tq4Bd X-Received: by 2002:ad4:5967:0:b0:655:d82d:2fd0 with SMTP id eq7-20020ad45967000000b00655d82d2fd0mr624313qvb.21.1697666773667; Wed, 18 Oct 2023 15:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666773; cv=none; d=google.com; s=arc-20160816; b=MXr0HDAUZPoZqQoupTmz9/F2v4cqqXfr0z1hYkxP/ZcWAXdE6E377o4Q65JF5ZXzMq 03s6s8rvGMo64IUO6VZk/LkRc4FSBr6H/eyOE9zEK64Ue0GXtKHeV2L8197hfpLO8Dwb /DfHVUgqE1pine+jySV9GuKTCJNtLybWkQSIQpkWPOZG7xVEKFIx82wiRqj0066XhSLD Qwy0Tis5iFzcHUMAcEgOTWA1TvPd1BYIPtYn8o326isB+AAEnqMRvXaoMNol1Bx78i1m 8iS7ffeCxDCdQkO8MqGBgU9uF6ZN4JQS1V7e/H+WdZ6zrjIMVCCcgWv5tLJDd3P+dJ8X RnKg== 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=DqhTZ/67UqvsjENOJGo2HAt1BkeJsPyDRGA2t98wGsU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=owc1nLVNenr4ZVpADWXuA2kxZ3wkLCQ2HcaefLoGfmjhJbYsyFQzpffx5BFZ1Jezp5 LQMfCe/DrclNYgMhfuGotHJGCaQGojwWX7D0153k2l0CWo9XSHHrCaL3OImi8nHFiLl9 wvxWtGt3zB9yr1PN5X0iBjWiNG2RFpk+32/zrrAqGGRqcI3wn1RinnRrZyUojAgj8YVD mbravvBlLwNwNunpKMs/PvmoLuBx/rH760/2cssSjtb4UFloQlJYzaiOMhZUgoy/1uKz aHNzUg1ZnIxQDY7jCZRQLQWJviOd7DQTYcTyl/W2Hu7L99LjDC887IdT9ZDZEQGrfzsM +doA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ikxMF9tE; 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 k18-20020a05622a03d200b003fe296f07casi660268qtx.302.2023.10.18.15.06.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:06: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=ikxMF9tE; 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 1qtEVd-00027r-8R; Wed, 18 Oct 2023 17:55: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 1qtEVY-0001jn-K6 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:17 -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 1qtEVV-0004zx-7V for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:16 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b5cac99cfdso4520384b3a.2 for ; Wed, 18 Oct 2023 14:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666111; x=1698270911; 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=DqhTZ/67UqvsjENOJGo2HAt1BkeJsPyDRGA2t98wGsU=; b=ikxMF9tE7U/Yd7ww0tqIb25FULEZmrVJ2BaQEE2Gn1ForBPoA+Ej6hjamIyGxeYcZR Lnc1vsxY/c7HxkMEMzXwJHSHncKACfVaaaPr7LorZNYUVh4OjNtQEqXM24T+cpe66AtQ LmyJl6INblaFXLGmDJ0PiQ7ThytZRJcxML56qkHQpkG4dDkbH6hlKT+kChCfvF9YoFT8 mDxnpUfSWffW9wjNpZOrbdBWbgQSE3PZDJVgoRboQhjjUKmNucpsu61983Eys3QPyqWj V48g8Il+PxAegFy4SpbjmtwSIvI0wLM3S4L1vBt3c7PN8wuUAhbSgfkJtatncRckUqGQ f20A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666111; x=1698270911; 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=DqhTZ/67UqvsjENOJGo2HAt1BkeJsPyDRGA2t98wGsU=; b=Yn2saIv9Kf34Vw+KVg/WizbsKaLoseK6xLFfj/YK5NbG/3ohGcQn/5lDPxsuUGq7Ve 1kz/xJqHoWU/75IEm9tWohlYiEY8bhPYpuCC42hZfAaXHJW/94fDil7blMlLeD2bZWFf C4OsYGt8Z0sGlYdbqY5iuQXd3O4INruT47qqy7rXMyCPkM5Z2Zx4oqcqsZOqUE9SaFEA PToSjteUwS5xv08cqIQaVePzftYZn1ZSzI943yme2a4oozZPqs2d9jpFTwrEkVcuHheo UKPjPLj0cfZtXaQRABYESySIvGbT6wQKUNOyARmSJpMluGq1ILW9CQZSHldBfIoWCDfI ZcQg== X-Gm-Message-State: AOJu0YzR/PyAFzcpxuZQrScNE9FBLtMGeW7BGdEB99CDfpPKc5aiG2oV Zw+I8bTILvuwQZ881ZCTf+0XKvSDkxejqu4M7ZI= X-Received: by 2002:a05:6a00:2341:b0:6b3:2106:94b0 with SMTP id j1-20020a056a00234100b006b3210694b0mr392899pfj.23.1697666111469; Wed, 18 Oct 2023 14:55:11 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 42/61] target/hppa: Implement SHRPD Date: Wed, 18 Oct 2023 14:51:16 -0700 Message-Id: <20231018215135.1561375-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 | 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 974ed558d7..a23c44e3d6 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 Wed Oct 18 21:51: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: 735119 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227260wro; Wed, 18 Oct 2023 15:01:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNRTfn2Z4c5qxN+Hy9yXu6cZZSnLlO2oZQrBD+DGq/ramXKxErvLq7FSflgLvoI8pd1+5l X-Received: by 2002:a05:620a:4449:b0:777:84ec:e215 with SMTP id w9-20020a05620a444900b0077784ece215mr608285qkp.45.1697666502611; Wed, 18 Oct 2023 15:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666502; cv=none; d=google.com; s=arc-20160816; b=XUOEtlrwKKb0yaEZf04F6yL3SW5t6QXfFRwOu0ye4/Yke7A+dtwFKhaKQIYfBBHylu QJEC5R1XBAB9SI9rfmr1yuNwqiOuX788iHSwmhQm/ex9N9/GbBth021WEesz3UbqA9Nr IpCGW6rZzfAAvHMJMftXbJ2xjsOVs4Ul8DU3AS1Rx4HtHrRb0UBSfRplGdTwrdHtMLRz XGazegGv1G+UpoYb+TP82R3mY2pydEzc7xx5E+TDIzhjFZeHDmlOOEYEfTRoKlm8lSPu l53c+51ZgDulx3ORPbMwQEztW1NcTLrsElAn3XBlkShjgxCyyzXG0sfb3wbvyUrw+y5V pl6g== 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=SHgm4YY+daCPYhOY55WgMv7HyI7x+VabMfn6WJVOWQA=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=K9fCcr7JmswTQ1mWPE1dS+YMc3ol1ZEfRCH0i3CGxVgVAkiX9kdcmLE+ssbclLVYtE ZroV97F94ldWc1+6bMXwXr3tlJJOImNjBYdGbKpfOhCVmFo7uIFSIClZd0nqr7SEkLi+ h1/YtFnwrj2SVpnx96UN5Owij5qS/Ny9WPOBPeBKEqtOPpzfapxwhBjTJLe7KWlkH9yB w/ynZmR6NwQ5OCJje9SC1q8MW/8MLfGiuPjUcKQO3nWtZMo4u0HR89hDZnuOa4z7X3xg YsoCf+gYYY1tTwWVEtvvJJYscAnEiFHfKZ0LcvTtBjVRTAnvqHAzTSCyy0j25U/zo3jK goXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BQbLR0lO; 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 b17-20020a05620a089100b0076cb7c7d9d1si588070qka.637.2023.10.18.15.01.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01:42 -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=BQbLR0lO; 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 1qtEVd-0002AK-St; Wed, 18 Oct 2023 17:55: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 1qtEVY-0001jF-IG for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:16 -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 1qtEVV-00050F-NE for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:16 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so4163920b3a.1 for ; Wed, 18 Oct 2023 14:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666112; x=1698270912; 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=SHgm4YY+daCPYhOY55WgMv7HyI7x+VabMfn6WJVOWQA=; b=BQbLR0lO9c2m3Hboom8DuU7ZGZjj5EbLuduDwVMhQEct9MKL7hhRlBoV6OjtH1lH88 ljHQlhroOh0zIZnXPh8G8nynb6lwSSe6LZIN1Co7fsEXmWKFYQo2gYT8EdKOCZFJkxS5 oIfngqKauUQdvwoDUwV+1RdvOyjQkk5AHP0tsOG8zetHK3iLBbgRjcEJvjca/+UHV/bH oky34RNDev3rmQUVVngB8JTs7y/zVUonjAIRA9YrkBjXXfZJNcFaTksRdLVHrdpuWC9D ZjPpFXp6Aq0gkkVZ9hv0yK8So7sHkbhRLzruAQ9YlAYORaDMSClhP/kRRx8IGM/IXumd bkuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666112; x=1698270912; 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=SHgm4YY+daCPYhOY55WgMv7HyI7x+VabMfn6WJVOWQA=; b=umqB/mcMqJynaMbRwuQJ8S2+YE1oQ5aEt4AQXRkpgKw8u3TsW/2Cco1LuejOCMIXil bizyffH5tlomOm2vQiFkCpxUBD853frDaJqKdwE7lHgV3Pv5pxx8Rah9S6sVy5i7noXc x8H1c4g7W6rAOkKl39rI/JIqVi0I4Psd7frDInFzw3JG02rhTHRPyp3M1VSA6D9d2jxd oiPHdPf/zFmCeCAGwsYJS3vR3clytu6W/s/zo+0Kwd8YpywlLTG7bBkEhKlkyO7rRM3V oPFgDSBYtytOXiE3LRit28Xl/vSs3TX9cOdB4wc1fHeYkQIoV/iw51ZLB2Q/NsG6nRwl dwoA== X-Gm-Message-State: AOJu0YwM0Tm9l8tIXCFNyfTPGBgpLxfLvUxaal9gK3bdBNQbjgpe3s4q yM7tu3Q+o8yuPnJ12WdDm8gsLMPTws8euWNvGfI= X-Received: by 2002:a05:6a00:2daa:b0:68c:4e22:8f78 with SMTP id fb42-20020a056a002daa00b0068c4e228f78mr312713pfb.25.1697666112191; Wed, 18 Oct 2023 14:55:12 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 43/61] target/hppa: Implement CLRBTS, POPBTS, PUSHBTS, PUSHNOM Date: Wed, 18 Oct 2023 14:51:17 -0700 Message-Id: <20231018215135.1561375-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 | 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 a23c44e3d6..56c0a4fea1 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 Wed Oct 18 21:51: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: 735115 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227058wro; Wed, 18 Oct 2023 15:01:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/9clc5z+28c/IJ0FKPNySIPjSssJBXj2CJV9aAXT+RpK7RPx57VNRmioeoRcF0UoJtbed X-Received: by 2002:a05:6808:1492:b0:3a8:ccf0:103f with SMTP id e18-20020a056808149200b003a8ccf0103fmr570369oiw.3.1697666480724; Wed, 18 Oct 2023 15:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666480; cv=none; d=google.com; s=arc-20160816; b=trAJX/x8xfHhgXpI4c7o+k9dj9C3IeRf7Gad8n612rhlS7SffNYUokVUtxoxvYNl5n Owcyf8oFh1yUtRcpYXNnlk6/jCr/8AbXrYptvIaNBzOE3+EegBuK3V66i1BEpnHTCpob E6hzq/vLLqajJKXuThIeholpBvA+WX/cQtaFGaHgP7opuz7t0kUGG7DWAn5kSaN5njmS pQYz5Gt43hK7ctTwJitgo6SwFi36OhYN9ICBnFXYY2Is2xcrtcXfgerDrzzi2jp0C2Fz FBPxf6nEC2lMVklrChJP0M5601AeKxNDVW1x0oZT41/41WJpeq2hoR1QZo5moDodfjjS mORw== 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=KAwDpLAGfIyH26tpyyPKP6Uouhfd60o6tt7/ZEef+tQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=nZKnf2mVRUkDMAdyBK3s6U8rkBcmwIIop9+KhdnlBo74jJB5g2rvqqK/55gbx0y8fb byfegODuyfczXqoL2Jhc3Rp8aV2Mm8rbnX9stwOkQEsTVvBNuG0+3SsanNQn2R/nIMp6 p8SlwfZrmU2ASbiGH6T+kI8cGIIwNcn41O4vL9aPnhp0NI6ver9/OW80+ZvoLSa7Jat+ tMZQe7Uze121zI2ObJTElq+RboUh79ypsFhkxxdyxu3qOM9/vxHsahpVGHaAlSzcEjSu bwDtrV3m5VgsA/iD5Jk49tWrYVHcKp3sJ+Wic1N6eZJrADK4SUOUL820X5qF5CneVkiF 0A9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nhXY2lIY; 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 bk39-20020a05620a1a2700b007756a7d993dsi676219qkb.252.2023.10.18.15.01.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01: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=nhXY2lIY; 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 1qtEVb-000205-M6; Wed, 18 Oct 2023 17:55: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 1qtEVZ-0001m7-4m for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:17 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVW-00050X-S8 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:16 -0400 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6ccf6f4d852so1667053a34.1 for ; Wed, 18 Oct 2023 14:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666113; x=1698270913; 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=KAwDpLAGfIyH26tpyyPKP6Uouhfd60o6tt7/ZEef+tQ=; b=nhXY2lIYNkrkreEiEBU2x+fO+5WHi0tC7MBz6QQIn7xQ8AXgx1fTP+H7yv2NTbGpco MnO3OEju8fmIMoCxOC2e/ss02kxM9TxREzSpJcL8ugm9zFA7G8gYNSUadOKyN44aVaML WloaoPlaI8hw/s9SeC5mP4hfxfGpUKfAxtPHTWULowX4kWjq4R2gMJzHp9nDSbv6kG05 GzHWw4Luh1y49P3Ftd91R5C1tyPcv0koRmyx3LfiXacWOy0GVQbhWl498VVCQ4rCvvW8 bc2fZQFT1XJhUIpPn9+tu0+Jncg7/MkF1BcaSelixm+tBzh4qyGmyJvJ/M07lnHkp8IE BYQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666113; x=1698270913; 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=KAwDpLAGfIyH26tpyyPKP6Uouhfd60o6tt7/ZEef+tQ=; b=VC4M5z7T2VKJQkkk1t7XhQVVHNf1k55ofVJ3GgHebTbU0zV9qex2BpgHpU2r9CcUSL u5Zy5Tm8X5LgoctBx0ywNYQ/z1BbP+TDDkdCbCH6aupEaVvjfIOmIWJUVercHVeOXVJ2 okgf/0lMHWW3grDaGx8Ed0179HIwbAeMIRHunA0JzPjjNn21uN7+SQui1MdFTiEa6cWn we5mz1lq6ilbcGXG3Y01zNVn16TnkBTaPzYip6PatwROVBE/RdPav/YDpy4aTVNAXAc3 +RoEmwhn+U7IoZfVMsJR8jMyB962Rl5ST+7WM/KUyO2Guj+qW+5dvp4SnEV5O40xQaxB AC1w== X-Gm-Message-State: AOJu0YyrDtoZTQz00tdWm2U4GvV0hTNLeRqm/R8O7ozEd5NFd2WbBY7R 6BtZMnbwGtZZZNiTYsGSRx64E1AZ4GOsovLRwa8= X-Received: by 2002:a05:6830:d3:b0:6c0:7bab:3457 with SMTP id x19-20020a05683000d300b006c07bab3457mr622186oto.20.1697666113557; Wed, 18 Oct 2023 14:55:13 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 44/61] target/hppa: Implement STDBY Date: Wed, 18 Oct 2023 14:51:18 -0700 Message-Id: <20231018215135.1561375-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32e.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 56c0a4fea1..4a0ae5a772 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 Wed Oct 18 21:51: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: 735133 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1229236wro; Wed, 18 Oct 2023 15:05:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdgGyLIZOl4fxzg/3eU/6UFj/lrW66zSzmyE7wdLoekFznCfjr79AGJwPZR639NC6cSBg9 X-Received: by 2002:ac8:5a8f:0:b0:41b:773b:255a with SMTP id c15-20020ac85a8f000000b0041b773b255amr228564qtc.24.1697666753819; Wed, 18 Oct 2023 15:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666753; cv=none; d=google.com; s=arc-20160816; b=PXDxxtjRQiUYEtBvUyUimuDLCdDyISzemM8ByC+Szn8ag0zNAR6Mh5/XgITfjar9gl Qqh8GNXKmHvCVBbHYVGsW/MyfPHkanU2iWQDUoyPd4xTWuvNZn6oYPr8q+Hx+kAd0gSz g0LD/CNU/oa8PeInjx6qryFltpNH2nonCUVFLZLgyqkmQrfKAsrmdWcOtdq1EDfq90aM N5IOxJ0N9M65aEj1n7i55qEFemN3TFGG0ybTEfVlg/vziDPmDHwqp+OoWqcQ4mt7wrlZ 6x10MfnbMaGS7C0OVK9hDd9+WkpfqoTfO3JLvKGVMohCwES5jGTr9EYDZb5DFywsuKYn bKZg== 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=v5Wi3y3AXC6NylZkbJ54hdYGshwDCMU44E6eCyr9p3Q=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=0VfpBh7BcKgitgeC/JieuvLBUr7IOgFl+wSiznrKUJ6rt98LSSgWUlv3kEE31+JQlT oOTmqQ8LIOo0WIMDt1uaQ3D3w+O0E4B8JUd7fFe4amHcF0xClq99LPHmD8uq9F0ro+AR uK/pOO5CGk42GJ1YbcZJrfe8lpjVPpYiZinyZbTqK3xU9txtkSqCa0Pfgb7gTpYy6/rZ 1UIzbsUTQ8SDxDZKcEluZSBsmHLx7aPacCI/5AfquAiFscEjqtFiSfv8yhUtd3Ox0zFM nZTk1qUotTQ5EzDzu5E9Ls27S/O1X3csQ0ySag0O0dPv93S2h2KJ/JEVxOcq0MzHoG2L iLtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EwwSrtsT; 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 g2-20020ac87f42000000b004035dadf9f5si598852qtk.700.2023.10.18.15.05.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:05:53 -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=EwwSrtsT; 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 1qtEVd-00026n-4C; Wed, 18 Oct 2023 17:55: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 1qtEVa-0001st-M1 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:18 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVX-00050h-Is for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:18 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c9e95aa02dso1260895ad.0 for ; Wed, 18 Oct 2023 14:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666114; x=1698270914; 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=v5Wi3y3AXC6NylZkbJ54hdYGshwDCMU44E6eCyr9p3Q=; b=EwwSrtsTbxeo5JL11ZpqkHhbonFYBXv/Hgt0gHEfumb0zMCB+JOuPUSayDf6A2PHO1 TwLwR1XLYiJnzlLQya/uv2uDLsvlPtR3ffhcgbAtw8BzaBMBfFIPJkMkpaEVHJWkaHVa QuOOp09/2pWqHuScK/QAlGieftdCvW2mmhC7ccLTCHn2Lj3lUE9q2/cEOs6Ju/mPafMB k/rqTXmpXocW6kbrpWOFFm9VhVq5+itHk/w42nFFdOFjPZrVfDeWVYTYohorhtwPmRPQ +Vs1w3NaMBXeurMcUoNILQYjXDGAXCkUUbyCsIpeGeBRiiRGIVqBUfX/V2nbwwn/4/xo c8ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666114; x=1698270914; 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=v5Wi3y3AXC6NylZkbJ54hdYGshwDCMU44E6eCyr9p3Q=; b=OYk1TgXtRtLo4Z4w9Hu5Xgv72MI5AOUKuAAVcQpFyhBQVfDvijrSRAg04k4+r8Ec6l A7JyiM5iRk7X5EBHC0ZI41HN11F+py7E/XVteSjBnHu4LoLTHlFC1IZZmq9kA8nkP9i+ HoqUa/XSuqSBGqSuymaptmp55/IsoiOwXUxJhAhI+GrjHvRsIGOiTKUePpE0uwKyd9CO UUsYWPyjQxs3LTOCnksfeKIHT7EENtZvxhhCrMZDetbDjzNnNlOcOxXMK21geQ/L9pvy nEIERyIRVSbdT4bkW9PRwckZYButMp25Iv01WyGhp/c3+F1EKgAnwdjEfiYLwwZ/IDTt TEJA== X-Gm-Message-State: AOJu0YwDlHkkUQU2Xmh//bG9A9bw7mZQrlxcEe9tvOWB6NO4uup7DFFR +L6ttViQTLWB3aAJQitNyBfhncBt+ROPy+/qpII= X-Received: by 2002:a17:902:c404:b0:1c3:e2eb:f79d with SMTP id k4-20020a170902c40400b001c3e2ebf79dmr217593plk.8.1697666114241; Wed, 18 Oct 2023 14:55:14 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 45/61] target/hppa: Implement IDTLBT, IITLBT Date: Wed, 18 Oct 2023 14:51:19 -0700 Message-Id: <20231018215135.1561375-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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 169e878479..d6f46b18e9 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 @@ -520,7 +563,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 4a0ae5a772..44dcf310b6 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 Wed Oct 18 21:51: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: 735136 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1229569wro; Wed, 18 Oct 2023 15:06:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSbFXQSJqkJnUHNFzTMVkgKvLBWcMSkD5zncXMi1PJSF1OEZ5rDh7LnqYH0by7+eWOy+jM X-Received: by 2002:a05:6122:4e13:b0:493:8019:ea65 with SMTP id ge19-20020a0561224e1300b004938019ea65mr395892vkb.6.1697666796388; Wed, 18 Oct 2023 15:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666796; cv=none; d=google.com; s=arc-20160816; b=SqqfWX+W56Gge9X7Iffll4hVIr/Av8fFIt+8+i00Gk6N2AFGpuj+GOIe2fwCfcG4uv 53p4RIuulyiq7VtoU39lvRFhlvFW2ErsPYDsV8rQDJkdckGvQka7YPCVKrNA6kUNylFX 1Y8o+K6dqV7/PlEGKPIbkWSIg66jRehPXRY9qLfpb3bfwf8dNNVc3xhaQsFwQS9C+WJq BSZEdFPm4a5urhvMkA1eXwTa/5pbMcUN1YH42gr5BHO1cYHinRLOzZHgXnV3ltqyJYw5 MqErhiN00kafE3Bcy1Av5UUzqCuRxSXodXT3n4zOadw8YZ7r9IuLRoWcCyxfKl891tZY kISw== 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=1YSWkebDb1aF25YdLI3KCaxkO43bstvjPk/lV3yHWuY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Rh1i757tSQAHldIsboHEcCSvmJXyJ/8Iljc7oHVPRxUo78hSyypJp17hSwmnH62JSD M3q4BvtNHI2BC4BUiYPjc4qcJD7A5n1uEC/RYlTaIZDhcDW/vQxVDFgAwxIA2S8lPBpO fs5eMzPD/c6RyfCg84h+mbELgDFRlEyJBx97fyK2PpsLHV7KiUEqO4RY4YTfXvwbzZbn zYj0LMrRoYy2ULN1V10r+PoI9x+tV8haRv855mqoyqThgvQIlZdWa2JOJ5PJodZI62xr kKHa+nkwaMyeA7SHXkoxUomyq3PVe8uadYFcY2Eh46Emwn/xF7qUvWCQM6SZec4FV8jd VRTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k728jwAK; 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 t13-20020ac8588d000000b0041810764755si614734qta.797.2023.10.18.15.06.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:06:36 -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=k728jwAK; 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 1qtEVd-0002Ai-VK; Wed, 18 Oct 2023 17:55: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 1qtEVc-00023r-DB for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:20 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVY-000510-Hl for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:20 -0400 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6c4b9e09521so4800950a34.3 for ; Wed, 18 Oct 2023 14:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666115; x=1698270915; 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=1YSWkebDb1aF25YdLI3KCaxkO43bstvjPk/lV3yHWuY=; b=k728jwAKx3dZjXhsGErlOowNbmrqdm8G2DO5NQegtqi8inGPYUkGv6Qgw7eq7f5qsZ EoUXcKYsaM6KSKnqlBL2DPBV1ZaLc69aGQNiGm0ssqI0luypsYMPDPOeys5236Q/p/Hk HX20t9UJ1DLxZBsuchZLnwMsXlDPpnTksBLbrSYKE2EGPCHr0W+LtuYy9O8v6v0j0PlD mY/fSucQl2HSGCBJHn3mhEkYmiC2qSSTAov5ZiPN7BQOJkqSh8UvTOkl/3zMtTrLCsdB 9WQRd9QO6piUeI6F4TIAjDTP/4AWu4ADkbfEOMAQjEdB+2ogDH2L1P745AHMfoPO2jPU JiUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666115; x=1698270915; 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=1YSWkebDb1aF25YdLI3KCaxkO43bstvjPk/lV3yHWuY=; b=ccb3YGqNE8Dwcf/5ctYN6L6Qfhay6HED1KwjmIZVdZtD6B085U6JudwsCZ19izhMRv Rj40FpbSQkkoZ+2cXrpKUIc+HS934ap+kalTQ7pGVfjYOuFdy182108Rixa8OxSha+8V Mi3NElhYEcZ8dZKW0SvGA4gytrad795sd8oWWcOCG9W9lC8cmEv5RHfrfkUMIdKZ4NWR D7fbJ7d8ZLsK4Dm01cI3vDYFs+6OVxEv86tX8deFFpJ8ZKDaxM6t3LtISLdAwIepOjcG IWkxAwFJzMbd5999fruiPSVF3Fe/LCvFK0HTqOsf+qwtUCFZyv98kJNJt1StQd00KkCi gRYQ== X-Gm-Message-State: AOJu0Yw1KZgMcK3lOn/y/3EOurIew3OCALT+jAKgKQGfYndXm1WOis5s OAAO/jQtN93HenRuIOaX5Vcl+/5goW478xDYkxk= X-Received: by 2002:a05:6358:9f8f:b0:166:e1cc:bc27 with SMTP id fy15-20020a0563589f8f00b00166e1ccbc27mr232766rwb.10.1697666115068; Wed, 18 Oct 2023 14:55:15 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 46/61] target/hppa: Remove TARGET_REGISTER_BITS Date: Wed, 18 Oct 2023 14:51:20 -0700 Message-Id: <20231018215135.1561375-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x332.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 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 251f85444a..5ce05046c0 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. @@ -257,8 +245,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; @@ -269,7 +257,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); } @@ -313,8 +301,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; } } @@ -328,8 +316,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 bbb6080e2d..5654061a69 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 04cdbafe9d..f112648764 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 (env_archcpu(env)->is_pa20) { @@ -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 (env_archcpu(env)->is_pa20) { @@ -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; @@ -121,8 +111,8 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) { HPPACPU *cpu = HPPA_CPU(cs); CPUHPPAState *env = &cpu->env; - 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; @@ -155,8 +145,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 d6f46b18e9..96fc3103f8 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 44dcf310b6..46a9e83508 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 Wed Oct 18 21:51:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735104 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226164wro; Wed, 18 Oct 2023 14:59:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHM2OJukYT0hEJ8c/iD3zTrVF6cmd/i2hk9Dt+7NgYgOObk9+Y5o1SCaEEAG8sd7Qh5XoaL X-Received: by 2002:a05:622a:589:b0:40f:ffd3:61fc with SMTP id c9-20020a05622a058900b0040fffd361fcmr485129qtb.9.1697666352109; Wed, 18 Oct 2023 14:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666352; cv=none; d=google.com; s=arc-20160816; b=NB3I5ezGNu1DqKpBbzzlovh+5+KPVLDA4S7dmy1dv23cpXHnjrbU0pR31Rc2iVdCaR HR6WCtS5lJnDWG5mWy/6kECEiBMv8JoIZvldzSEI8PVh3qucCTbG4BNTBpjpMX64IZNn hGWj94DDcqAkCC03h0jCnJwldoEFVOp3peDASVlPkUne9slfpv+CplKYs9oBngXY2r1i +YtjidDCy3c1t1Qrl/NHP3Bb89AqIc7Y9SrBub8rZS3NM8ndFE3l3d91xk+7X0xlta8Q hol8wpBfVqx8ARYvBzsx24WlbVxQbCbxTEGx+AD8bi2AJ0WqHjUOgbM0s9BnfKcA19oM 3Q6w== 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=q9TNZKzal6yLNupWTK1p/wqsexoknREObFDjNpGRjb0=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=aVNkITXy2VLiEUVS9lmeQkK7ivGDqRj5f9hvRNLHwXsRQNIOled08RuTGkjTwwBDt1 ZWWTbIpNYLuca9b9fbgyJBqWZkfG107IQRkvWEws/YerSyTc331gxPViEvlE7tC9+AI1 33DizcRzBya4lQhmJBtRiK1M71yZQs0I5JUOkOdH5Iczw1+4hjz19vNIxUitKbEAqwdQ U+kfMkR1IZCv5piEdac5xMCi+A+KRwsyrL7OfDptT9CxkOQwAl/kW3x/fWiyYkYC8MjO ebH+ymZb6Gx2oJjeWbRgSifeUOpu37PnZmNrIyHUuihsa2gRcgmVyslVC2+/WGyveEw+ +wfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gNcTWp+Z; 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 6-20020ac85746000000b004198ca326a2si646462qtx.507.2023.10.18.14.59.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59: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=gNcTWp+Z; 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 1qtEVg-0002D5-2w; Wed, 18 Oct 2023 17:55: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 1qtEVe-0002CK-NU for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:22 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVa-00051T-1E for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:22 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6b9e478e122so5074940a34.1 for ; Wed, 18 Oct 2023 14:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666117; x=1698270917; 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=q9TNZKzal6yLNupWTK1p/wqsexoknREObFDjNpGRjb0=; b=gNcTWp+Zk3cT/JIJ/Gi8mmUd1PlD43cO3uhi7CmmR50Wz4rUUuHhpqS9ksAnkWbUO2 9nGsM8lCeMs0Cfhrn8Wo4qv4bDyxJvUlmPrjTdh4aabTVuVhgTuVRz9Q7EeXkdza+ZAn NqBVzjjvkcpJuS3dQE22wz7yLQkViD3kiB7dNGtbOI6fcJcc5Rf+zj0d8Y3CdTvZ0aBP bm+RpN93fkhTakGGh4qlWB1rg8YO9oQXa4GmOzISvdc19gWkNiBAB8VORjNDHtnW4ypD ONXqVvm6OEBgDGdTHazTd95T4GAjO5njyuKXSBB2mIZewnADvPj8nEJ5HjIOm+CJmC8z VHxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666117; x=1698270917; 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=q9TNZKzal6yLNupWTK1p/wqsexoknREObFDjNpGRjb0=; b=XzFtyGBIOYAF8rBknz6m7imNunEhKKN+OW9Px8eVPmPwV2rtNbNhUQ7G/BaewMEcfH MirR4NEz5IF7T5jiYn38DMxCQMaUHiFDYsdoB0ZsO6EVpzQs2aFF3mWITwGM7B1IkPXP M4yt7gIlEodN8POdmzmJXJTBluasRVtnllIeledyHilTW6B8nwblzb86zMvU4XUOgWEV 53LiY1K5uogyWInMWc/GN855BJS1W4PvLP9qXJv/9D9zvtYoXygt+H52iO6lcZFNiiWa QJbwsM5tI6GVhrtyZrh4qIdkeef7nI4WTRWJ/hKyYEIkiVOwdJrQHB2sWXF81m7KiPqp OqSw== X-Gm-Message-State: AOJu0YyW6VagUjahPdFLdVsehBoONkhvQgQiagetzzzF6dOF4qcgRH0S 7hM31rVMxPBDJBo2nBSMPruhbYD9UZDAX1fwgdE= X-Received: by 2002:a05:6830:1d4d:b0:6b7:6e07:4951 with SMTP id p13-20020a0568301d4d00b006b76e074951mr512166oth.25.1697666116236; Wed, 18 Oct 2023 14:55:16 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 47/61] target/hppa: Remove most of the TARGET_REGISTER_BITS redirections Date: Wed, 18 Oct 2023 14:51:21 -0700 Message-Id: <20231018215135.1561375-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32a.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 46a9e83508..682cb518d6 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); } @@ -4295,7 +4197,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; @@ -4341,7 +4243,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); @@ -4351,7 +4253,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 Wed Oct 18 21:51: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: 735094 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1225980wro; Wed, 18 Oct 2023 14:58:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6UCWwLixU0QyO2mK2LBH6iC7oB63d+jJjN0RK4mC1Dihk1NfpZF8t4dihMQg87jnzLZ7F X-Received: by 2002:a05:6808:113:b0:3a8:29a9:e4d0 with SMTP id b19-20020a056808011300b003a829a9e4d0mr501106oie.34.1697666316129; Wed, 18 Oct 2023 14:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666316; cv=none; d=google.com; s=arc-20160816; b=fuL33At64VXm/tH0ab3vJ25tUNjYnPdLTo0KKlDlwYTgxGohMgEpvAQIwW1c0fJmFv xeKPAdgbGZpnApCa4H+FoNiApDdPz+TqbOnmwfZAO+br/Lg84M7NvkKIvr2S5hpCfkg6 H2HwPV1p0N269GzZbxEg+PBPIfpBjEDlyFMV4TmzlkD7H0DrF0VuJpQ6xman7xR8NYfF IctyvIQGAm3A4GhlRNb//JFHu5PFsKC9e5lWro7OMl/UkJCMNPM6zuh1LiI1d98my/+g d1Ta2H77pEgD9z9Qotf3zkyHv6/KGZAbVswFQsI8K2Bvt3wJagos/C4/F6VM+5Z2jCKM XpOg== 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=4yNNnMvCvmrDYJiKz9Ub7lGJTKCUT9fcUBHvGYsxWNA=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Lu+UdZ624ZqT+zLlCaMDi0Qwrnv9zOOfupukddakS/UPfmWP0L6d8cbX8jJsAB//3R DGKhXSGimDvhMp3KgKA7SSz+setOCrs7mgbixhHKqEIWH/iYst53ce+YxrgtQOCSd567 CORt05L2Z0Mq0s6lCpEq/x1qe1aVHPkD/Doh5nNsVjR+2vspXVN60Uyvfq+fUpMKCnrC Z84eg+wUHhRpUT58wAAPC+XKNBDb0A9yJDRiomlGawid0wRWILaAw97h3kdJKrNDDpsd zatxrOzaXMfCO6gIyGSHqIX9NaFKRqllcjdYt0FtT54bCrYQ36yjN5DaYrNKcUXwszDA GU4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lGpLBR8F; 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 nz11-20020a0562143a8b00b0066d6afd0beesi688485qvb.45.2023.10.18.14.58.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58:36 -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=lGpLBR8F; 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 1qtEVf-0002Cs-OC; Wed, 18 Oct 2023 17:55: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 1qtEVd-00029l-IK for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:21 -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 1qtEVb-00051x-Ol for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:21 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6b201a93c9cso4938736b3a.0 for ; Wed, 18 Oct 2023 14:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666118; x=1698270918; 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=4yNNnMvCvmrDYJiKz9Ub7lGJTKCUT9fcUBHvGYsxWNA=; b=lGpLBR8Fgat67nmlpmzUHguqxuXGUWFZMRZKTTjAkRVwMz/mdOE2j8pOpZ3V8ENgS7 h9hddAN8gbzTWrTbopgdVuFA6BWggBqzc9kEN0R/3s+f6id2/9Beuqd5Y85iMOYUCN1k AjgP2HgoI8wTh8t+uiipcW2W75/s9Gkf549sNHRf81es/+o7hBdCwfgfsbugq/5rzBr8 cK/7JvTD/+Qh4scK2Y5gkm6mCH4rG7v0YapMlvEjdV3NhqCJCIUimeLo59Po+5+bXdxI tYys+w7GpcdmyZ/qAasIde/tvMnJm5GlDQW9A0Dvvay12yJ6o7tWWqqPRMtBcTjnSLKI 6fDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666118; x=1698270918; 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=4yNNnMvCvmrDYJiKz9Ub7lGJTKCUT9fcUBHvGYsxWNA=; b=l+uTQWcuYqHVjz6mJMaBg24s4KvR6cxC57vAeV1LA9P5MVY9Qbrs38NQ6l2mSnSV0B v8KtWseEIQ5Zbi4AyMPg2HVwlwddq2i4f5fLYxgLqNBHj2W5L62JHUbAJ9ji0YfwJ75Q dEzuR+52w1fBs02HxlNH/OTpWzNHRmDI4Np5oVes+OMbVRyrggSKxD9KAtMyerRLJXM3 aHuEQTH0amw+U50AJNtmscDhTQA5iItTHpoM7cObHkEy2cexZ2EEn9w5AZwfI0LzxgQK bvfZndA+/KQQ/aX/Fu60Sq/IWS8bWV5bHJmesjlKdJDDOBqUbEUIBrEp+4lpMPv18N7R LREQ== X-Gm-Message-State: AOJu0YwDlsnILR0OH2d/FWPc2HjKcSr/XcteVjJsVd1MHKHc3NTgRGLP bHFZ7vwuwwcu3TVRwwLE5t6j+Kq69oUcZAvG7yA= X-Received: by 2002:a62:f245:0:b0:6b7:e577:3f7b with SMTP id y5-20020a62f245000000b006b7e5773f7bmr274404pfl.21.1697666118465; Wed, 18 Oct 2023 14:55:18 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 48/61] target/hppa: Remove remaining TARGET_REGISTER_BITS redirections Date: Wed, 18 Oct 2023 14:51:22 -0700 Message-Id: <20231018215135.1561375-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 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 682cb518d6..c782c57149 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 Wed Oct 18 21:51: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: 735124 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227432wro; Wed, 18 Oct 2023 15:02:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGX0a6+7ScuijqNpEwmmaW6SKNz1WoLOpv0Q8iJkX5WiduKrwdzrP1QPEE9r+Ik7YQ3E7f7 X-Received: by 2002:a05:620a:6284:b0:774:7180:508e with SMTP id ov4-20020a05620a628400b007747180508emr391057qkn.49.1697666520891; Wed, 18 Oct 2023 15:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666520; cv=none; d=google.com; s=arc-20160816; b=m0fVKz9boniSNgpgWh8/gS0Rema7UXcKuiqrnD8kyBAogKvIF1VZMAW9+tVjjUrFgX UJf+Rzwh7TxKuujR4hqac71t7QW2HT7zm5MxGeAwcJtmE9e/a0/XuwZ/hlFn05kRICqg KOyOD5WogCg40IMoxIgj/fGziseu6/jPJKy6D8WqxKzlJdlru/gvPRtxdHietvj5rRAe 4u92/snvX7BOG4zgi9Li+Abd6DQG+sfVixe3NcvP+y4RHIdRl6jfKSblPCtOCC/rqQFZ cSAmQk3bG3mZjZ0y0V2lgTsiXKHsdof5mcvg7ooR4n7xzY+WF8aeHgFDm9oE3NchEM/A ZUtg== 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=zD/OD2M8jB+vs5HcR8Jr1nPSGY+rtPwbTcZp5cLt+Kg=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=JgA+5os/7QxeKEEWuRSwixUanCyApn8GU7DDJ4qm50wFEC58uNkKG1tk3z8C5+D7uP R8jKug3yKqPhr0T0Hey2SLwYEe0bp7ccdTKRJ311oyrh72g1OySplmfiTKT6zHob2FED ipCgDStsgYO8gJGjX0p3viijlWyhCT02KAunZfjvp/t9h5OsKWYrAoCsAb5955RbmQBk Tcv2N/4m8EQFOS/brotKxIkW40q9Zxd4FO27VItz52fIyk8dYWlJyFAqWdJwL4rNESE1 DIcP/s7oI+KB2QN6iRVnz9+7wzcl5Waz/69I7W7zNUkxo4BK+onPV4Z+QlsyOGRPTUSy jWfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nEWebg0V; 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 4-20020a05620a070400b007741ee6ce02si612337qkc.104.2023.10.18.15.02.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:02:00 -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=nEWebg0V; 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 1qtEVi-0002Dt-3s; Wed, 18 Oct 2023 17:55: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 1qtEVf-0002Cr-KV for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:23 -0400 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVc-00052h-Qb for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:23 -0400 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-57babef76deso4061422eaf.0 for ; Wed, 18 Oct 2023 14:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666119; x=1698270919; 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=zD/OD2M8jB+vs5HcR8Jr1nPSGY+rtPwbTcZp5cLt+Kg=; b=nEWebg0VEq5GjJgWJqCD5ez1q/xIy6Aajjmfgac2ueLPgThjfWGNInF0Lm9uczo473 zs3VlmxQFnj3/WsAtyzpR8gKE0bhuPAMs/iE8VJwSLrrZ5B/aoWDmesh/7RGakQrElOg pTihqIL8wR7nj8aOOiDD5oWtbcdNoDHCjs4HAlZdu42aPoNJVZuBiONP19JfAQHKN2QX TJuLeqGv0zKeujhgG14rE6IpZG+DDWMlOSYPyiX6hf2E0z7ecGYBqF7iWJRHUJFS4mHD eeCsOFAMBI2xOjoVeKUoSRumg+wJqYhxiXkt3lb2FBMIY6Eo0CfzY5zI9MJ8zp/NIjvT Oe5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666119; x=1698270919; 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=zD/OD2M8jB+vs5HcR8Jr1nPSGY+rtPwbTcZp5cLt+Kg=; b=hvFVw3YOZa+VPDtGeGDvLWPmHa1lbHAgc3jS6gcV0TnRyW0A0ZCY1gB4JG9fYAC9Vn rZdzvOnQs0ch/oXyqlbYb1f6luBYwPCxY/exu609DZHfKLHlecQCUpckkV7iWZPA70tK JiWLFRi+LwxnpRgT6dCIJ2A2UJMtOe8ojPRhCFhqMKiJ2FMTSaocRkOXl43XoC3xXyfJ sP8BN7vIMftIfOQfcfEjI/NJ5O24e1eIXM8PNqRNfHxjPJMk3Y/dcCoac5CX3qma1/PK BwyZqnCIRatVogp1alJCaQUZi0UDospzFRQoN3Yt3O3W9t3KdWPX77DsooY9/TZCTm7i 94hg== X-Gm-Message-State: AOJu0YzylQ0wFkSGuZYZ1qkQMNXltI8g20eR1/wyDvAwDKipxufCu6/0 qiuTbvQe10l/pBEsqC7mKhUsaiWxhggE+VjaWvc= X-Received: by 2002:a05:6358:c62a:b0:166:a6e3:cb9c with SMTP id fd42-20020a056358c62a00b00166a6e3cb9cmr301586rwb.5.1697666119546; Wed, 18 Oct 2023 14:55:19 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 49/61] target/hppa: Use tcg_temp_new_i64 not tcg_temp_new Date: Wed, 18 Oct 2023 14:51:23 -0700 Message-Id: <20231018215135.1561375-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c33; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc33.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 c782c57149..4a2bfb7757 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) { @@ -4176,7 +4178,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 Wed Oct 18 21:51: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: 735120 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227342wro; Wed, 18 Oct 2023 15:01:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOao35WrCKrsg1njO6j7oXr3LPyraa2a9ycEpEZVAMUvcl9I0wkJfyeUZf5I/JirB1+t2z X-Received: by 2002:a05:620a:2947:b0:76f:1614:577e with SMTP id n7-20020a05620a294700b0076f1614577emr565744qkp.25.1697666511161; Wed, 18 Oct 2023 15:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666511; cv=none; d=google.com; s=arc-20160816; b=bB+24w5DBwh7l2ijVGmyFttOnVEEZNDgbWeiqagyBEfaDPXqRvULqiLJyohJxzUAX0 LqLQ7ifm/ny42IXm9fh5QpENyvWLf0ZzWsY8yPRanKrgqgKgNnah2MEL+KpAVNeT6Rzs hV49ZnCeFqqbPzJ7IiDlz30WsdAUvPnuV0B8H5K22wqn6Ka/2ZuqiGPeZrUpXhOv2zNP seXWx2xHbvEEyNoK7oFgILFsEuNsfWLNmeulmcfuie0BxA6+ExSwObrlr+TLEHXY2F2C S45J2ntebf2sDnp/qj9n/xLbIBCD4rRZZ84V4G9FWy1hO8EfxWXF2gj+6mtXWbeP4K2s uqHw== 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=kK32N3vgLhgiOtEEROoXYbcFL4Ddcs6GJ1O6rcXX12s=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=JBhSOfnVvSkE+kG6QJYJH6nHHbQsAE+CYoPEJp+RRmOW34xUrPNU9uqMTa3HAdhh9q RzLgjQYX2+TH5OtDngGZJP1pQv/TmclMsPbgqzHrcN98kOPzwsg0EWlLckc+EuaYP1xH o9HcbDUic9AejKpG5sE0Mm7G16L5YvdBqDEkq+91+b/LX7MXfEH2OyilWNw9uuwB7dtv RBjQYlzerXucCbuV4hc6ugFqlcdjWvkU8u0BPHhu/Kq5yMQcWSbxaYv/jkzYQS11rlOK ++/UMTOaqmEDg6yrr7wTRijqmnfLO9LF1rILSa3saKAyatc7kFOFsYD7XxrTyM2IAOUa uKpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fQZ1dvXw; 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 y11-20020ae9f40b000000b00765a64b6c44si599843qkl.204.2023.10.18.15.01.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01: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=fQZ1dvXw; 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 1qtEVi-0002Dx-50; Wed, 18 Oct 2023 17:55: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 1qtEVf-0002CW-51 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:23 -0400 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVd-00053Q-Jc for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:22 -0400 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6cd1918afb2so460729a34.0 for ; Wed, 18 Oct 2023 14:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666120; x=1698270920; 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=kK32N3vgLhgiOtEEROoXYbcFL4Ddcs6GJ1O6rcXX12s=; b=fQZ1dvXwbMAU8bVaEqQyqB5sNx2hblDRJpoc7fUfluVqSCjyFEannUQO4quXWb9LjS pxmxC7pLW7cd7GaqJxVA/oVE7rUMmNGMIN3paXALSeULkSQ7vELdyT+aBmQDqMZHMCI8 7TtRewvzGbbRteix8DPKVAVvJD4sX1wyzI00A+AowIoJLGTc0SVo5UEc8muho3/HKXcF OR4Nw4V7dA9/gef+zfXQoBPAMMDLCzg8NsA8RJgpj6kLsim6kz3xeZ37rslHry3vCngj NGiSYst8fyzvBflMepUpgPIBMUpp3/T8PKHFIstIOTnrI67ufSxNlfgQc0N7Cf8mPvGh SSsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666120; x=1698270920; 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=kK32N3vgLhgiOtEEROoXYbcFL4Ddcs6GJ1O6rcXX12s=; b=VWAFiqe2MNl3AikMY/HaM2R3np31HakM65npVkCTAUi+rLGzVo5GA9hqJnO1T0iLzT Iehc7R4P46lcASxuhUIMKRaJngAkHsFv240gRlcbsoMw3GnJqivdXw8c+yNuZeQF+EMc U+DOnat6DWwZZAMGVTJAovqXhzLv19m49fj9eVQeFMe97AWko+MpdUqYXq8yvpIAY0T0 mKEcGBbGSy0BTw3Zd5lazmMtSEE5y1O0si+aFP809jhDo0Tur0Zn7iGQWEAD3p7zoyjP AYAk5h3TkmZmZ149TEzLIjP/tV4Q/P+NeQshmx9R+qYi4owxOvWJrzg8bCUYu/vMOuZn udpg== X-Gm-Message-State: AOJu0Yyfc8c/9D3lOn0QS8SF3AGDY9f9c1r50oYnRf8tZjFw/56JFd4N 1Bd1iD+v3AXCc1PQrnW01A9MdIodGiKlr1THo3Q= X-Received: by 2002:a9d:63c1:0:b0:6b5:f457:adaa with SMTP id e1-20020a9d63c1000000b006b5f457adaamr545139otl.29.1697666120491; Wed, 18 Oct 2023 14:55:20 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 50/61] target/hppa: Replace tcg_gen_*_tl with tcg_gen_*_i64 Date: Wed, 18 Oct 2023 14:51:24 -0700 Message-Id: <20231018215135.1561375-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::331; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x331.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 4a2bfb7757..366a8f1acc 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 Wed Oct 18 21:51: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: 735118 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227230wro; Wed, 18 Oct 2023 15:01:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMV/Y0GBcvB+YRCre424z55p2ZnjtUiefl0BEYiOAZlDoZ2UhXJsgRy8mzn2A1hBO1TDfX X-Received: by 2002:ac8:5896:0:b0:418:a14:9c30 with SMTP id t22-20020ac85896000000b004180a149c30mr610345qta.9.1697666498916; Wed, 18 Oct 2023 15:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666498; cv=none; d=google.com; s=arc-20160816; b=H+Zmq9DopHEW16ftzqa04z2NYvY8P7Vt+3GlqVtLtj6VJXe/O4U40V48LWTTqC/K9C ofaQpNiXSk2EWhso8WlfeCfIW7y12Z0SRmGo4Ug4RQhIQWKt/iJBDWDEJXM1Gywn6GZZ bbrMN8zU1iTnwDfRx4riN+4Ht+KHcp1frnlV+JCzaBKoXKsoeAf0FbWP72hUDsfMb1jG Sx1nwX5JiZn8vmdNJBd/Hs/aipHIdFj/npeORYSHF6F8Stmtsuwam2fD4jKnJjUfhaFH ZqFq6AGfrVp6MxT8Z3PHVt3JKRvwrfknsRkdk+2YEgWZ5LJDGP1wi4agJiTkO2EnVgiK rNxw== 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=DYe6qSFa58+9C+lzb+b7/7YPN7n3mkRlSU5qeFeX9fI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=xOuCURJbVR6An5FpRx3IL2lSYm6LIe/dVwo+zFmbCMnN6hg/V8Q35QFSWnz6/2eFOw 1KmV3wdCRosUkxev5b+ZXqAiHOlq+OZZHEv2u4cXhHZpmB6rCfd1mOLYGvYKvPsFelNZ NtIQCidvI3IEfpK70f4tOiZGNzY0U8ZOZ5w23SVSka9ZzGLtkUTgTF2tUFyu9ByZW7JC 7AlOeI8TyawSCY1rfYBVP1aGU4a5E91XOdvb4oQKTi22DuvzLJWp9Ww8pRt9ohS9kLMG PfBcbhCv+/byGMzIJtAyArGY8/J3tvlTfOl2dQpsmH0ZxqZGNiIlB7c0DOVyu9VV2rSO PO5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AwfLZYX5; 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 q3-20020a05622a030300b00419a4b7aa58si640780qtw.42.2023.10.18.15.01.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01:38 -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=AwfLZYX5; 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 1qtEVi-0002Dy-8C; Wed, 18 Oct 2023 17:55: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 1qtEVg-0002DI-DM for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55: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 1qtEVe-00053y-K4 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:24 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6bd0e1b1890so3704073b3a.3 for ; Wed, 18 Oct 2023 14:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666121; x=1698270921; 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=DYe6qSFa58+9C+lzb+b7/7YPN7n3mkRlSU5qeFeX9fI=; b=AwfLZYX5WEMRIFVYrAib0YRI9ZmNRVvOYHKfSoz0X0vUxeqUbrSkn7t0UYUA7xjp8k FFBTZ7FtC16dUbQN/i7UTNyZv2dssQpRb8ejy7tkA1X8m+zCbW9ggrwfnJH2PbUM3GYs 3yCOwR8L/t6qouf4p+euOdcK7cAhzHnzu+p0gMWM7i5vHu8dbUM9kQe4uPChoF6bkJnz 2o6vl77wE+ZoCVif+axQfpjT79+OsUln1cwwyYugHBNbgs3VOUdfwxNOMRKCt0Yx4Sur yC7d4IB4SIyL01Q/7o0E95Tkd4KVWa+s/TVPTqgW1Ah/1ktjQ026teLm4pxRxZ/s7GgI AJ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666121; x=1698270921; 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=DYe6qSFa58+9C+lzb+b7/7YPN7n3mkRlSU5qeFeX9fI=; b=IkliMR2+tLWokIDyvs/u1TMxbr9jYHDrC2+1gU9m9Ql+1sAVb5nqb5dxIsjqG61iHK e2oz3A3SuyCcKt74jl7UCRd2U1hvey87pVckjf05BlsdE+femWrGsLp+oxGhwuHA1hq6 JItCzTh5HldIxo9hVSAjOplnfAc0qdEB+50EFHP2A9rs6eEKeYEtERMywaL0dQDDmV3o 3mdSINgH14sDw4mDgWgQg7nJ9NAoGVFA4WJoOWpI0p5M6SlQESXUf73PMNu8I6FUcSaQ HpzAL/IUJgBJewTx74XcyepVZXdh6/izVO0u7EVCTkMZJnrIrfNtYbxe1wdRdEPXSepV Oizw== X-Gm-Message-State: AOJu0YyBq3w0sM9Wzxe+j0pEV7i/1SDShF5klIDFM1vViiCoXPJidM3t r3E8loOTgnnbiLCWsITow/ciiLOjMTCrfImgGdk= X-Received: by 2002:a05:6a00:2315:b0:68e:3eb6:d45 with SMTP id h21-20020a056a00231500b0068e3eb60d45mr317254pfh.30.1697666121265; Wed, 18 Oct 2023 14:55:21 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 51/61] target/hppa: Implement HADD Date: Wed, 18 Oct 2023 14:51:25 -0700 Message-Id: <20231018215135.1561375-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 | 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 366a8f1acc..bbf216fcde 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 Wed Oct 18 21:51:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735100 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226073wro; Wed, 18 Oct 2023 14:58:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGk6f5MBreSJ2jMhTb8DooqTqd2u7XPryKtTCpyBAmOH3MXIM7mF828QIVPy5dGyD/sp6BP X-Received: by 2002:a05:620a:469e:b0:775:937b:c594 with SMTP id bq30-20020a05620a469e00b00775937bc594mr455996qkb.58.1697666334455; Wed, 18 Oct 2023 14:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666334; cv=none; d=google.com; s=arc-20160816; b=fJNS8+xRShJjAtunoCbve3cw/hevLAB4hlA5zwRGSXaI2ijaNHUY/9NUyNdW8iKdZ5 leBzLaCz9eylsOAqtoB3e//Txb8yDxr5qpr8ess0OfnzCaeaRev/iSdFQFtUGTQIB7Tz cGwZLyGUX2dSUY6x7X1zIAfZe6+96PdfZ+GrCoThioRXgnIOKsXOcMauVNzvNTr2EaGE mz40HOre1c0bRclnOw8p4G+lPtxSdHEvFzdmybm2E7YdKuB721ZpuSw6HSOvJdGlctuD dt2pkO169LLO+H3qoX9LkrFYkgv2H3ux0j5woOCfV6LqY6bkf2yxenzpjvpG9UPOYVo3 0NhQ== 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=CAcoAZN0zZMn9SMNjn5rzCUBcFL8BPxCVl2F5+s0D30=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=vPPoT3W7Ft5Vw+18F65Wx8xaD6b4pWadc0qSTbvYixYgDiQKeCOmI2/PqT+g9tikxF ePAoWKZKuJJ7IYJSvp/oCXdmwZ/gmMZSukmfiKfg8YBefAhtWN+eWIwyEnU1AXcsbiDM ktv5bT1pt4OToI1R2wVAPCKsIjIYg7ms2SaXPctyUrscKBwkjUjVbpNppLjHTg6/uOja su7IxIy9kutOC3zv7E6AinWWaucKuS3EaPCnv51EEZurwbCfXnJJZ/OCvSpTYtovVdXy 1aSLKjtgj47gRQVyMhcEPJh7eLSXeR+GnsD6PNXLd0qxpmCnidH+cUrMuImoctkxoNyi CPIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iYL1p3Kv; 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 b17-20020a05620a089100b0076cb7c7d9d1si583630qka.637.2023.10.18.14.58.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58:54 -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=iYL1p3Kv; 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 1qtEVi-0002EN-Pn; Wed, 18 Oct 2023 17:55: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 1qtEVg-0002Da-Q3 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:24 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVf-00054H-5t for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:24 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6c4d625da40so5051105a34.1 for ; Wed, 18 Oct 2023 14:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666122; x=1698270922; 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=CAcoAZN0zZMn9SMNjn5rzCUBcFL8BPxCVl2F5+s0D30=; b=iYL1p3KvUuZ5gg45XF3bNb8T81y14Yse/85G3cvAg2q8l9IE37E3X5SfqK0tHeBQ1+ Z80BGaeNAJWmPHoRAdVsA1lEF4HrtGWXFXES3/NEazISocKtix16YtOZM7JQsxIRSmBl 58wUk3Uid21p2xxH53fdZMxNqR6q/fIRPZ50Bzcqv/PHOI3B4xO/1nkim3gZwnKFFPIW TjLFDfVubdyC7KINR+Jzh7VTanrtA7bROYSQdOGwZ+/NWE5bqMo1wnAKqLg2jX0t8LJS mfbCI+P+0eHAtEeCvwZfBEB8zJDGRkNSsCXWs+fg24AIPzI4xy4m2JPr7TK47m6/D01y wJSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666122; x=1698270922; 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=CAcoAZN0zZMn9SMNjn5rzCUBcFL8BPxCVl2F5+s0D30=; b=h92G1EBNsQoDvL48kVSZF/2AG8KFolpEA+Hfu+9VkFifBU6HojfTj0C1Rm7oOBNZ+/ 83pVjEeP1UfK5+S1f5+30Atyf1Rmi28n2h2NF6mjOWLwEJDrciQd47H3/h0fe4TZUAC6 8puRcIO65JWwFFQoBdYTE9ouplC12UMlKS/L+RzHYR/rhlu7vidQcvNrybB8QCOoL2rs nStaORjjj5GFIJ+iUqP4EYCyRcnOARmT3MNm96XQ5eUOxmQcOnNiCQq/HWlgyZnWKADk gHNGfL9f0HtP7sdqoICcmKINFST6HmgXHyNMyATf1+pVnE2Ng0/Bie/NIWFGic/anEKq YuFg== X-Gm-Message-State: AOJu0YwtGzmvoMYIk1ycyy0zKZiAxM8vhhLWoptY7AJ78qn0UO+PBs5M 9vcpMem83SkTMJesinX5aqI+oGKwvN1n5sgm8IE= X-Received: by 2002:a05:6830:13d0:b0:6c6:4843:2abc with SMTP id e16-20020a05683013d000b006c648432abcmr566384otq.18.1697666122038; Wed, 18 Oct 2023 14:55:22 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 52/61] target/hppa: Implement HSUB Date: Wed, 18 Oct 2023 14:51:26 -0700 Message-Id: <20231018215135.1561375-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32a.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 bbf216fcde..97d27cb2a9 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 Wed Oct 18 21:51: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: 735090 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1225845wro; Wed, 18 Oct 2023 14:58:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUctAtBzpyZlJxQNOeV2DxQhei2XhyjZ1zQrH1SGT0WeGrb4ApAI3ItDkPIQV62br+hXt0 X-Received: by 2002:ad4:5748:0:b0:66d:65f:2c73 with SMTP id q8-20020ad45748000000b0066d065f2c73mr700356qvx.59.1697666284322; Wed, 18 Oct 2023 14:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666284; cv=none; d=google.com; s=arc-20160816; b=PJ9DOzGY2VG7stm/oAo+CPm1jPtTA2zt8+ZKbWSI8V2zGg+IK6c99UqR9XLII48blq L6Nn6zPkQv0hixPOGVb8oPE25tvPsDeqFZ7UJl4/tPJC+ZMQRYEGSTKr8HcuXRdHwWvP yFdP2tXwLhaC09CjyjL1wnGcouLcF71ePjrgZwFPa1MxfX/6r03v2pmIS+CYMMgtTI2u fl9nb0KiP43WQ3xs1d2oodZ90A8X9/OFJc7s2LLTHYHuX44vtbvBK8H6RpdW42Ta8tbk DiteyyVQ+T7UD9ra8xrD0XSMpztq8jvqrLIvPD2FGpdbvlEmn/qXMYWnCPoiBuPWRBrg tWtw== 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=MREtjG0NHY4k+Z9J9RKPRuQgui8LzKGqqV/WUmlbHKg=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=XDuM+gFqjJ4XH1nEFsvKbTFpeGgjKbQbcTSFIF5oZJjcoKU4Rh9vMPsypXYCKpIu3i YY0hEoAfmq+WbQ20zFSPHo/FDguQPg/IMGzS1dgZkDXIG7/bZ7RQYw4o32M1MDzkLDy9 /od0QrH1cQVaDMcoWDiq66x6yINWa1HCPZj9COjkbvo73Iwm+EJX+YikvAVb5/Omve2x HBnAOE6LdGZiUYNQB4E/2OzWJRK4lge7//4TRFdiX7EchbxyWbW47k8HkzVunOxr/oX2 8O49lu/bkfA2DnRCh5s78sveOQ6AO5wX9zxM8gPi8kK7WsyI0cbISgEOXqvqOaGfbqLr 7/Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nr/qyplX"; 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 jo18-20020a056214501200b0066d15c73fc0si687886qvb.120.2023.10.18.14.58.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58: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="nr/qyplX"; 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 1qtEVk-0002Fc-Gt; Wed, 18 Oct 2023 17:55: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 1qtEVh-0002Dp-TV for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:25 -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 1qtEVg-00054Z-6P for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:25 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6b26a3163acso4843448b3a.2 for ; Wed, 18 Oct 2023 14:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666123; x=1698270923; 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=MREtjG0NHY4k+Z9J9RKPRuQgui8LzKGqqV/WUmlbHKg=; b=nr/qyplX6fZSmDV9CV1v2zf0+FbMrQoBFQ7paGFk5fOhwTnwjjhoA2mN1TYSLq7QiT 2xCySNXzeNGSRx8NDGnpOeHtat2YZYj6SdMc/512+XxfO55WXRaTcHydH1kE9NUbyJj0 PWr41auHeFXYXBjkw3rMu1i3xQsyWyTG1w6OVGjZV583OUYLQv9EXK/cBS3bOqxPlDuJ PVNrxLESJf/rybDXjaz7Y7KgN2g2mL87wzMpodvi5bsi9LSCRM/hfMuS+ZDciVamdk8L J9ZaxQp06XHQ4l/U0EsXxvU65Jg7/oqiDaGMbTpzAIdnhs9hMScz0pAvFkZ0XITogHcM vMcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666123; x=1698270923; 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=MREtjG0NHY4k+Z9J9RKPRuQgui8LzKGqqV/WUmlbHKg=; b=gLOpR5uEgBzTLp1nIuHRsRN2Osnq4Q2Xy0McCp0J6VSF65ThIZQujM4gnuriCQaftG YuKk91Tyfa1FKeueUbGiTjmKOyetUV44ib2bFlr9OlA3TUXFAWq+XVKtfOOoyS/QkRZt 8kgUwJnf0dNiZdoHLXiVr/Y8hEcQCmLV+DVLaty9iflwnkdrt1jG7UlldYbQ2NT2BL55 UC77OGIuSeyb/v5hZ2eO1gvgL+DFfAAZSa9txA4yk9SlnIX//0biwO7NVXD/YEYJbhuE 64JMaLnZXTJc6LIxA/fnfM6mVhQb+0AAzvv8TnSagU9/KCwNMfN+roUdUCgvcQZ998ka sXJQ== X-Gm-Message-State: AOJu0YwUlAVYEXlWys4SoEGa+4iCZ7vaue+GKZucECWGPMJ48FZdBrN4 GReLB3lRiKvPIBg2As/FTib4ajoTd7c3FeL8EA8= X-Received: by 2002:aa7:9852:0:b0:68a:4bef:5f9a with SMTP id n18-20020aa79852000000b0068a4bef5f9amr329534pfq.0.1697666122787; Wed, 18 Oct 2023 14:55:22 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 53/61] target/hppa: Implement HAVG Date: Wed, 18 Oct 2023 14:51:27 -0700 Message-Id: <20231018215135.1561375-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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/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 97d27cb2a9..b3335ba595 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 Wed Oct 18 21:51: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: 735123 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227386wro; Wed, 18 Oct 2023 15:01:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvR8g0x5M5Gq1p+3T+qlcsaA/0JDILP1pt+nT8JaXPIQIBcKYMm9DRi5z6N7Jfmr58kx+y X-Received: by 2002:a5b:e89:0:b0:d9a:c946:c18a with SMTP id z9-20020a5b0e89000000b00d9ac946c18amr657660ybr.28.1697666515650; Wed, 18 Oct 2023 15:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666515; cv=none; d=google.com; s=arc-20160816; b=WLTKS5Ky0W8EvDW3UPVvC5SQ30nZUaPYBGTRPPS16N3td0+FIiX741FFUyoOnfu56l sa30hxdQLAbgFKb5iweBmSbcEZQ+9suOwdQqKyICMtzdN5BIiR25ymyOyhcdcE2AUmB3 xO7iHDAAilFTnwCAG29gpfGrCMZKL+9NOF4q7iMgk9vH1WnY5qkoES9WyyFi6gSxEpC1 DAlA+qLj4nhYv4HpTgVs6tKwsvsWeaWVmxWHU4nZ9c5X2MeyzA3tjpPbDTEZAVYLOHut J5ea8Vg+Wj2b5agdznTi/J6AA+XPtXbocsS8VbLtvF8AggVc6/b9Wuet2+g7/VAa0Tor CSAg== 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=C8gelUNFkNxUiOo/PW3mwBHCQ9wwJJl5VkUEA5tOyCI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=S9tOZWAjHDfw5ji+7Ky3tPrwHAEWAXbA4m87oQF18LDhCVvYwZgGrnNG3duE4HOwka 4r/vi9xFC6kFJW2D4wK7WaE85GLlfU9Gk+mhotGeTdJ7yeB6jjmkV7CinCKz2DqqYgUJ hftq/hf9TpforI7ojZzVPkYCiJelykPNucKyvSFvYgZlpvKNU6gSDyyZGOKVXPk9iJsT pxA3RAOfLCTcnrnI5A1zDmhxSn3gHXSl8SyQc+3lGzK4wcNClYELC19F+ohFqzD+b6mZ c2gbgjVS4zVYj5WMogMjaS9B5YfCxJ06ZhQ/obbNi/Zj983Ljpv3KMwczu9lBYTxp06B Q9yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ylqou8Gk; 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 bp34-20020a05622a1ba200b004181e759a6csi575148qtb.597.2023.10.18.15.01.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01: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=Ylqou8Gk; 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 1qtEVj-0002Ef-Ci; Wed, 18 Oct 2023 17:55: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 1qtEVi-0002E5-IZ for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:26 -0400 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVh-000561-0D for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:26 -0400 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-57bce354d94so3791014eaf.2 for ; Wed, 18 Oct 2023 14:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666124; x=1698270924; 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=C8gelUNFkNxUiOo/PW3mwBHCQ9wwJJl5VkUEA5tOyCI=; b=Ylqou8GkiBxYC1OqFb5d9Of59YmiLOVt7RX/p/7BZjUs1gJViOJAlITaVk3Wafxy0F j+bPCfqcRs4qAWo3at8fEXXtcNQboYynr4Q2vJtaDBYP2zdQIAHBDcvLM9boenPYGgFk PZ/EMB5nmMBZxwmTOUI02JTygDXkaJf9j5C+2BCJdVjtCk0iqZYd6d/Q1RleWDvD78bi w4EcFAf5QS7M0kGhXeEAoqXMBi10JVvKGNjK2zMIZo5SezG2VuVW+FyAryh9GIwsC05V L+UOiLGtaRCnh+gh4bOYec8uJhlIjd1KYZOQcjajhRFUwjKWL3iopSJIAv7TtUtRacMn pEHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666124; x=1698270924; 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=C8gelUNFkNxUiOo/PW3mwBHCQ9wwJJl5VkUEA5tOyCI=; b=LktfQGh4PohYIziMerRZQnfWgTN9lf69F5cBXzydybcvhYHoe3vFD3WgFr1n1rqMKj uNIBFsmqK2q5nLQBWSwJmOt9Hny28I0rx3t3TeV2gq9s4omE73ECiiJtV41iEdfqbY7P 4n80+ZuAHPGHhyFhOImO3E7105CmGTR/YUPRtxT6xJP8A8+XTDX864nspl/hjUbjXI67 8N7k6jha33vlctvzr34KB8Ea3ZZllf7j+ys0l2yNAX1fPGFxSJcIRBpLxNNLeLmSavik TXF9R76CeZgJnmqvjzxeHfMIR35c5E31DcDrIiBUh+PxAJqngxxAFv4PM/HV0nu2b1Ba IcwQ== X-Gm-Message-State: AOJu0YyGM2BVgcuG7HcKYBEW3iUSf08Fh8Vn3QXmkWx7jmUAURGn1D9V MoVNfqQ5MOEvJP1O57hZDMTEcl/uSYEs5CbhEsA= X-Received: by 2002:a05:6359:100e:b0:12b:e47a:8191 with SMTP id ib14-20020a056359100e00b0012be47a8191mr249750rwb.16.1697666123735; Wed, 18 Oct 2023 14:55:23 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 54/61] target/hppa: Implement HSHL, HSHR Date: Wed, 18 Oct 2023 14:51:28 -0700 Message-Id: <20231018215135.1561375-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2c; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2c.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 b3335ba595..b912673531 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 Wed Oct 18 21:51: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: 735117 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227150wro; Wed, 18 Oct 2023 15:01:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgldWJBSYkKR89nAqdqGt37v6cRYfSzfqG5O8qGc2ZWwYEdzKwlK3kLSqTNvwEfhV5zCyk X-Received: by 2002:a25:8c02:0:b0:d80:1161:5ec1 with SMTP id k2-20020a258c02000000b00d8011615ec1mr632024ybl.20.1697666490456; Wed, 18 Oct 2023 15:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666490; cv=none; d=google.com; s=arc-20160816; b=BejFC+urgEo5TRFDAtAyWX6pRR3dKo4VAthf3DlHLcugc/YLzSJ4WSYpkyeMBVk5xe G4aU2cdBxt8iZe2TBWvg/loELOJ0QZ//Ip/1B1tVtVf8egIOabDD77zRwkeJzdxgtNM3 S7okh6vStgp/lplHtZHY/tcVivVRM5I3A3L3ZKNgFDtlElnFWQB6V7p43JwRM5toI5Li MJTj+3lC595mULbAqs532SXR6fhnxbZgJd5ailZZI+7vDBQ2/Td0AOj1oxwPFapa3Z/i /Nura6Stdr+BwaDvDE0mRS4qnXtjJQRa+0Iki5g89xZtzk1pAasidoIxVtNxHJjrxlg/ 7oFA== 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=of1/SQFOqlAvS9aND7Kiwy5bZQumQelFC5EO7Qp9wnk=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=ZaI7yGNx8AlK6rY96GPwBEm28HM6/wnOXgSFzo0JmAV9/XwT2qVfWWlWxb7f+WPBlu 2n396Oa9/8yoVHJsrADBDlnxjSzwOV70cnZ6xKpE2VaDw4maclAbZ2XVyhEFymZHB7SJ NuvUuEhsDc9z9CdPcXgG9V4GN6OleM/YEcaBFNHtsIPI1fFrJUlhQss0NMq/EVlbOpuq s635pWsO5urJglPES5QgO8RHxvPmvwspKTzV/Lfru8rbyT7DpRJnVOO4Sr/ZEFybaQQq bznda41fO9MwGhNzlClFT/ZXkSNlCGi8jOpZz/8KOCzWO774XL4kAMXU7GIjfDdBSd2x z2GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wL15c1ax; 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 nh6-20020a056214390600b0065864d02b70si666571qvb.1.2023.10.18.15.01.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01:30 -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=wL15c1ax; 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 1qtEVm-0002Jx-TN; Wed, 18 Oct 2023 17:55: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 1qtEVj-0002Eh-HB for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:27 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVh-00056h-O9 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:27 -0400 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6cd0a8bc6dcso483876a34.2 for ; Wed, 18 Oct 2023 14:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666124; x=1698270924; 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=of1/SQFOqlAvS9aND7Kiwy5bZQumQelFC5EO7Qp9wnk=; b=wL15c1axAgjz2FrMIUObLfnmMpNg77fHICu1l78wFmYflct0sQJEGs1IYfQl3hS5of PrZy699l6+f1K+xBWFf3H3PfimuadPvl+Rf5MVoplbYClBLmL+vFtP9I1CCpEAIqyw4R +pMX2TcFW52sFKgr9m8UVmIpdUypO/c9Qykg3KFtOHn068iVL4oZ2pzKD4o5RcFf+lWU TzQtDVBkRyjK889fW7EKFLa8OZ/MiEfaJ+Cf16/WJC2UpJMR1/lFkRj+GxQHcgZMgg9o szq8YnuAmyXbbpyAKo5ShNvpiWmtJ6gaNEQ7nl1iVifT01xI/wPHonQ5owBxm2FOUhej 3Tsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666124; x=1698270924; 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=of1/SQFOqlAvS9aND7Kiwy5bZQumQelFC5EO7Qp9wnk=; b=efh/Oon22kt5Sra6XPJlJ3j9KtFGUu0xIMstyR7e//Pw2qttzieru14ZunWkLiW8Zy LrqevEjvq3cDR8lALcQ58tQ3SRwHUu2WbMFHWOnNE7HQnhmv5aIbZZfz+tJrvHHCxl8v movhk/4OlkFl+/L7/+adkTLcB6G2onCzen0kRNZ0POOor9rstZx9oxDS2Q6urB20HbnU uUIFEb0qSECzXGqPVl5oYsSpeZAoHQW28kwRRvJ5F4aEbWyEKRRoS6Q+uNXXoGs5+zoL sgxHV0kaYtK3CIcTdQYRit2kVjZHa4mIkR4zzIuGIgOFRZ4lZRuX2ZkIGJE/tAgvgY5I hluA== X-Gm-Message-State: AOJu0YyEIfOfadm32owhjYok2CYbN2Z3huyw+Lu4TLy9MPKVGJu9o3jb Nie+pGBB53yTa/ytfNkoR5VzdntvpuYzerpP/qc= X-Received: by 2002:a9d:6203:0:b0:6cd:da93:90ce with SMTP id g3-20020a9d6203000000b006cdda9390cemr519933otj.19.1697666124507; Wed, 18 Oct 2023 14:55:24 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 55/61] target/hppa: Implement HSHLADD, HSHRADD Date: Wed, 18 Oct 2023 14:51:29 -0700 Message-Id: <20231018215135.1561375-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::333; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x333.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 b912673531..b0aefecd2e 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 Wed Oct 18 21:51: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: 735107 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226350wro; Wed, 18 Oct 2023 14:59:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHeefVU6LncvR5VPCNQuYX2rdc8dGHujKZiQ/1hjayAy/a92KNpbC/Paq4I0/Bc1148fxY X-Received: by 2002:a05:6808:1526:b0:3b2:e363:c7f0 with SMTP id u38-20020a056808152600b003b2e363c7f0mr489671oiw.37.1697666397352; Wed, 18 Oct 2023 14:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666397; cv=none; d=google.com; s=arc-20160816; b=Ww+oIPnum3RIOnDL/87UT230OW6tDhpYldMwO33rxLsmDBs2eBdYKamsGV1KNtx5qS BXhNvpkD/lkRuXlyr4FG8MH0D+mD/qZqsoB4uFXU5Nn5k4Qt57PVN2GWJXonfObUAq31 ZGCyy30WSRgKBlMUjsPIki/qGftp8lUfpCSnetTqV8w3DqV8HwJUfbRtT7WmwPRoLcP7 z8UMKZm6d3koXLThQH6pIsnu7DgqB5FY7wc23WO6riYwAZ2uuxt9LYI3+/EummkQyROw 01qo61D2DzhOOYlzj5/PV9+mFf1M2cl7snnrNpBuSqW9DS3Cv1m7bBTM58RYd3pv5isY U72Q== 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=fX4ajZFmvp6CPtzRyMzFGScgJS40L/02z7dwrdi6gaE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=C3d0FrqB1TwaqD/9zxavUHKnOIQCRKRExZd5xY5d2Q/Z7QNZft/nDss5pGGVWQ37hF iaXL8NRtMMsjd+Lfwt1QLfFqmVLGB2TsjdQVxcV5VHUiPUrxzC5UD4Wo5rD3Q+Vu0eiC MDui/jKIbgdw7XtN107PpEFmucjM/S/4Tj198syKf47AmSBdcihqt1DJqhPPVu31Lvhn WvLl9CCr+BK8UGy4qr2INBlkcxVCnpeGyO9JHhbg7MymlQj7glFtbjRJ+Drw5h6dHV9x OUrWJ8JJHFst+tUcYAnxtmosOWk0otC57WfhEyALYxAYAuPZ/4B5+3r4cMj5SkQaqaX8 1fyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LdXupNzn; 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 im11-20020a056214246b00b0066d15c73fb1si707694qvb.285.2023.10.18.14.59.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59:57 -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=LdXupNzn; 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 1qtEVl-0002GE-9Q; Wed, 18 Oct 2023 17:55:29 -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 1qtEVk-0002F0-2z for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:28 -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 1qtEVi-00056v-FL for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:27 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b7f0170d7bso4679475b3a.2 for ; Wed, 18 Oct 2023 14:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666125; x=1698270925; 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=fX4ajZFmvp6CPtzRyMzFGScgJS40L/02z7dwrdi6gaE=; b=LdXupNzn2C3Ots7zMuGR37goXOW6fZI6BPK6uClqdg0cRmXP8WncgWrcaJeMU77ASn G4XhuUJ3dQ8mpipJSGF5HY5s67N9VQYAVKyMC9szzu44tGRj0PZ8A6V/h8aLnwrWPs7t fp9n3huHy8abYjARC1Dx0BPpXy0E3y/K+qm3qS7laiDZhHYC1/Jy9xL3v1jRKnlP+/qd zP9HzK8wHengvCzzpngYjJDA982Rhy6GXFAXsvC3xdL/n2wezvC3TVyBlqbd3fGIJVYs 69FwIjow6cwtcdg5g8fD0jD0ESceY3yUplsNvcZ13xWP745t4iuMmezI2gLnXSrHA1dx zHEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666125; x=1698270925; 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=fX4ajZFmvp6CPtzRyMzFGScgJS40L/02z7dwrdi6gaE=; b=QV1USjRQy7FzxxSXQ6mraeU1+cG4UL4yDlso6ZcnDJnvhXq1geOQkJn3W+mEexx02W RDz0eEHHGD/vkJ+t+QVo0ElUyvar66wp/HeMlE1kYFMAGqc4srlL8XryzU3c59dTsIH4 U4E9nzBw8mrJQSVJfD9JZtG3dQoXF3hhA9wfuwMe2JPuJerxEvXJN+R5SYzEZbrSElIQ qx60ORg72Joox8cQfiMDc2la6iMSJZ5NzV64ksxbRrhdoJcgpKN7i5iqT/Xqh9YrvEzK rImRPWe/GhnhgohY9b7XsNwX+mLC5HCNKSqty8FnsQy1kfGYIyVtqIIcguR1WM/Pmbiv N1Yg== X-Gm-Message-State: AOJu0YwREn/zMEhwuAJltSl7Dmc/U38lxycpC/kP2PLTK76ITZWoqd++ rYArZ7gVK28TlOwcx5NQ+sO5CAEBa3ulBB5oa8I= X-Received: by 2002:a05:6a00:15d0:b0:690:28d0:b7b3 with SMTP id o16-20020a056a0015d000b0069028d0b7b3mr388786pfu.13.1697666125210; Wed, 18 Oct 2023 14:55:25 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 56/61] target/hppa: Implement MIXH, MIXW Date: Wed, 18 Oct 2023 14:51:30 -0700 Message-Id: <20231018215135.1561375-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 | 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 b0aefecd2e..bd8a858da6 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 Wed Oct 18 21:51: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: 735127 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227750wro; Wed, 18 Oct 2023 15:02:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8e60BUcGNR//N8no/dpioqfBE4f2bPCBrEtqhFFGWHMzdobdLL756ldpUZNpvJ2syu+yK X-Received: by 2002:a05:6214:230d:b0:66d:5cfe:82a6 with SMTP id gc13-20020a056214230d00b0066d5cfe82a6mr273467qvb.27.1697666557091; Wed, 18 Oct 2023 15:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666557; cv=none; d=google.com; s=arc-20160816; b=PU0D4NkQYJCe9U/MvW+rsRnF+cjAD3cf1/vV+QnopavmdIVp12A3yGMj7oK8lxMho+ 99AddlCf5iZ+PoagNdWeRt2OLZQ+IO/DM/fY9z89HMZquHDuVGXNka1XNcaUTAqgOenM IxDQZoCkcL3JXWGICUVzZstfn4FNL0DtrwKTq7k0vHzny7jCmntcRuWl0i6VCsCOKhlk QFdto3L0a0mmHiyH74u+T4ehssbS7Vb3CNFnHuczixT6K05wHnN7ihwNtD0QatmkP5Uh Am5M3Vb8ywXpjTrJQ+HO/tB9SCQ47KQzEwYdfN7hIidjw0d7dZrMqEV4iTYPYat32cTW N73A== 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=7iHWuCbXcxtsog6Wn/6KwP1Awc1ANERXzKnjfdaTViQ=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Ix34QH8A0BxmirHGJpT6bVjPvOik1kPbLNuhf4anDvVmmwo7/ro+RfLf+zU0bqTMrA cCx0ngQRiwEqRgZCEkHrWJCU952gzmU6Nh0fnZ11w0WgeJKY6l0apbvg4vz4F2PnYMA2 wu0pS0rLqX8QX2ak7f28IjF1uuhpGZ8MbrE3EIkMQzHoggy8rdxWY2g7+YgnyD5uCOKl 5RCbwAF9nKlWrKHjRRtfdsiG2z1gwtJx8c4RMn7d0kw04QT4fscn3PZW/LQDMrfHsOc9 tKcrj0WLcjj89/ghIUKs9EoGgcCLykL2HakQNmQ7mMZoy2HAYQcqs7wUzEDnHxVZ7uXA YJJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DR1k9OB+; 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 pj13-20020a0562144b0d00b0066d06190561si622776qvb.494.2023.10.18.15.02.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:02:37 -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=DR1k9OB+; 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 1qtEVm-0002Gq-5X; Wed, 18 Oct 2023 17:55: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 1qtEVk-0002G3-T4 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:28 -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 1qtEVj-00057s-BA for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:28 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b44befac59so125255b3a.0 for ; Wed, 18 Oct 2023 14:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666126; x=1698270926; 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=7iHWuCbXcxtsog6Wn/6KwP1Awc1ANERXzKnjfdaTViQ=; b=DR1k9OB+d+8E9zg50Iwdtk0DA1ENq28y5Dggn0JsULl2wrlVan86cJTxudcEBHwPvL 5e2ziTLZZ8FVzMJ6OZmd98XREArLcbKOsUufNwgPqYlWuml6JWi7wGGAzAedbgiJhESQ 7JLzsgYzeI4yqJa2uJOkDib2JLkTda+8yDnmUv/xRvb/DPCRg+w+WjMPbpRXf1EeOF/Z CxYPb+cYhna704b+87PjFihVKj+dAqXvT4NUorbW0DDdQWkATL2AyM4H6Q6bmEh3Vd6A T8EJ5oLQqcSoVsUwc0oEBdVTA9rn9UI3JSn1Tb919raHSt7vFPCGU9TkqK2BqIrYoZx0 rcDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666126; x=1698270926; 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=7iHWuCbXcxtsog6Wn/6KwP1Awc1ANERXzKnjfdaTViQ=; b=ZqH3n5XMinIEiBhpalsRlb1CdN4DiOGOiBoxSpR/JLYou5iygDjOjWWo8rdzqlKTUp agvGesWBDAYOX5SDYq2vnSlEcinLytxa8rw5RY7+pyBzQJmpjooEzoGKIt+njzsOfOZu nC9VzJcLvhQvT4jFtpwSiy103rkb9jatj94aiHi3C7mnmprkVhJe3voh8pHFdZyhtvgA ithnaJfVv68SnDzSlthsPDBhN7d2+oksJYGyrOSPG9Z50MSFsBXwcd7hphwADXT7GXYz 25LY1SZM2jMhwxsZBoTztICawrw4STuUshDTTS9Pe9AzexfwQ2ShAFIFySRZDxRZ2dV7 iYuQ== X-Gm-Message-State: AOJu0YzQnVmFVndJgY4Wh/+5WJO+3XaWPezazdNOE4UuS2cgCwnomVMu NCSh5D5sZGD43E8mu65P/r7Iz3fNOhCZfQBqJ20= X-Received: by 2002:a05:6a20:4424:b0:13a:dd47:c31a with SMTP id ce36-20020a056a20442400b0013add47c31amr132734pzb.20.1697666126014; Wed, 18 Oct 2023 14:55:26 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 57/61] target/hppa: Implement PERMH Date: Wed, 18 Oct 2023 14:51:31 -0700 Message-Id: <20231018215135.1561375-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 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 bd8a858da6..40b5a3d8c3 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 Wed Oct 18 21:51: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: 735128 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227852wro; Wed, 18 Oct 2023 15:02:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrU4QOgqlnDPgja20XgIzPTHMmEuPwAo/9cbiiCWP1impf8cV04zQ1x2VNbRfty6tq7jwS X-Received: by 2002:a05:620a:84c:b0:774:2dc0:649b with SMTP id u12-20020a05620a084c00b007742dc0649bmr139166qku.18.1697666569029; Wed, 18 Oct 2023 15:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666569; cv=none; d=google.com; s=arc-20160816; b=GeOj5+ZapI0zy17MaZsA5+LHgC4xuTMwkMMFGrxfLL0VQ8/mICzMFX+RyM8sEYFevx 4GvSEuO5gOm5fUvJ11sw6pvqS5TpmYu4JHZN3MOuBriMMFFXoHQ29rD6f87kqFk6y6ru /KMkDCL9W+phrz8mJblwOMKf7Y6WxtEtUeTD9vvIIwbfYBsIdeUWK6UVYrMihBdaK7aZ +7TMxXxHJmA+8wkkgPKWEmxTcmkIn7F/cqQP7GkywplckdqhBflwxeQNJX5jOvUgEJ71 8iK06osm3zkon6a/e8m3eMA1ef2pMqx5puQPTxdzF6MHMwvPie9PTQE+wnwYjXu4oxGZ N/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=IfXXjPSCAekTKnfIpCckOL6yHpkL7tvWXEcAjeu6hPU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=T3yCazynlbIGmtY4g3igOpizwpqy6aX9w20qv1vxe8nQOLB6fxfYeLjVhH/nMNymHh Jhmmax3ih9vdw3M0zWf6tt5Ac4K6Hwdy1GvQYmnatLdT4utUCNMXL0fp/LbEIDXiyb9n O4A3OuHAKbfHOi9w1IGYAUEH+3aifcwUlJ+BYntEnrmqq866K0+QsC1onX8h7jvr73oF ygayZbJAqLYmGcRR3AREW9AHRU0tdrfNOo24ijpepL9KiPho07oRD5CGBxkVuTIyzcdm a/jnYIee4Vh4D1mZkUVJH00nOyNcgCvwSSWJOmwCDoMF/JuF27tqG67xm+4vdzCbyfru wWxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jv1wp4dy; 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 u28-20020a05620a085c00b0077592c33673si642162qku.53.2023.10.18.15.02.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:02: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=Jv1wp4dy; 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 1qtEVn-0002Kf-8V; Wed, 18 Oct 2023 17:55:31 -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 1qtEVl-0002Gh-MN for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:29 -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 1qtEVk-00058J-3w for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:29 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6bd73395bceso124875b3a.0 for ; Wed, 18 Oct 2023 14:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666127; x=1698270927; 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=IfXXjPSCAekTKnfIpCckOL6yHpkL7tvWXEcAjeu6hPU=; b=Jv1wp4dy/uMbbKRKlcXmBIXFn8ZmG7/7xM7twHvg5FN9fQCH3D0U5SESPRUd02aBI1 z5+mymZr/YCX/E/dGiGdcX8ObZ8x7pUEqhm2i2kSz0D6KdAOrooRBPSD8zAc2LReRrb9 zGUVEFpQRDKDangngRz9tY4YruZYzsYQAfPus3NIhwSKhYGEbhOHDNZqsVwnQJovdgIw 7bZwCIbPAJXFG93SEI75lb6/NNfXGa0P5uwLEvGyLlm8BSgdwmKW9hbkJuAsN11vXGe6 UsvdeU/F/Sues5eotk+A2G9TAZEAFmIRZdYmBOze3WIWI+Uc0mThyLaYt4g0cu2q3P3D BLFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666127; x=1698270927; 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=IfXXjPSCAekTKnfIpCckOL6yHpkL7tvWXEcAjeu6hPU=; b=JH1/ZNq1vw2pYbZiM0ftEFFAffcNMwnRBwqWwc0msKKv1XmEcfGa7gy6VShks6Bclh Wmv4UE4AfH2xa2oYMZEVlQn3NJFbevs/QPpDVNtbnYU9BHYY9p35ewxL0xAqpkpeX4Y2 pk9ghIr7k7Tn3tjAUb3jUapOP8EUG63PXIq2GRMFG5RykDp+plCp9M4i8ACCvwZAZH+x vkAASC2k0p4JisrswXV7rcbj483yHoTT0l8/jiKhvSAOKLb+3mcD3ymcxr6nwEixzU0p A7eSN3JSTVIMKqzYbAB8hvodxAlBcRfJ39u/NSBlW+hpCxOUHONpTWuSFEHfuEKghwyJ e1sw== X-Gm-Message-State: AOJu0YwoHQs1E7qPQDESl+DTEkEErCoa/o2Q9G0aJgl/RsN3K1+Txgb/ LKjVAWTPukD0x7x3U4Vy2v8EJU7ujuyluFp0/2k= X-Received: by 2002:a05:6a00:2789:b0:68a:5cf8:dae4 with SMTP id bd9-20020a056a00278900b0068a5cf8dae4mr168682pfb.3.1697666126834; Wed, 18 Oct 2023 14:55:26 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 58/61] target/hppa: Fix interruption based on default PSW Date: Wed, 18 Oct 2023 14:51:32 -0700 Message-Id: <20231018215135.1561375-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 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 | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 5ce05046c0..5c7fddbc2b 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..021f410bef 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -52,9 +52,16 @@ static void io_eir_write(void *opaque, hwaddr addr, uint64_t data, unsigned size) { HPPACPU *cpu = opaque; - int le_bit = ~data & 31; + 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 (cpu->is_pa20 && cpu->env.cr[CR_PSW_DEFAULT] & PDC_PSW_WIDE_BIT) { + widthm1 = 63; + } + le_bit = ~data & widthm1; + + cpu->env.cr[CR_EIRR] |= 1ull << le_bit; eval_interrupt(cpu); } @@ -104,8 +111,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 Wed Oct 18 21:51:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735108 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226361wro; Wed, 18 Oct 2023 14:59:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFZdUWg/Y5cYUIDEM7yapaBJFfSX4a3JWswWaJHVdSXIDbwHeLNFR5Y5VUxFttZdhF2wZw X-Received: by 2002:a05:6214:f24:b0:66d:1f11:8b7c with SMTP id iw4-20020a0562140f2400b0066d1f118b7cmr605629qvb.52.1697666399598; Wed, 18 Oct 2023 14:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666399; cv=none; d=google.com; s=arc-20160816; b=UwD/WqnWCueFxpzhulgSvIDDGyQY4yxDIrTWAXJBxL5PoJUXyozq+cRQV/atfzCEoe gBg7QEHlo/omJQ5+w4e9CgZva7OICS3w2E7b5VCbk2TumHhUZ5pFtAYpq3FvYLToUJJN EBXvSE4RaRdWRbljIB5HADjV+QCv3QchEQMVZBHv0Wz1GJCCRUlD3pQK1zBE8DUDt8hS Km+jTKNaZ/cN4Lm3HIDM3PpyOxbBJwq569CPLW6dELZrT6S1j4ZB7N7vr+gxb9iWsVE2 wBWzuPfcG7jHJnh8KWW5YJ/Y6Rm9W0Z8dWvcd0S4+tXd7ccjB6KJ+Wp0zJ1C4pH0chkT 3uVA== 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=tHP2tYsmSSxOo6HHRVeOWeqkS383GwwwAeL+hfFxJSs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=0e3eTmIf5SDUVL/WAPrXWriDVAfFxQTGfgvD0i5MF+YaOZZlP0SYNMj9HV6SP9In02 rynaAJkXUfiwOrar89CFw1ek00t0ZerG5s4wyGOEBqK45l8uVUMGYYqZYTXJipIkSC2f QOuKGrSgsX3Lkl545Igh2RkwGyFYygBYMcf4HD4qR4oNBxLX+uF8yBbYcFIIC3N/hQMb GFi14BWGSvq17NSmrBVJK6ZYtPddZFf/WTN4cXqtUuC3/S/O5zcqyfvgjbBVs36BARcR iUzf6xFNNXSZ0pbgHJEgYnmY2AR35pzMKDODCoEtMrQBksu1BCPSyxr4WEGQ7YOeDXcr VAUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ImD/qiw1"; 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 h10-20020a0cf8ca000000b0065b21846028si615698qvo.531.2023.10.18.14.59.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59: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="ImD/qiw1"; 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 1qtEVn-0002MU-U1; Wed, 18 Oct 2023 17:55:31 -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 1qtEVm-0002Iu-Io for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:30 -0400 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVk-00058X-Nm for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:30 -0400 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-581d487f8dbso1242613eaf.1 for ; Wed, 18 Oct 2023 14:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666127; x=1698270927; 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=tHP2tYsmSSxOo6HHRVeOWeqkS383GwwwAeL+hfFxJSs=; b=ImD/qiw1YiELKJwJKwCrLZIkYq6QrIrPe5y0ePplAmsnAHgS5/512p59Hd+f9Y0KYI IRwUQTiQDZwpSWFL5z9H3+qqCLTd7s3WfZKbxsx3hu4dThAmxGYNXNyJHT7wVsZzBYtN 5YrsmX86t2lxLOXVzdzQ02Wt6nsICzmn3V5XsUJ7uGm8yLSd8r5wUyRSltYSh9aMkrmk 3LN0jKT5OffVj7ERbBrnmgknYLXpEYQjOFPVpiLZ8YOwNNMotN5jkRbijc+9nwtb7p2B a0s4xiCOtJyLBEiIeA0cQJb4QoEHAqGuHOHwG7gJ4g3OSYxqNqvi6Ks7z8eRQZUT+T91 eODQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666127; x=1698270927; 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=tHP2tYsmSSxOo6HHRVeOWeqkS383GwwwAeL+hfFxJSs=; b=blWhCRPx+axkYUK+7jvcv6L+959e0lPS+Z3j1DIwwXPDphkUPxsdCJ7IzEag9PDBMG mCHTTOCQv+6rQZotkAPPW8/jHSKiJxdNTEl16Nnt3DMlUEUrpYw0JKy1EsR4brvDOjjG r5125NY4SudAsV3ptIkymOMmFuhdWcxaGvdusNkJHKzFatFquPl1ra5XvC03CLeYYFOx FM0KuE1grcSlYhkrKICHHRGaGWop1tWKgWprW2SWVxtvFBSwseFre49mhJNGSZdNpVQa 5+7sb7w6p6ONdXTThVDg3H37N0nkug/+ytKR6F47JjZEthkOAuVc9lE6EHzoHyipSznF NjWw== X-Gm-Message-State: AOJu0YzpuWP+pDmszCrkAVvRgJSByIhCqF+D1TsHeGx5/LI4AssYZ/5p /gGh52B7eWlNETrYPjYwjvaT7gtFDdv8hsFRNfA= X-Received: by 2002:a05:6358:190f:b0:150:8ba9:4d with SMTP id w15-20020a056358190f00b001508ba9004dmr320605rwm.3.1697666127581; Wed, 18 Oct 2023 14:55:27 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 59/61] target/hppa: Precompute zero into DisasContext Date: Wed, 18 Oct 2023 14:51:33 -0700 Message-Id: <20231018215135.1561375-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2d; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2d.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 --- 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 40b5a3d8c3..9a9876c529 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); @@ -4337,6 +4337,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 Wed Oct 18 21:51: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: 735121 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227355wro; Wed, 18 Oct 2023 15:01:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbt2BUOpe6o4bfBe5n439IWeGAkktf/Zfh9MSJ5ODro3DvuaoJZrR7/OQq+EHHPyU4Uavz X-Received: by 2002:a05:620a:2484:b0:773:be19:dcf with SMTP id i4-20020a05620a248400b00773be190dcfmr470063qkn.49.1697666513020; Wed, 18 Oct 2023 15:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666513; cv=none; d=google.com; s=arc-20160816; b=zcfrtWZJmS7doKlEFNrxveTDnnpkOsMn7t71bY78OK4c48dFgF3/P3jFwNbfRgnbSV ESZ4R5LE2HN7fWeyIdNRBQzZbBsqMWYf4LrEBy1+ZQRxsUgUJIFitq4Z2qSDH7tw1gyk cZjDHNqjnuflAIgxfWdu+MdqKqh+JRLoZg/8uAMKWNv/eVqEmFlYjXjctQxL+/1xoT1I PMPBlFXrRLC+Ojp1vwPujFHkcKI0HDtNKF0wluZ2dqW3gdcJ9G2fXWiw7zroKExOIyUT 68CkFNRNCMxB1Tpg1CfYpSJvRYcRLTN2QQ3Wypt0Vpb+KiU/5U1FdfETLSNkFQ94xORb x0bQ== 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=fmtUHmtXH5nM9zU0wQnJIph+Od9hcdbRCgT1SyGzFJs=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=vdFIgpPpyI/Yca9eAHrP4b20+xEAQrsnOp54TxZDBqnHAPnBvdSmtM7hkQpMmkqW4e DEvjmgf3L8nZIEqXMVSfYmIK0U1tjvvmhk3QyEWt8J7RLxaTGk5mD73yuygv6bLTyRX/ Ik3vKtmNMF1eb69wx1g/+NryzyLRn7DPyq8PbRSFdmd6dKE5QynQ2HvTXlumjG+4Vntr RFI8pL+R6y8lI1cqU0eVK6VaXRF8h9aaHq8M15fZaTY5jFOFftxZZLWjgH6PuomQoRnQ ZuGFfVGMuLi6SqN5XfaFdtFidyfQcMXF6LJF2xO9hQumEIL2keHEme05Oc6ZH1lBSqdX IWOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ufqo76M3; 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 br35-20020a05620a462300b007777245ad07si637020qkb.480.2023.10.18.15.01.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01:53 -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=Ufqo76M3; 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 1qtEVr-0002Y7-SH; Wed, 18 Oct 2023 17:55: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 1qtEVn-0002Kb-4i for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:31 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVl-00059R-Ld for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:30 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-57b68556d6dso4072750eaf.1 for ; Wed, 18 Oct 2023 14:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666128; x=1698270928; 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=fmtUHmtXH5nM9zU0wQnJIph+Od9hcdbRCgT1SyGzFJs=; b=Ufqo76M35ipkczg50/t8lsFqkadgAVTnQVfWGfj7AMGPqGj66jNJLrl1eearz/UVyv IuZy9CejOQCNPUksCmxmuhf5ktljo5a0NkObIuuyqEfbHolNprpSLXqAQcBcDcw8o2dT RfUpY9nz2UM7wMvIc6Pf3wSkl7o2zKeHVSo4JoCjq0WT6THXRHowir3nUrtN+2AGUbrq mNUNlWCSp0dqqgVEWfy7rqjgvoSGaeejEIMh/9JUZUPotvSfn07wFBIg6eaYbuFMrr6P LUozrkCq8FxBz/Jhjb0QDzxwhxfp6wjOEiepPSOSFNvM2TK5ip6lSVo+bRk4KJpZgDvR Y2IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666128; x=1698270928; 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=fmtUHmtXH5nM9zU0wQnJIph+Od9hcdbRCgT1SyGzFJs=; b=erjj+Pb/2F22DXvSOSdWPjIVkuO4wd6D052h9mpOVdKHYCiYbg7fWRT+G+FMZtAWf0 cX0+jYhmxsK9baha06yvTjoFSIur5Utu+srHQhb/3htOhKbzg6L2l7IpfJt+88Zmv7Jh dg45Q0cAdqLUx4THkfehMxVSgWQ1hsSRUdUtE2H/wiaor/hZbeAu1vE1l6ZK5KRE1+FO dUsnZ7Wfp+HxYKjuA6uZr8BEtqwuFQM/e2bYy8u2AfEbCobIKJm5AoUZ8WQSM9SPrKOq JuW2zJPQAgGLd99Q2z44+vuY4S3O20bGzJlvBCLKcwl0HXWlWthaAnQbNSXM7yrNVFNF 7zyA== X-Gm-Message-State: AOJu0YzHO1HcTnMWRApKlOa2BkBAHQ2VVcUvlDYLUKWQWEkOkwJUIXvU Koyn1vet5rYgRzeqFz8p0k/X9xpTbyBtejjk4Cw= X-Received: by 2002:a05:6358:f54:b0:143:5180:1700 with SMTP id c20-20020a0563580f5400b0014351801700mr274518rwj.27.1697666128380; Wed, 18 Oct 2023 14:55:28 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 60/61] target/hppa: Return zero for r0 from load_gpr Date: Wed, 18 Oct 2023 14:51:34 -0700 Message-Id: <20231018215135.1561375-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c29; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc29.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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 9a9876c529..a9e0e1706f 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 Wed Oct 18 21:51: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: 735097 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226047wro; Wed, 18 Oct 2023 14:58:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF07YHHQcxCLQH6BYwJUfhO0Vw0ahKSXb7eu//ShUNCi10qaj7W7k/sQXsfFocpSihz3/Re X-Received: by 2002:a05:6122:a0b:b0:4a1:79e9:e6b with SMTP id 11-20020a0561220a0b00b004a179e90e6bmr405311vkn.15.1697666329505; Wed, 18 Oct 2023 14:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666329; cv=none; d=google.com; s=arc-20160816; b=e9pHk/Qw+JXZE/Ed46C9V3DfvLYwTlJJMBK26skMzTJV4GvyD1wTujjEGQAVasW6pr R1P/sbRRjFUg5NNfGxmxL68TJ4iHOLxW3uOEVuFYFAoNzyfi5/o1ZmEqn35B/kz1GP4X WOQNJViOEd+b7bhDBBqlVmM6PB9Rk1PseuD7phXwX8x6A6lTDG0gFtkOIO8qn2hs9oUN X629MlRoaSetVaaPQn/+IWhjr+CDD2Hkid2G2kEh1pNz209dqtTF80wIYYbVQxWWHd67 qu3DWbI3vZlDT/Wltm32Fy+Ux8H6Ir2w8vu9z19qPhb+6Svu4Xt18vT4Bn/2Ix69/Oui GM7w== 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=bHJACBbF9+uJIXW5w/FHxtZpUnFRR5qhz5RTWQgzwyE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=g1zmZneHYpm7lcIZtvCKxVaL14JGdh6wM9G+GjsYXa34MDNS2VfZryX5vmTkHMZpR1 d/8RqnhhoJh7Af0YULYI5NeDXSiKUtA9s2y8sUTADXDlTVE91UVyFXec8RCcrv68irgb Ibp9jOr3XNu2Q3iaqEjWoFcuWCp3y7II/Wvi7QFFV4gFMifVdFlUjciko4Ho1J/P6vfL 9yinNrN2mlV2BItJy8jx8KotyJ7J6qEsgEmwPa29GlQiZLmsUgEzpfE/rN0l10oJRl07 CkPe6yTEf0oQ3/O+IXTl1sayYGLabcR6j2TTXzOLqWIiZPpT+kTH1cdKNWJuxJ4DmYdC oKtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dSgcWlCf; 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 l13-20020a05622a050d00b0041979c13981si659604qtx.298.2023.10.18.14.58.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:58: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=dSgcWlCf; 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 1qtEVp-0002RK-Vp; Wed, 18 Oct 2023 17:55:34 -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 1qtEVo-0002NK-Mb for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:32 -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 1qtEVm-00059e-MR for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:32 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so4164064b3a.1 for ; Wed, 18 Oct 2023 14:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666129; x=1698270929; 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=bHJACBbF9+uJIXW5w/FHxtZpUnFRR5qhz5RTWQgzwyE=; b=dSgcWlCfzhAx+Tb6iYsZCaT5ZgDQBvMWum4STXVeXIhhPxhTBNg9zVkxqzbd9Fo2qu rTwRWC22w5P/HQmaMq3Ig02m9act/JNMSGXRKVz21CcMkKmGyVLLi6EaCQGF4hGhDc3U YqNI9gKB5weHPWhYOok0fKx32hba4EZ6swdq8qSOcdCY1cQfO3A9bjTczVwg7S5ahmLm mw4LL3cgfXUYym6NuMLVAR5XuFrT0vtqqlJLlkU/T/emF0BTZRZocEot+lbeDg2kVP3D peYEl21yp4WyAvS/IEidkspq5gbJAi7Qt0j3QR4FSg4ta0rGNVzsO1/pz53m6cG5s1Yi 7+vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666129; x=1698270929; 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=bHJACBbF9+uJIXW5w/FHxtZpUnFRR5qhz5RTWQgzwyE=; b=TVf69puw3wv43mA7Ks7F62KvFtcfXtn/5vIFG2v7V988rp0Wzl4Epc79OUyUkYFINo T0ioZIl+5cQiSr4JHJUvNZFf8MFAhHMlDXBEGqatDW2x2wrCiIiuKIfIBU/0PiUISi5S XCUQsQUNL03GVZUoHfMTHns1NGfzJX5pWtN4Lmd8P6PjzbXe5zQMxjW956J060ZgJHt0 YRcvPYyLMcmWrmLcdZXULQ2fRC6yfy1y5OVSXYQ+nH5x/IAihxvMcX+zxZigc7yeGF5K 4v4KlK9eQvaZrNIvLmuhCFk0p+7R9vtuP7nyOiX6unbkLsxX05KK4B5Hj2sW30HUUkoG yL4A== X-Gm-Message-State: AOJu0Yy18YcBVmuWJ5SCIPAm+eevCVX5FEKhX6DYnm1o8LcwoqCEBV+g UjxLy1zfLx8idurrA04w+M1Pz0RU6mlDK4RVGeU= X-Received: by 2002:a05:6a00:a1a:b0:6be:43d5:6505 with SMTP id p26-20020a056a000a1a00b006be43d56505mr417860pfh.6.1697666129395; Wed, 18 Oct 2023 14:55:29 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 61/61] target/hppa: Simplify trans_dep*_imm Date: Wed, 18 Oct 2023 14:51:35 -0700 Message-Id: <20231018215135.1561375-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-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 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 a9e0e1706f..e8ce41b5a7 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,