From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D102C47254 for ; Fri, 1 May 2020 04:39:40 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF30C20731 for ; Fri, 1 May 2020 04:39:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nQcbDD1D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF30C20731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49D00937W2zDqQt for ; Fri, 1 May 2020 14:39:37 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=jniethe5@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nQcbDD1D; dkim-atps=neutral Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49Cyvx3snFzDrL4 for ; Fri, 1 May 2020 13:50:53 +1000 (AEST) Received: by mail-pf1-x441.google.com with SMTP id x15so1084298pfa.1 for ; Thu, 30 Apr 2020 20:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MeMNFXjt/FkCMg9p8GCBHhgmb2h5408dWfUGgl8wNrs=; b=nQcbDD1DN6dJmneQrUz5bHFFOnXMDTrv99xpocUhntstuyR3tD9Pmqw9vVjDEmmVp3 pAPT3LjVLCW0oKK3EP3rIJClNoBUnS6plRJ22XTKrz6FgFJW98UVkkbeLo0nfMwJavIj phLzIpGYBO83ZmstJPOK9z2nUcYiYrSMmMMdpMar6J27QZMdrfLmS9uutmufo3YzYxIt hDLaV2CIfNqwFFKWLwqX3E3QoS3ESacYw8ou3C0xa91L91G/mCQ+ESau7kOjOKdsD//S bm/GNApD79d7uU9PfjR8XK0q3oTcc4aJsNpE4MRUuDHDZIS5jtNljHOZ90eecBUUU26k EpRg== 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=MeMNFXjt/FkCMg9p8GCBHhgmb2h5408dWfUGgl8wNrs=; b=tjtn0WEsJf4lJa+pYn8ruf1+Zc9MMYoY+ue8RcO6gCdl1j2KY9LmA9XPcYin6QO+L6 OQ6qp9EyC87RKNlzk0PZrNLoG1OHgJsO5BGk7UXpI4rn48TUbxow0l/cIvWu5nsP0y9+ adXFi0JP6mppwKAYA+ylFeJlAnCQgHMJABuYUs2NdK9gG2tWuj0VZUxlaBQSvK98AJDi gk4jKgJ1s5JTb32ofH6JuUWv/VY/NsIXiDFvqw7Utg1kX0MovDW/v+IKF18CPLzyGLTD KUfUG5uzWtJbaVn3Tsrfb8FFo6IX5scE+y/3bP4ZZ+QLJhTvATo/tQZKAX+ooS5gkhvf nMZQ== X-Gm-Message-State: AGi0PuYFeEK9wfGfTpXAbVYC2vPzeNUhQblIPPgYHA0DKzoyrcEvz1kK I4zinJ8crqVEO2ln3bz9uC9Vcb/qvfivaA== X-Google-Smtp-Source: APiQypKeazE3mBN9NyuIRpCBJOyYl3COUSmU3x2L+TZ41y0jpr9Xr0JsZlXc71N8Tu8jjSnVQE9p8A== X-Received: by 2002:a62:9211:: with SMTP id o17mr2186167pfd.234.1588305050707; Thu, 30 Apr 2020 20:50:50 -0700 (PDT) Received: from localhost.localdomain (180-150-65-4.b49641.syd.nbn.aussiebb.net. [180.150.65.4]) by smtp.gmail.com with ESMTPSA id w28sm940082pgc.26.2020.04.30.20.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 20:50:49 -0700 (PDT) From: Jordan Niethe To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v7 28/28] powerpc sstep: Add support for prefixed fixed-point arithmetic Date: Fri, 1 May 2020 13:42:20 +1000 Message-Id: <20200501034220.8982-29-jniethe5@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200501034220.8982-1-jniethe5@gmail.com> References: <20200501034220.8982-1-jniethe5@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair@popple.id.au, npiggin@gmail.com, bala24@linux.ibm.com, naveen.n.rao@linux.vnet.ibm.com, Jordan Niethe , dja@axtens.net Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" This adds emulation support for the following prefixed Fixed-Point Arithmetic instructions: * Prefixed Add Immediate (paddi) Reviewed-by: Balamuruhan S Signed-off-by: Jordan Niethe --- v3: Since we moved the prefixed loads/stores into the load/store switch statement it no longer makes sense to have paddi in there, so move it out. --- arch/powerpc/lib/sstep.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index d50fa2a78866..32e3ba742e55 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1337,6 +1337,26 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, switch (opcode) { #ifdef __powerpc64__ + case 1: + prefix_r = word & (1ul << 20); + ra = (suffix >> 16) & 0x1f; + rd = (suffix >> 21) & 0x1f; + op->reg = rd; + op->val = regs->gpr[rd]; + suffixopcode = suffix >> 26; + prefixtype = (word >> 24) & 0x3; + switch (prefixtype) { + case 2: + if (prefix_r && ra) + return 0; + switch (suffixopcode) { + case 14: /* paddi */ + op->type = COMPUTE | PREFIXED; + op->val = mlsd_8lsd_ea(word, suffix, regs); + goto compute_done; + } + } + break; case 2: /* tdi */ if (rd & trap_compare(regs->gpr[ra], (short) word)) goto trap; -- 2.17.1