From abba68c94194355769280512a6080d6c58b65b90 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 28 Mar 2020 19:41:12 +0000 Subject: [PATCH] add fixed trap --- openpower/isa/fixedtrap.mdwn | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 openpower/isa/fixedtrap.mdwn diff --git a/openpower/isa/fixedtrap.mdwn b/openpower/isa/fixedtrap.mdwn new file mode 100644 index 000000000..ea94cfaa1 --- /dev/null +++ b/openpower/isa/fixedtrap.mdwn @@ -0,0 +1,55 @@ +# Trap Word Immediate + +twi TO,RA,SI + + a <- EXTS((RA)[32:63]) + if (a < EXTS(SI)) & TO[0] then TRAP + if (a > EXTS(SI)) & TO[1] then TRAP + if (a = EXTS(SI)) & TO[2] then TRAP + if (a u EXTS(SI)) & TO 4 then TRAP + +# Trap Word + +tw TO,RA,RB + + a <- EXTS((RA)[32:63]) + b <- EXTS((RB)[32:63]) + if (a < b) & TO[0] then TRAP + if (a > b) & TO[1] then TRAP + if (a = b) & TO[2] then TRAP + if (a u b) & TO[4] then TRAP + +# Trap Doubleword Immediate + +tdi TO,RA,SI + + a <- (RA) + b <- EXTS(SI) + if (a < b) & TO[0] then TRAP + if (a > b) & TO[1] then TRAP + if (a = b) & TO[2] then TRAP + if (a u b) & TO[4] then TRAP + +# Trap Doubleword + +td TO,RA,RB + + a <- (RA) + b <- (RB) + if (a < b) & TO[0] then TRAP + if (a > b) & TO[1] then TRAP + if (a = b) & TO[2] then TRAP + if (a u b) & TO[4] then TRAP + +# Integer Select + +isel RT,RA,RB,BC + + if RA=0 then a <-0 else a <- (RA) + if CR[BC+32]=1 then RT <- a + else RT <- (RB) + -- 2.30.2