From patchwork Tue Feb 12 04:57:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158077 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3417728jaa; Mon, 11 Feb 2019 21:07:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IagEw6+PKHKcedR4D7Y1OIb228hIp5LMos3Vly9Y7yQ93INcQhPt5DJquXax/gg/I1gHiay X-Received: by 2002:a25:9301:: with SMTP id f1mr1372298ybo.402.1549948028744; Mon, 11 Feb 2019 21:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549948028; cv=none; d=google.com; s=arc-20160816; b=QINd2ZrtyW0qJOlsL09Kb+bhX/2nmGoVCdsABSAhG/Zlnd3aANPBXDHdqslHHM2dcD QRyaxfueEozIvL+hF86z00nrJYgBzmhapViR9PlmCByoD8hSEtLaagiTlnGeinpe4kW9 2/Fhlsqk6UKWVJBAfFHhMQVIL1rEtb952p6zvHgis7i8DIp276PnrVWVmFFvL54llfiO JM6WwYtitFa+lYI3G+nzVYYlrm73WqX6mrssksyw/S6ALev1pSP/FB46j9smxpbNCl/J +GpyRSBrJKxVptQbvj49Akas0NmNujwAWM4/5ckSlVx+sW/kmvE0f6JfBXtyk1Qz/is2 If+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=yZQECS/Zi6tlxr6D11LaX/aV8PKqVO0JM0ILlcNK/UA=; b=a+rAf4123bkJI7flQhQ2qPNvLKHopSLXKjrRfjckiYodUaBqWPGw9TcaguTOyfKqL/ d4YcDfrxwFKBpirPl4Z1hFefrXyhZ+Ps0R3Wf14yp7yS9AcEyz2m/lLT264MyExlMNPp V4Pgg5fdwPNlDCzMF24pbwe+vfx313b1MUxb1WUuAv2htN2oKdRuUOFv+YV8RGY6CdeM nMZghjd9QmmKkcNsFfKAfJeglc4kkSY8UEc6fFZSxc+Q72wNFVxu/yf79BnpPvK1WNyN nxb16Hp3Lgzcd1HWn3UohOP3ppmaA4ND943bmj9guF9ULxT+vzupcOfIlpjWfgUoo9Hn 5Cfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gbNAKur9; 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=fail (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 p10si7199435ywm.109.2019.02.11.21.07.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 21:07:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gbNAKur9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtQHk-0000OE-78 for patch@linaro.org; Tue, 12 Feb 2019 00:07:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtQ95-0002n0-9m for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:58:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtQ8n-0001sh-BY for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:58:01 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:46873) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtQ8l-0001h3-RT for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:57:52 -0500 Received: by mail-pf1-x443.google.com with SMTP id g6so673081pfh.13 for ; Mon, 11 Feb 2019 20:57:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yZQECS/Zi6tlxr6D11LaX/aV8PKqVO0JM0ILlcNK/UA=; b=gbNAKur9EVG9Y3cIVpc8WFM1co2jSKY0vpO/XDrk/36E2E7gQy3vR5gYpXB53HYEZ6 mjTWiwB5i/8xrv+h6gdGRN0YT/L6GTFGyCcOtLWyZftF0r3L6xIP0vZ6wK81mDLjicG8 FNancgg7NfYiH1cKcSvd9fGA40KkAtRvMl1Y0EwENkmDBkXgf+mxFTWuVY1ya5bIsbMd sVt9khDr4BAsRAzEqN05fzr3seNGRub4qa6Bc3PzjvRYhhk+yVYyOJFIxEc2Ue8GvEst jRjhihAZydBBmSXqHsYw+j2KCp5+CXfZMrw3B5RvAIpMsOr/fgr3PuxyX2xDMQmXz1qt e02Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yZQECS/Zi6tlxr6D11LaX/aV8PKqVO0JM0ILlcNK/UA=; b=J0ejOs82pnVM1m7YcsIUtF6n0uTSA+tdbSTrObBpEd553dhkPT3s56ws2yG8OlzAyZ 0m+0KG9gyx+lMJAxZEvq/MW12ax3zMH2hQ2knX/zCH07/OKeMXqFeSZN+kR9iIOwaOPS NOg3YXCw6jbh11XRemPQfpeSsO8IM6d+19azkVZ9O1vDbQCRUN/A/gjja0elz2iCMy4i wdd5GhpEkOG4AArP8tkBr6BaxIooWWt+qbvWbLtlDGeYQR48mK+Ys4QwanufJnNFY1ro cfQzhfPqpZn5S+MIBFrmx1KtGZaLNIkvgf9fPTUVUMUw8vzwZ+i6LKj7VbUbZIPEL0qS PMNA== X-Gm-Message-State: AHQUAuaezwTKBfCqcDK8kIG0eQ86ofrnlbgiBR8XBx7tnXt2WMgExMTh EJn1FvvOgDbIkoICg8u4gINZ/FQfAfU= X-Received: by 2002:a62:9917:: with SMTP id d23mr2161844pfe.88.1549947462219; Mon, 11 Feb 2019 20:57:42 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id a90sm22088923pfj.109.2019.02.11.20.57.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 20:57:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 20:57:12 -0800 Message-Id: <20190212045721.28041-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190212045721.28041-1-richard.henderson@linaro.org> References: <20190212045721.28041-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 Subject: [Qemu-devel] [PULL 15/24] target/hppa: Convert fp indexed memory insns X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Helge Deller Tested-by: Sven Schnelle Signed-off-by: Richard Henderson --- target/hppa/translate.c | 93 ---------------------------------------- target/hppa/insns.decode | 21 +++++++++ 2 files changed, 21 insertions(+), 93 deletions(-) -- 2.17.2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4ce65bcc61..4ecd522e51 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -855,15 +855,6 @@ static void gen_goto_tb(DisasContext *ctx, int which, } } -/* PA has a habit of taking the LSB of a field and using that as the sign, - with the rest of the field becoming the least significant bits. */ -static target_sreg low_sextract(uint32_t val, int pos, int len) -{ - target_ureg x = -(target_ureg)extract32(val, pos, 1); - x = (x << (len - 1)) | extract32(val, pos + 1, len - 1); - return x; -} - static unsigned assemble_rt64(uint32_t insn) { unsigned r1 = extract32(insn, 6, 1); @@ -2981,84 +2972,6 @@ static bool trans_ldo(DisasContext *ctx, arg_ldo *a) return true; } -static bool trans_copr_w(DisasContext *ctx, uint32_t insn) -{ - unsigned t0 = extract32(insn, 0, 5); - unsigned m = extract32(insn, 5, 1); - unsigned t1 = extract32(insn, 6, 1); - unsigned ext3 = extract32(insn, 7, 3); - /* unsigned cc = extract32(insn, 10, 2); */ - unsigned i = extract32(insn, 12, 1); - unsigned ua = extract32(insn, 13, 1); - unsigned sp = extract32(insn, 14, 2); - unsigned rx = extract32(insn, 16, 5); - unsigned rb = extract32(insn, 21, 5); - unsigned rt = t1 * 32 + t0; - int modify = (m ? (ua ? -1 : 1) : 0); - int disp, scale; - - if (i == 0) { - scale = (ua ? 2 : 0); - disp = 0; - modify = m; - } else { - disp = low_sextract(rx, 0, 5); - scale = 0; - rx = 0; - modify = (m ? (ua ? -1 : 1) : 0); - } - - switch (ext3) { - case 0: /* FLDW */ - do_floadw(ctx, rt, rb, rx, scale, disp, sp, modify); - break; - case 4: /* FSTW */ - do_fstorew(ctx, rt, rb, rx, scale, disp, sp, modify); - break; - default: - return gen_illegal(ctx); - } - return true; -} - -static bool trans_copr_dw(DisasContext *ctx, uint32_t insn) -{ - unsigned rt = extract32(insn, 0, 5); - unsigned m = extract32(insn, 5, 1); - unsigned ext4 = extract32(insn, 6, 4); - /* unsigned cc = extract32(insn, 10, 2); */ - unsigned i = extract32(insn, 12, 1); - unsigned ua = extract32(insn, 13, 1); - unsigned sp = extract32(insn, 14, 2); - unsigned rx = extract32(insn, 16, 5); - unsigned rb = extract32(insn, 21, 5); - int modify = (m ? (ua ? -1 : 1) : 0); - int disp, scale; - - if (i == 0) { - scale = (ua ? 3 : 0); - disp = 0; - modify = m; - } else { - disp = low_sextract(rx, 0, 5); - scale = 0; - rx = 0; - modify = (m ? (ua ? -1 : 1) : 0); - } - - switch (ext4) { - case 0: /* FLDD */ - do_floadd(ctx, rt, rb, rx, scale, disp, sp, modify); - break; - case 8: /* FSTD */ - do_fstored(ctx, rt, rb, rx, scale, disp, sp, modify); - break; - default: - return gen_illegal(ctx); - } - return true; -} - static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, unsigned c, unsigned f, unsigned n, int disp) { @@ -4211,12 +4124,6 @@ static void translate_one(DisasContext *ctx, uint32_t insn) opc = extract32(insn, 26, 6); switch (opc) { - case 0x09: - trans_copr_w(ctx, insn); - return; - case 0x0B: - trans_copr_dw(ctx, insn); - return; case 0x0C: translate_table(ctx, insn, table_float_0c); return; diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 40b23823d0..25ac09d9d6 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -38,6 +38,7 @@ %sm_imm 16:10 !function=expand_sm_imm %rm64 1:1 16:5 +%rt64 6:1 0:5 %im5_0 0:s1 1:4 %im5_16 16:s1 17:4 @@ -195,6 +196,26 @@ lda 000011 ..... ..... .. . 0 -- 0110 ...... @ldstx size=2 sta 000011 ..... ..... .. . 1 -- 1110 ...... @stim5 size=2 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 ..... \ + &ldst t=%rt64 disp=0 size=2 +@fldstwi ...... b:5 ..... sp:2 . ....... . ..... \ + &ldst t=%rt64 disp=%im5_16 m=%ma_to_m x=0 scale=0 size=2 + +fldw 001001 ..... ..... .. . 0 -- 000 . . ..... @fldstwx +fldw 001001 ..... ..... .. . 1 -- 000 . . ..... @fldstwi +fstw 001001 ..... ..... .. . 0 -- 100 . . ..... @fldstwx +fstw 001001 ..... ..... .. . 1 -- 100 . . ..... @fldstwi + +@fldstdx ...... b:5 x:5 sp:2 scale:1 ....... m:1 t:5 \ + &ldst disp=0 size=3 +@fldstdi ...... b:5 ..... sp:2 . ....... . t:5 \ + &ldst disp=%im5_16 m=%ma_to_m x=0 scale=0 size=3 + +fldd 001011 ..... ..... .. . 0 -- 000 0 . ..... @fldstdx +fldd 001011 ..... ..... .. . 1 -- 000 0 . ..... @fldstdi +fstd 001011 ..... ..... .. . 0 -- 100 0 . ..... @fldstdx +fstd 001011 ..... ..... .. . 1 -- 100 0 . ..... @fldstdi + #### # Offset Mem ####