From 48fe92dd0851a14e3d522966a470b3d1280df57e Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 7 Aug 2023 16:04:00 -0700 Subject: [PATCH] split out instructions from openpower/isa/fixedtrap.mdwn --- openpower/isa/fixedtrap.mdwn | 96 ++------------------------ openpower/isa/fixedtrap/isel.mdwn | 15 ++++ openpower/isa/fixedtrap/isel_code.mdwn | 2 + openpower/isa/fixedtrap/td.mdwn | 13 ++++ openpower/isa/fixedtrap/td_code.mdwn | 7 ++ openpower/isa/fixedtrap/tdi.mdwn | 13 ++++ openpower/isa/fixedtrap/tdi_code.mdwn | 7 ++ openpower/isa/fixedtrap/tw.mdwn | 13 ++++ openpower/isa/fixedtrap/tw_code.mdwn | 7 ++ openpower/isa/fixedtrap/twi.mdwn | 13 ++++ openpower/isa/fixedtrap/twi_code.mdwn | 6 ++ 11 files changed, 101 insertions(+), 91 deletions(-) create mode 100644 openpower/isa/fixedtrap/isel.mdwn create mode 100644 openpower/isa/fixedtrap/isel_code.mdwn create mode 100644 openpower/isa/fixedtrap/td.mdwn create mode 100644 openpower/isa/fixedtrap/td_code.mdwn create mode 100644 openpower/isa/fixedtrap/tdi.mdwn create mode 100644 openpower/isa/fixedtrap/tdi_code.mdwn create mode 100644 openpower/isa/fixedtrap/tw.mdwn create mode 100644 openpower/isa/fixedtrap/tw_code.mdwn create mode 100644 openpower/isa/fixedtrap/twi.mdwn create mode 100644 openpower/isa/fixedtrap/twi_code.mdwn diff --git a/openpower/isa/fixedtrap.mdwn b/openpower/isa/fixedtrap.mdwn index 9e9df579..11d80ef5 100644 --- a/openpower/isa/fixedtrap.mdwn +++ b/openpower/isa/fixedtrap.mdwn @@ -7,98 +7,12 @@ -# Trap Word Immediate +[[!inline pagenames="openpower/isa/fixedtrap/twi" raw="yes"]] -D-Form +[[!inline pagenames="openpower/isa/fixedtrap/tw" raw="yes"]] -* twi TO,RA,SI +[[!inline pagenames="openpower/isa/fixedtrap/tdi" raw="yes"]] -Pseudo-code: +[[!inline pagenames="openpower/isa/fixedtrap/td" raw="yes"]] - a <- EXTS((RA)[XLEN/2:XLEN-1]) - 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 - -Special Registers Altered: - - None - -# Trap Word - -X-Form - -* tw TO,RA,RB - -Pseudo-code: - - a <- EXTS((RA)[XLEN/2:XLEN-1]) - b <- EXTS((RB)[XLEN/2:XLEN-1]) - 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 - -Special Registers Altered: - - None - -# Trap Doubleword Immediate - -D-Form - -* tdi TO,RA,SI - -Pseudo-code: - - 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 - -Special Registers Altered: - - None - -# Trap Doubleword - -X-Form - -* td TO,RA,RB - -Pseudo-code: - - 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 - -Special Registers Altered: - - None - -# Integer Select - -A-Form - -* isel RT,RA,RB,BC - -Pseudo-code: - - if CR[BC+32]=1 then RT <- (RA|0) - else RT <- (RB) - -Special Registers Altered: - - None - - +[[!inline pagenames="openpower/isa/fixedtrap/isel" raw="yes"]] diff --git a/openpower/isa/fixedtrap/isel.mdwn b/openpower/isa/fixedtrap/isel.mdwn new file mode 100644 index 00000000..6eeae64a --- /dev/null +++ b/openpower/isa/fixedtrap/isel.mdwn @@ -0,0 +1,15 @@ +# Integer Select + +A-Form + +* isel RT,RA,RB,BC + +Pseudo-code: + +[[!inline pagenames="openpower/isa/fixedtrap/isel_code" raw="yes"]] + +Special Registers Altered: + + None + + diff --git a/openpower/isa/fixedtrap/isel_code.mdwn b/openpower/isa/fixedtrap/isel_code.mdwn new file mode 100644 index 00000000..43b1d115 --- /dev/null +++ b/openpower/isa/fixedtrap/isel_code.mdwn @@ -0,0 +1,2 @@ + if CR[BC+32]=1 then RT <- (RA|0) + else RT <- (RB) diff --git a/openpower/isa/fixedtrap/td.mdwn b/openpower/isa/fixedtrap/td.mdwn new file mode 100644 index 00000000..61a2c872 --- /dev/null +++ b/openpower/isa/fixedtrap/td.mdwn @@ -0,0 +1,13 @@ +# Trap Doubleword + +X-Form + +* td TO,RA,RB + +Pseudo-code: + +[[!inline pagenames="openpower/isa/fixedtrap/td_code" raw="yes"]] + +Special Registers Altered: + + None diff --git a/openpower/isa/fixedtrap/td_code.mdwn b/openpower/isa/fixedtrap/td_code.mdwn new file mode 100644 index 00000000..a5fde46b --- /dev/null +++ b/openpower/isa/fixedtrap/td_code.mdwn @@ -0,0 +1,7 @@ + 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 diff --git a/openpower/isa/fixedtrap/tdi.mdwn b/openpower/isa/fixedtrap/tdi.mdwn new file mode 100644 index 00000000..9642559f --- /dev/null +++ b/openpower/isa/fixedtrap/tdi.mdwn @@ -0,0 +1,13 @@ +# Trap Doubleword Immediate + +D-Form + +* tdi TO,RA,SI + +Pseudo-code: + +[[!inline pagenames="openpower/isa/fixedtrap/tdi_code" raw="yes"]] + +Special Registers Altered: + + None diff --git a/openpower/isa/fixedtrap/tdi_code.mdwn b/openpower/isa/fixedtrap/tdi_code.mdwn new file mode 100644 index 00000000..5de8553f --- /dev/null +++ b/openpower/isa/fixedtrap/tdi_code.mdwn @@ -0,0 +1,7 @@ + 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 diff --git a/openpower/isa/fixedtrap/tw.mdwn b/openpower/isa/fixedtrap/tw.mdwn new file mode 100644 index 00000000..2dbb1895 --- /dev/null +++ b/openpower/isa/fixedtrap/tw.mdwn @@ -0,0 +1,13 @@ +# Trap Word + +X-Form + +* tw TO,RA,RB + +Pseudo-code: + +[[!inline pagenames="openpower/isa/fixedtrap/tw_code" raw="yes"]] + +Special Registers Altered: + + None diff --git a/openpower/isa/fixedtrap/tw_code.mdwn b/openpower/isa/fixedtrap/tw_code.mdwn new file mode 100644 index 00000000..b7309e5b --- /dev/null +++ b/openpower/isa/fixedtrap/tw_code.mdwn @@ -0,0 +1,7 @@ + a <- EXTS((RA)[XLEN/2:XLEN-1]) + b <- EXTS((RB)[XLEN/2:XLEN-1]) + 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 diff --git a/openpower/isa/fixedtrap/twi.mdwn b/openpower/isa/fixedtrap/twi.mdwn new file mode 100644 index 00000000..d5571a4b --- /dev/null +++ b/openpower/isa/fixedtrap/twi.mdwn @@ -0,0 +1,13 @@ +# Trap Word Immediate + +D-Form + +* twi TO,RA,SI + +Pseudo-code: + +[[!inline pagenames="openpower/isa/fixedtrap/twi_code" raw="yes"]] + +Special Registers Altered: + + None diff --git a/openpower/isa/fixedtrap/twi_code.mdwn b/openpower/isa/fixedtrap/twi_code.mdwn new file mode 100644 index 00000000..abd10564 --- /dev/null +++ b/openpower/isa/fixedtrap/twi_code.mdwn @@ -0,0 +1,6 @@ + a <- EXTS((RA)[XLEN/2:XLEN-1]) + 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 -- 2.30.2