From patchwork Sat Feb 17 20:31:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 128750 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1902236ljc; Sat, 17 Feb 2018 12:40:21 -0800 (PST) X-Google-Smtp-Source: AH8x224+hoJtUZyBByi1WixqBTtmpBnEbFdURtyJ0WKiUE719RkBS9Kspo//DuKWzdKIoVd+UH9p X-Received: by 10.37.73.70 with SMTP id w67mr7526078yba.178.1518900021666; Sat, 17 Feb 2018 12:40:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518900021; cv=none; d=google.com; s=arc-20160816; b=h5S+h2vOvsoOFRqCDAGoFhpgYF4KpcBn6j+syoH47L9BsgZIrgw70ZxkDLPH6/BaIF JabDRPQfEnyzpNIY3+228KAXtGGQTSmbnByAjVA1OZgqVk1Yv5A0t/Kd1NyZ/r89qOpq 3Y+xZQrShzC37T/IgCura4h/AL7zAgaXj7uRuykC1bEGXT2/fVMPJu5yivbClxRXtiTy 3jwDbO1PU9rY8ux0f/r9RGmIpXURPeB1HPlQRP67nNWtEpkHsYiHDQok5KLAU/+ltakh 2DU5IpR0FDePc0RGA5iC9AFikjz8WnO+i3ZeVEv3I5LN9/86pPV5fT5gncV0CjkXBsz0 bZ2Q== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=UGpEphbxW5ilI8VUJ4x0UbgSaTKIrSDUQFTE8izoKQI=; b=wZTfavJjQW+c8WYBlqNsHfLVQiX+PtTs3q8auLWJx5sOHPd3N50jgEHQ2oot66J/LU 0K19hDjuc0mANwB6+k7hIqB5WTc2mh73ZiwwMvJhMLEfW3+gvDm/rzpukTvhLNFzA3sh GX8tBg4Rx4NlScbEG1LfKBzxjHzd7ufsL6OvQVKvb04w1CuhE5PV8RCSWiKTavNwAV8V PqzgHdRCWZkvx/de+bA7xwsrYX4h3KAZydFl8Lmpy7vWz+n0cHOVPCFt3r758XdQlo/t KVh80kVTXpFbjD7dh9Uc3h5opqOz8X0hJV4m9eec35gjoziW4Mo0BbH8SDN6mktJC90l /VRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IBobV9CO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h2si466409ywm.148.2018.02.17.12.40.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 17 Feb 2018 12:40:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IBobV9CO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:60438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en9HQ-0007Pf-WB for patch@linaro.org; Sat, 17 Feb 2018 15:40:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en99P-0000LH-P5 for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:32:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en99O-0000qg-NU for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:32:03 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:33464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en99O-0000qN-Ei for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:32:02 -0500 Received: by mail-pg0-x242.google.com with SMTP id g12so4433344pgs.0 for ; Sat, 17 Feb 2018 12:32:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=UGpEphbxW5ilI8VUJ4x0UbgSaTKIrSDUQFTE8izoKQI=; b=IBobV9CORmfBCpEkEafwM/5biEtrEeUX/e6a9lzp9PnQv3xIIxFw8yCX/8Zq3ceJif wddiM8tKASQJKpeSDpkB1bwmwmsN1FjQIthsYFb0FhEFi6wdkr52NiUeeE7fI8S+PRis LKmFwPG0dA5OUJohIV5Ww8Smy7ax/2r5OUxcQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=UGpEphbxW5ilI8VUJ4x0UbgSaTKIrSDUQFTE8izoKQI=; b=tYL3RtZvQ6DE65x4sOYN+456iWHkY0jOIeewfIwNQcPnq/qfAmLQDJUxKH7/n/IIUt wcHfKibV6vOfHggQdogQHnifTC7eUjLvQNxncS0tluzznTtZml/IhNhl8yQb3iEOFYEs jtRJZkJHpgPCWMiKxFnWeyj8aemGwwBHiSknF34TzHib0q4tMPVGn8FaXgCuWoGURxqH 2b89hxxvZO3+4isoV13h7OIOAEHZvtt9b/G8CMROJw2+eEnyx5y800kIfvN11eWm3gIl Wx6p53UYChv4BDAhFDQBj/opqDip/YHemXCrBvl9xOZGsTm4Xq5Z8Go3ZDi4/wI7eigM tpcA== X-Gm-Message-State: APf1xPD4TqbDyiGXPT+PdS6eSUUXVITwGdbVtvIdLa2LcDZPPzSPQlHT SPIpnN7/L7RpnbgwBzAOiVGrIsXBUvY= X-Received: by 10.98.97.198 with SMTP id v189mr10097071pfb.110.1518899520366; Sat, 17 Feb 2018 12:32:00 -0800 (PST) Received: from cloudburst.twiddle.net ([50.0.192.64]) by smtp.gmail.com with ESMTPSA id y7sm48203797pfe.26.2018.02.17.12.31.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 12:31:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 17 Feb 2018 12:31:28 -0800 Message-Id: <20180217203132.31780-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180217203132.31780-1-richard.henderson@linaro.org> References: <20180217203132.31780-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/hppa/translate.c | 93 ------------------------------------------------ target/hppa/insns.decode | 21 +++++++++++ 2 files changed, 21 insertions(+), 93 deletions(-) -- 2.14.3 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6f97f7330e..1973923a18 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -861,15 +861,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); @@ -2982,84 +2973,6 @@ static void trans_ldo(DisasContext *ctx, arg_ldo *a, uint32_t insn) cond_free(&ctx->null_cond); } -static void 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: - gen_illegal(ctx); - break; - } -} - -static void 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: - gen_illegal(ctx); - break; - } -} - static void do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1, unsigned c, unsigned f, unsigned n, int disp) { @@ -4203,12 +4116,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 9a51e59de0..1e4579e080 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 @@ -193,6 +194,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 ####