From patchwork Tue Apr 27 17:16:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Fernando Fujita Pires X-Patchwork-Id: 427959 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4841511jao; Tue, 27 Apr 2021 10:45:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/udL4gC9eQ3ZAOgBQRXmP4H6VUwcMlobUbSr90JK/iBw6wqz6kXbmVViCdeWZi7PmDv0c X-Received: by 2002:a02:6f5c:: with SMTP id b28mr23641102jae.108.1619545506422; Tue, 27 Apr 2021 10:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619545506; cv=none; d=google.com; s=arc-20160816; b=KsUFgcVJc4eQ5BpHWP9tLslRSgaps0xEt0jZ29AGA12DqCUTKeNIE1cCNhVZnxXL4r ut3rNIAcGkuYt+iKYz+7w4yM+eB0/ObxdyAGryBKTxlGn3HEZ/E6Uk4Is+XYj96iL5l0 WjrnOoGQhJPznEzty0ajKLbrlbym7XHN75krQQk42LgFQwMFsszpc4IPC0SBd6JKIqq9 QzJh2KgUALsKz/vHwhFCEaSpbbWXr/rjN8TB6ir8kgJH9W1UYbKGmAGe7xrCFPameqKl TFQKpG6awkqJ0Xe+72qSva9j1EpB+05l0bYqC5Uc7N3zbj63CkOtSisj99tjbRTZA+85 GCSg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=nUOqYXuj+GitJ9XAk5zjmh+X2yXyuM0KJ22Vt0CZW1k=; b=LCd0lIdTDYYlrXtsJ1ey7inPl7VrRFMWEkZfqXNA03fKwTpllyp45l5tcllmIkLJWW tKZCPMHVzvg8mDi8Lu1K180FUvicR7wtL1Y3SJTJbMDQRUHvNybJ/7MJTHFV98Px0G94 ym0XtFnBSf/6MWwFR+3033ZzrHDW1N/5iazcIImrJf/otb8j3pEpQrOO+vocSiMWDfYd ejHTsDAUaO89agB7X59H4n1PNs8GEYqnweEc9f10QrwLjLl2pB8bILvaecx85dUX5uEN ARBNe/bB8aGsIucmTdXLcyDBRXCKGjuEt1hz76TBrPvdOfGD2CYe4H9vboz6kCm9J4ab VZkg== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r5si5063038ill.85.2021.04.27.10.45.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Apr 2021 10:45: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; 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" Received: from localhost ([::1]:43132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbRlh-00088E-Dn for patch@linaro.org; Tue, 27 Apr 2021 13:45:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbRME-0001yn-TC; Tue, 27 Apr 2021 13:18:46 -0400 Received: from [201.28.113.2] (port=48284 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbRMD-00023I-96; Tue, 27 Apr 2021 13:18:46 -0400 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Tue, 27 Apr 2021 14:16:54 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id 1302780139F; Tue, 27 Apr 2021 14:16:54 -0300 (-03) From: Luis Pires To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 12/15] target/ppc: Implement prefixed integer load instructions Date: Tue, 27 Apr 2021 14:16:46 -0300 Message-Id: <20210427171649.364699-13-luis.pires@eldorado.org.br> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210427171649.364699-1-luis.pires@eldorado.org.br> References: <20210427171649.364699-1-luis.pires@eldorado.org.br> MIME-Version: 1.0 X-OriginalArrivalTime: 27 Apr 2021 17:16:54.0293 (UTC) FILETIME=[1EBC3C50:01D73B89] X-Host-Lookup-Failed: Reverse DNS lookup failed for 201.28.113.2 (failed) Received-SPF: pass client-ip=201.28.113.2; envelope-from=luis.pires@eldorado.org.br; helo=outlook.eldorado.org.br X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard.henderson@linaro.org, f4bug@amsat.org, lagarcia@br.ibm.com, bruno.larsen@eldorado.org.br, matheus.ferst@eldorado.org.br, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson --- target/ppc/insn64.decode | 15 ++++++ target/ppc/translate/fixedpoint-impl.c.inc | 60 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) -- 2.25.1 diff --git a/target/ppc/insn64.decode b/target/ppc/insn64.decode index 9bef32a845..2e08d89e62 100644 --- a/target/ppc/insn64.decode +++ b/target/ppc/insn64.decode @@ -26,6 +26,21 @@ ...... rt:5 ra:5 ................ \ &PLS_D si=%pls_si +### Fixed-Point Load Instructions + +PLBZ 000001 10 0--.-- .................. \ + 100010 ..... ..... ................ @PLS_D +PLHZ 000001 10 0--.-- .................. \ + 101000 ..... ..... ................ @PLS_D +PLHA 000001 10 0--.-- .................. \ + 101010 ..... ..... ................ @PLS_D +PLWZ 000001 10 0--.-- .................. \ + 100000 ..... ..... ................ @PLS_D +PLWA 000001 00 0--.-- .................. \ + 101001 ..... ..... ................ @PLS_D +PLD 000001 00 0--.-- .................. \ + 111001 ..... ..... ................ @PLS_D + ### Fixed-Point Arithmetic Instructions PADDI 000001 10 0--.-- .................. \ diff --git a/target/ppc/translate/fixedpoint-impl.c.inc b/target/ppc/translate/fixedpoint-impl.c.inc index e15e379931..80f849fc4a 100644 --- a/target/ppc/translate/fixedpoint-impl.c.inc +++ b/target/ppc/translate/fixedpoint-impl.c.inc @@ -218,6 +218,66 @@ static bool trans_LDUX(DisasContext *ctx, arg_X *a) return do_ldst_X(ctx, a, true, false, MO_Q); } +static bool do_ldst_PLS_D(DisasContext *ctx, arg_PLS_D *a, + bool store, MemOp mop) +{ + TCGv ea; + + if (!resolve_PLS_D(ctx, a)) { + return false; + } + gen_set_access_type(ctx, ACCESS_INT); + + ea = tcg_temp_new(); + if (a->ra) { + tcg_gen_addi_tl(ea, cpu_gpr[a->ra], a->si); + } else { + tcg_gen_movi_tl(ea, a->si); + } + if (NARROW_MODE(ctx)) { + tcg_gen_ext32u_tl(ea, ea); + } + mop ^= ctx->default_tcg_memop_mask; + if (store) { + tcg_gen_qemu_st_tl(cpu_gpr[a->rt], ea, ctx->mem_idx, mop); + } else { + tcg_gen_qemu_ld_tl(cpu_gpr[a->rt], ea, ctx->mem_idx, mop); + } + tcg_temp_free(ea); + + return true; +} + +static bool trans_PLBZ(DisasContext *ctx, arg_PLS_D *a) +{ + return do_ldst_PLS_D(ctx, a, false, MO_UB); +} + +static bool trans_PLHZ(DisasContext *ctx, arg_PLS_D *a) +{ + return do_ldst_PLS_D(ctx, a, false, MO_UW); +} + +static bool trans_PLHA(DisasContext *ctx, arg_PLS_D *a) +{ + return do_ldst_PLS_D(ctx, a, false, MO_SW); +} + +static bool trans_PLWZ(DisasContext *ctx, arg_PLS_D *a) +{ + return do_ldst_PLS_D(ctx, a, false, MO_UL); +} + +static bool trans_PLWA(DisasContext *ctx, arg_PLS_D *a) +{ + return do_ldst_PLS_D(ctx, a, false, MO_SL); +} + +static bool trans_PLD(DisasContext *ctx, arg_PLS_D *a) +{ + return do_ldst_PLS_D(ctx, a, false, MO_Q); +} + static bool trans_ADDI(DisasContext *ctx, arg_D *a) { if (a->ra) {