From: Sandipan Das Date: Thu, 7 Jun 2018 06:37:31 +0000 (+0530) Subject: arch-power: Add fixed-point doubleword arithmetic divide instructions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=460447f99bd3d1605c3510a4d9ab48b1aca2176b;p=gem5.git arch-power: Add fixed-point doubleword arithmetic divide instructions This adds the following arithmetic instructions: * Divide Doubleword (divd[o][.]) * Divide Doubleword Unsigned (divdu[o][.]) Change-Id: Iedfa46ee482201a25dbc195ac5cb7f5f5e83c29b Signed-off-by: Sandipan Das --- diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa index 83e3efca2..3f0949cd7 100644 --- a/src/arch/power/isa/decoder.isa +++ b/src/arch/power/isa/decoder.isa @@ -719,6 +719,30 @@ decode PO default Unknown::unknown() { } }}, true); + + 489: divd({{ + int64_t src1 = Ra_sd; + int64_t src2 = Rb_sd; + if ((src1 != INT64_MIN || src2 != -1) && src2 != 0) { + Rt = src1 / src2; + } else { + Rt = 0; + setOV = true; + } + }}, + true); + + 457: divdu({{ + uint64_t src1 = Ra; + uint64_t src2 = Rb; + if (src2 != 0) { + Rt = src1 / src2; + } else { + Rt = 0; + setOV = true; + } + }}, + true); } default: decode XFX_XO {