From 1400c737d3a40df600774d6fa937ee53d1383721 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 14 Mar 2022 22:19:05 -0700 Subject: [PATCH] change cldiv/clrem to use cldivrem function --- openpower/sv/bitmanip.mdwn | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 1f8a21b6c..75703e79e 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -640,10 +640,11 @@ for other instructions. cldiv RT, RA, RB ``` -TODO: decide what happens on division by zero - ``` -(RT) = cldiv((RA), (RB)) +n = (RA) +d = (RB) +q, r = cldivrem(n, d, width=XLEN) +(RT) = q ``` ## `clrem` Carry-less Remainder @@ -652,10 +653,11 @@ TODO: decide what happens on division by zero clrem RT, RA, RB ``` -TODO: decide what happens on division by zero - ``` -(RT) = clrem((RA), (RB)) +n = (RA) +d = (RB) +q, r = cldivrem(n, d, width=XLEN) +(RT) = r ``` # Instructions for Binary Galois Fields `GF(2^m)` -- 2.30.2