From: Sandipan Das Date: Sat, 6 Feb 2021 11:51:34 +0000 (+0530) Subject: arch-power: Add bit permute instructions X-Git-Tag: develop-gem5-snapshot~28 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e931edf7480effe91be820bab14eda970a82c78;p=gem5.git arch-power: Add bit permute instructions This adds the following instructions. * Bit Permute Doubleword (bpermd) Change-Id: Iab3cc6729b9d59c95e29b4f1d3e2c0eb48fde917 Signed-off-by: Sandipan Das --- diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa index 4482f2a1f..908ba3c26 100644 --- a/src/arch/power/isa/decoder.isa +++ b/src/arch/power/isa/decoder.isa @@ -571,6 +571,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;