From 52434df9a3b7125137fe786821a598575c9f5edc Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 24 Apr 2023 23:40:35 -0700 Subject: [PATCH] fix minmax pseudo-code -- CR0 must not have lt/gt swapped --- openpower/sv/rfc/ls013.mdwn | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/openpower/sv/rfc/ls013.mdwn b/openpower/sv/rfc/ls013.mdwn index 218bb78b3..38d4b4168 100644 --- a/openpower/sv/rfc/ls013.mdwn +++ b/openpower/sv/rfc/ls013.mdwn @@ -245,6 +245,14 @@ semantics therefore Saturated variants of these instructions need not be propose # do signed comparison of the original inputs a[0] <- ¬a[0] b[0] <- ¬b[0] + # if Rc = 1 then store the result of comparing a and b to CR0 + if Rc = 1 then + if a u b then + CR0 <- 0b010 || XER.SO if MMM[2] then # max mode # swap a and b to make the less than comparison do # greater than comparison of the original inputs @@ -253,15 +261,8 @@ semantics therefore Saturated variants of these instructions need not be propose b <- t # store the entire selected source (even in word mode) # if Rc = 1 then store the result of comparing a and b to CR0 - if a u b then - RT <- (RB) - if Rc = 1 then CR0 <- 0b010 || XER.SO + if a