From 6181165186cd6653d643a324c4b5288cdeb5e766 Mon Sep 17 00:00:00 2001 From: Sandipan Das Date: Thu, 7 Jun 2018 16:16:01 +0530 Subject: [PATCH] arch-power: Add fixed-point logical parity instructions This adds the following logical instructions: * Parity Word (prtyw) * Parity Doubleword (prtyd) Change-Id: Icb1737435dfabf9ac7b14ce1fcdf1c232289bf24 Signed-off-by: Sandipan Das --- src/arch/power/isa/decoder.isa | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa index deaea7041..116931858 100644 --- a/src/arch/power/isa/decoder.isa +++ b/src/arch/power/isa/decoder.isa @@ -557,6 +557,23 @@ decode PO default Unknown::unknown() { 506: popcntd({{ Ra = popCount(Rs); }}); + 154: prtyw({{ + uint64_t res = Rs; + res = res ^ (res >> 16); + res = res ^ (res >> 8); + res = res & 0x100000001; + Ra = res; + }}); + + 186: prtyd({{ + uint64_t res = Rs; + res = res ^ (res >> 32); + res = res ^ (res >> 16); + res = res ^ (res >> 8); + res = res & 0x1; + Ra = res; + }}); + 24: slw({{ if (Rb & 0x20) { Ra = 0; -- 2.30.2