From 460447f99bd3d1605c3510a4d9ab48b1aca2176b Mon Sep 17 00:00:00 2001 From: Sandipan Das Date: Thu, 7 Jun 2018 12:07:31 +0530 Subject: [PATCH] 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 --- src/arch/power/isa/decoder.isa | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 { -- 2.30.2