From: Luke Kenneth Casson Leighton Date: Sat, 28 Mar 2020 19:41:12 +0000 (+0000) Subject: add fixed trap X-Git-Tag: convert-csv-opcode-to-binary~3034 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=abba68c94194355769280512a6080d6c58b65b90;p=libreriscv.git add fixed trap --- 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) +