From 5e48a81077e6c1b2d129fb4d8bbe50c945ef1211 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 1 Oct 2023 10:45:43 +0100 Subject: [PATCH] Revert "demo moving pseudocode to separate file" This reverts commit b5d9084971dd761683a3a164af24c673a608aa23. --- openpower/isa/av.mdwn | 31 ++++++++++++++++++++++++++++++- openpower/isa/av/minmax..mdwn | 30 ------------------------------ 2 files changed, 30 insertions(+), 31 deletions(-) delete mode 100644 openpower/isa/av/minmax..mdwn diff --git a/openpower/isa/av.mdwn b/openpower/isa/av.mdwn index 89c67c86..94c3e1c8 100644 --- a/openpower/isa/av.mdwn +++ b/openpower/isa/av.mdwn @@ -10,7 +10,36 @@ MM-Form Pseudo-code: -[[!inline pagenames="openpower/isa/av/minmax." raw="yes"]] + a <- (RA|0) + b <- (RB) + if MMM[0] then # word mode + # shift left by XLEN/2 to make the dword comparison + # do word comparison of the original inputs + a <- a[XLEN/2:XLEN-1] || [0] * XLEN/2 + b <- b[XLEN/2:XLEN-1] || [0] * XLEN/2 + if MMM[1] then # signed mode + # invert sign bits to make the unsigned comparison + # 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 + t <- a + a <- b + 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 - 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 - t <- a - a <- b - 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