<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 6, 2023, 11:25 Luke Kenneth Casson Leighton <<a href="mailto:lkcl@lkcl.net">lkcl@lkcl.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
crowd-funded eco-conscious hardware: <a href="https://www.crowdsupply.com/eoma68" rel="noreferrer noreferrer" target="_blank">https://www.crowdsupply.com/eoma68</a><br>
<br>
On Mon, Mar 6, 2023 at 7:19 PM Jacob Lifshay <<a href="mailto:programmerjake@gmail.com" target="_blank" rel="noreferrer">programmerjake@gmail.com</a>> wrote:<br>
> the extra logic would go in the ternlog ALU, not the decoder.<br>
<br>
no, because illegal instruction (for "redundant" encodings)<br>
needs to be raised at the decode phase.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">no, because the idea was to use 1 less immediate bit by excluding some redundant encodings and coming up with some scheme to squish the immediate. this wouldn't introduce any illegal instructions in ternlog's encoding space but would instead make ternlog use half the encoding space:</div><div dir="auto"><br></div><div dir="auto">e.g.:</div><div dir="auto">ternlogi rt, ra, rb, rc, 8-bit-imm</div><div dir="auto">rt = ternlog(ra, rb, rc, 8-bit-imm)</div><div dir="auto">becomes:</div><div dir="auto">ternlogi rt, ra, rb, rc, 7-bit-imm</div><div dir="auto">rt = ternlog(ra, rb, rc, expand-encoded-imm(7-bit-imm))</div><div dir="auto"># decoding still easy, uses contiguous block of encodings, no holes.</div><div dir="auto"># expand-encoded-imm happens in ALU and doesn't affect insn decoding.</div><div dir="auto"># no 7-bit-imm immediates are illegal.</div><div dir="auto"># one downside is expand-encoded-imm may be complex or impossible -- tbd</div><div dir="auto"><br></div><div dir="auto">this is *not* what I'm proposing:</div><div dir="auto">ternlogi rt, ra, rb, rc, 8-bit-imm-except-not-ternlog-if-starts-with-0x7</div><div dir="auto"># leaves hole in middle that we can shove new insns into, makes decoding a pain</div><div dir="auto"><br></div><div dir="auto">Jacob</div></div>