From f360b3c9044b7fb3a3c2b5c80f147e3ae9ffcb1f Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 24 Apr 2023 23:43:02 -0700 Subject: [PATCH] allocate draft opcode for minmax --- openpower/sv/bitmanip.mdwn | 8 ++++---- openpower/sv/draft_opcode_tables.mdwn | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 1245287e6..555748209 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -186,12 +186,12 @@ signed/unsigned min/max gives more flexibility. X-Form -* XO=0001001110, itype=0b00 min, unsigned -* XO=0101001110, itype=0b01 min, signed -* XO=0011001110, itype=0b10 max, unsigned -* XO=0111001110, itype=0b11 max, signed +* PO=19, XO=----000011 `minmax RT, RA, RB, MMM` +* PO=19, XO=----000011 `minmax. RT, RA, RB, MMM` +see [[openpower/sv/rfc/ls013]] for `MMM` definition and pseudo-code. +implements all of (and more): ``` uint_xlen_t mins(uint_xlen_t rs1, uint_xlen_t rs2) { return (int_xlen_t)rs1 < (int_xlen_t)rs2 ? rs1 : rs2; diff --git a/openpower/sv/draft_opcode_tables.mdwn b/openpower/sv/draft_opcode_tables.mdwn index 527962620..d9ff186cc 100644 --- a/openpower/sv/draft_opcode_tables.mdwn +++ b/openpower/sv/draft_opcode_tables.mdwn @@ -25,6 +25,7 @@ ternlog has its own major opcode | 110 |Rc| 1/2-op | | 111 | | bmrevi | +`minmax` is allocated to PO 19 XO `000011` 1-op and variants @@ -44,7 +45,7 @@ ternlog has its own major opcode | RT | RA | RB | shuf | shuffle | | RT | RA | RB | unshuf| shuffle | | RT | RA | RB | width | xperm | -| RT | RA | RB | type | av minmax | +| RT | RA | RB | MMM | `minmax` | | RT | RA | RB | | av abs avgadd | | RT | RA | RB | type | vmask ops | | RT | RA | RB | type | abs accumulate (overwrite) | @@ -101,7 +102,7 @@ the [[sv/av_opcodes]]) | NN | | | | | 00 | 0101 110 |1 | rsvd | | | NN | | | | | 10 | 0101 110 |Rc| rsvd | | | NN | RT | RA | RB | sm0| sm1 1 | 0101 110 |Rc| shaddw | X-Form | -| NN | RT | RA | RB | 0 | itype | 1001 110 |Rc| av minmax | X-Form | +| NN | | | | 0 | | 1001 110 |Rc| rsvd | | | NN | RT | RA | RB | 1 | 00 | 1001 110 |Rc| av abss | X-Form | | NN | RT | RA | RB | 1 | 01 | 1001 110 |Rc| av absu | X-Form | | NN | RT | RA | RB | 1 | 10 | 1001 110 |Rc| av avgadd | X-Form | -- 2.30.2