From nobody Tue Feb 10 15:28:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549540970208330.6053668421489; Thu, 7 Feb 2019 04:02:50 -0800 (PST) Received: from localhost ([127.0.0.1]:38527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1griOE-0005uj-3h for importer@patchew.org; Thu, 07 Feb 2019 07:02:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1griGJ-0007ZT-33 for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1griGH-0001Xf-Oh for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:34 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:33596) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1griGH-0001UF-0x for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:33 -0500 Received: by mail-wr1-x441.google.com with SMTP id a16so11268576wrv.0 for ; Thu, 07 Feb 2019 03:54:22 -0800 (PST) Received: from cloudburst.twiddle.net ([37.205.61.206]) by smtp.gmail.com with ESMTPSA id w16sm34030016wrp.1.2019.02.07.03.54.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 03:54:20 -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=bN04uoHbkorUxQ31Bny3KMKKrLywrfcqKqlBpBHUxKk=; b=RxI9/C3cJpsyXv8gB4kjqdSkO14SEDPTCAqrUFjQ5iND5GyylPSPqOvTASMr+YT1yz DvnmjatRM/W2DF/Y+nAV/5ggjAb651a13OLbo/7SV+c8cAIrfZrj2X9UJCy8Zb1SsiFB PtBeLslcHtYf60Zi392/26frR2lw4dRY1zJtds/y5XccaScxZEp0zSHiUtrinmjELSyE C6yWDF+ztwu5SwvtCpKbXjs2DqwTB7frfOKLmOfOvwRNkdjhG92EFmKhII+1HaOHLHyI m54xmmBsWkdFdDW5KyVFCBVMV2yh5hQv77GXNXffFKgsKy9YQrR+rYk3rYxNZLRU5uNz IwcA== 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=bN04uoHbkorUxQ31Bny3KMKKrLywrfcqKqlBpBHUxKk=; b=FV+1d9eYhZeeXAYSRD6vW4r3j3djgw2ux2h8KzCMbBcedaRGly9lLndAK3OnZFVelf TKHz0mDJeDJh3yP+qUrVOIGTpkqewRcxNz+YkINQW+ygVo6UMAVsZ7VU9uKwg2SJ8vdY tUSuPItlSw9BCCfxh+ZVVgvzQKT4A0Xu1qS7dFdNBm1jX3K8+zartMk1aRMKDiyfxpLL IW2ZyroWRpke7WapjUdDCCdrHUNq+RTNaeA9P/xZqriC98sLGNOKzfDitgXkJ9hTcscb fS1iXivt/7F7QseI7O1aLjDuZqPCcSrL/iobAZW1UYihvn+9hgIMu5tgHQF/SO9czkaJ GBwA== X-Gm-Message-State: AHQUAuY3e3ceuMOZ3TCrAunjpvnn02NLUx9YWfZs2LwQHASJzianneJq sAVs1bmLpOT08Ddxm34NwzG9BsR955liqQ== X-Google-Smtp-Source: AHgI3IZczRlbnufwrku3sAGvH9DnENqxRngr8F/QTM7c37h0E5ezs4cESp6cvAY0Sfj9LsMkGqlbDg== X-Received: by 2002:adf:b611:: with SMTP id f17mr12912588wre.140.1549540461709; Thu, 07 Feb 2019 03:54:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Feb 2019 11:53:56 +0000 Message-Id: <20190207115400.647-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190207115400.647-1-richard.henderson@linaro.org> References: <20190207115400.647-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH 15/19] 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: deller@gmx.de, svens@stackframe.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/hppa/translate.c | 93 ---------------------------------------- target/hppa/insns.decode | 21 +++++++++ 2 files changed, 21 insertions(+), 93 deletions(-) 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, } } =20 -/* 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 =3D -(target_ureg)extract32(val, pos, 1); - x =3D (x << (len - 1)) | extract32(val, pos + 1, len - 1); - return x; -} - static unsigned assemble_rt64(uint32_t insn) { unsigned r1 =3D extract32(insn, 6, 1); @@ -2981,84 +2972,6 @@ static bool trans_ldo(DisasContext *ctx, arg_ldo *a) return true; } =20 -static bool trans_copr_w(DisasContext *ctx, uint32_t insn) -{ - unsigned t0 =3D extract32(insn, 0, 5); - unsigned m =3D extract32(insn, 5, 1); - unsigned t1 =3D extract32(insn, 6, 1); - unsigned ext3 =3D extract32(insn, 7, 3); - /* unsigned cc =3D extract32(insn, 10, 2); */ - unsigned i =3D extract32(insn, 12, 1); - unsigned ua =3D extract32(insn, 13, 1); - unsigned sp =3D extract32(insn, 14, 2); - unsigned rx =3D extract32(insn, 16, 5); - unsigned rb =3D extract32(insn, 21, 5); - unsigned rt =3D t1 * 32 + t0; - int modify =3D (m ? (ua ? -1 : 1) : 0); - int disp, scale; - - if (i =3D=3D 0) { - scale =3D (ua ? 2 : 0); - disp =3D 0; - modify =3D m; - } else { - disp =3D low_sextract(rx, 0, 5); - scale =3D 0; - rx =3D 0; - modify =3D (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 =3D extract32(insn, 0, 5); - unsigned m =3D extract32(insn, 5, 1); - unsigned ext4 =3D extract32(insn, 6, 4); - /* unsigned cc =3D extract32(insn, 10, 2); */ - unsigned i =3D extract32(insn, 12, 1); - unsigned ua =3D extract32(insn, 13, 1); - unsigned sp =3D extract32(insn, 14, 2); - unsigned rx =3D extract32(insn, 16, 5); - unsigned rb =3D extract32(insn, 21, 5); - int modify =3D (m ? (ua ? -1 : 1) : 0); - int disp, scale; - - if (i =3D=3D 0) { - scale =3D (ua ? 3 : 0); - disp =3D 0; - modify =3D m; - } else { - disp =3D low_sextract(rx, 0, 5); - scale =3D 0; - rx =3D 0; - modify =3D (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) =20 opc =3D 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=3Dexpand_sm_imm =20 %rm64 1:1 16:5 +%rt64 6:1 0:5 =20 %im5_0 0:s1 1:4 %im5_16 16:s1 17:4 @@ -195,6 +196,26 @@ lda 000011 ..... ..... .. . 0 -- 0110 = ...... @ldstx size=3D2 sta 000011 ..... ..... .. . 1 -- 1110 ...... @stim5 siz= e=3D2 stby 000011 b:5 r:5 sp:2 a:1 1 -- 1100 m:1 ..... disp=3D%im= 5_0 =20 +@fldstwx ...... b:5 x:5 sp:2 scale:1 ....... m:1 ..... \ + &ldst t=3D%rt64 disp=3D0 size=3D2 +@fldstwi ...... b:5 ..... sp:2 . ....... . ..... \ + &ldst t=3D%rt64 disp=3D%im5_16 m=3D%ma_to_m x=3D0 scale=3D= 0 size=3D2 + +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=3D0 size=3D3 +@fldstdi ...... b:5 ..... sp:2 . ....... . t:5 \ + &ldst disp=3D%im5_16 m=3D%ma_to_m x=3D0 scale=3D0 size=3D3 + +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 #### --=20 2.17.2