From: Jacob Lifshay Date: Mon, 7 Aug 2023 23:04:00 +0000 (-0700) Subject: split out instructions from openpower/isa/fixedtrap.mdwn X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=48fe92dd0851a14e3d522966a470b3d1280df57e;p=openpower-isa.git split out instructions from openpower/isa/fixedtrap.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