From: Sandipan Das <sandipan@linux.ibm.com> To: sandipan@linux.ibm.com Cc: ravi.bangoria@linux.ibm.com, PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>, paulus@samba.org, naveen.n.rao@linux.ibm.com, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 5/6] powerpc sstep: Add support for modsw, moduw instructions Date: Fri, 22 Feb 2019 12:23:31 +0530 [thread overview] Message-ID: <d7eabfc771a483889cac7acf15ccec14bfa3535a.1550817743.git.sandipan@linux.ibm.com> (raw) In-Reply-To: <cover.1550817742.git.sandipan@linux.ibm.com> From: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> This adds emulation support for the following integer instructions: * Modulo Signed Word (modsw) * Modulo Unsigned Word (moduw) Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com> --- arch/powerpc/lib/sstep.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index 742298bdf30b..9c65fb1da298 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1708,6 +1708,13 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, case 266: /* add */ op->val = regs->gpr[ra] + regs->gpr[rb]; goto arith_done; + + case 267: /* moduw */ + if (!cpu_has_feature(CPU_FTR_ARCH_300)) + return -1; + op->val = (unsigned int) regs->gpr[ra] % + (unsigned int) regs->gpr[rb]; + goto compute_done; #ifdef __powerpc64__ case 457: /* divdu */ op->val = regs->gpr[ra] / regs->gpr[rb]; @@ -1750,6 +1757,13 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, return -1; + case 779: /* modsw */ + if (!cpu_has_feature(CPU_FTR_ARCH_300)) + return -1; + op->val = (int) regs->gpr[ra] % + (int) regs->gpr[rb]; + goto compute_done; + /* * Logical instructions -- 2.19.2
WARNING: multiple messages have this Message-ID (diff)
From: Sandipan Das <sandipan@linux.ibm.com> To: mpe@ellerman.id.au Cc: ravi.bangoria@linux.ibm.com, PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>, paulus@samba.org, naveen.n.rao@linux.ibm.com, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 5/6] powerpc sstep: Add support for modsw, moduw instructions Date: Fri, 22 Feb 2019 12:24:51 +0530 [thread overview] Message-ID: <d7eabfc771a483889cac7acf15ccec14bfa3535a.1550817743.git.sandipan@linux.ibm.com> (raw) Message-ID: <20190222065451.X1U-i9CYLfVFsUgX_6U7sIyhx0lgvI9bUJ1ouNOKB0Q@z> (raw) In-Reply-To: <cover.1550817742.git.sandipan@linux.ibm.com> From: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> This adds emulation support for the following integer instructions: * Modulo Signed Word (modsw) * Modulo Unsigned Word (moduw) Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com> --- arch/powerpc/lib/sstep.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index 742298bdf30b..9c65fb1da298 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1708,6 +1708,13 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, case 266: /* add */ op->val = regs->gpr[ra] + regs->gpr[rb]; goto arith_done; + + case 267: /* moduw */ + if (!cpu_has_feature(CPU_FTR_ARCH_300)) + return -1; + op->val = (unsigned int) regs->gpr[ra] % + (unsigned int) regs->gpr[rb]; + goto compute_done; #ifdef __powerpc64__ case 457: /* divdu */ op->val = regs->gpr[ra] / regs->gpr[rb]; @@ -1750,6 +1757,13 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, return -1; + case 779: /* modsw */ + if (!cpu_has_feature(CPU_FTR_ARCH_300)) + return -1; + op->val = (int) regs->gpr[ra] % + (int) regs->gpr[rb]; + goto compute_done; + /* * Logical instructions -- 2.19.2
next prev parent reply other threads:[~2019-02-22 7:03 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-02-22 6:53 [PATCH v2 0/6] powerpc: sstep: Extend instruction emulation support Sandipan Das 2019-02-22 6:53 ` [PATCH v2 1/6] powerpc: sstep: Add support for maddhd, maddhdu, maddld instructions Sandipan Das 2019-02-22 6:54 ` Sandipan Das 2019-02-28 9:21 ` [v2, " Michael Ellerman 2019-02-22 6:53 ` [PATCH v2 2/6] powerpc: sstep: Add support for darn instruction Sandipan Das 2019-02-22 6:54 ` Sandipan Das 2019-02-22 6:53 ` [PATCH v2 3/6] powerpc sstep: Add support for cnttzw, cnttzd instructions Sandipan Das 2019-02-22 6:54 ` Sandipan Das 2019-02-22 6:53 ` [PATCH v2 4/6] powerpc sstep: Add support for extswsli instruction Sandipan Das 2019-02-22 6:54 ` Sandipan Das 2019-02-22 6:53 ` Sandipan Das [this message] 2019-02-22 6:54 ` [PATCH v2 5/6] powerpc sstep: Add support for modsw, moduw instructions Sandipan Das 2019-02-22 6:53 ` [PATCH v2 6/6] powerpc sstep: Add support for modsd, modud instructions Sandipan Das 2019-02-22 6:54 ` Sandipan Das 2019-02-22 6:54 ` [PATCH v2 0/6] powerpc: sstep: Extend instruction emulation support Sandipan Das
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=d7eabfc771a483889cac7acf15ccec14bfa3535a.1550817743.git.sandipan@linux.ibm.com \ --to=sandipan@linux.ibm.com \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=naveen.n.rao@linux.ibm.com \ --cc=paulus@samba.org \ --cc=prasannatsmkumar@gmail.com \ --cc=ravi.bangoria@linux.ibm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).