From: Sandipan Das Date: Thu, 7 Jun 2018 10:57:21 +0000 (+0530) Subject: arch-power: Add fixed-point logical bit permute instructions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=913a22324c3aa0c0f029e7236bdbaba1b4233ef8;p=gem5.git arch-power: Add fixed-point logical bit permute instructions This adds the following logical instructions: * Bit Permute Doubleword (bpermd[.]) Change-Id: I1af329cd28871c00ebb0574e38a53bcd6a3b794c Signed-off-by: Sandipan Das --- diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa index 116931858..928cfd856 100644 --- a/src/arch/power/isa/decoder.isa +++ b/src/arch/power/isa/decoder.isa @@ -574,6 +574,19 @@ decode PO default Unknown::unknown() { Ra = res; }}); + 252: bpermd({{ + uint64_t res = 0; + for (int i = 0; i < 8; ++i) { + int index = (Rs >> (i * 8)) & 0xff; + if (index < 64) { + if (Rb & (1ULL << (63 - index))) { + res |= 1 << i; + } + } + } + Ra = res; + }}); + 24: slw({{ if (Rb & 0x20) { Ra = 0;