News for hackers. Stuff that matters.
Re:Ratification of the RISC-V Base ISA and Privileged Archit... by nsajko on Wednesday July 10, 2019 @04:45PM (#20406346)
Presumably you mean that false should be represented with 0 and true with ~0? And the motivation is maybe to be able to toggle boolean values with one instruction?

Has there been any discussion on this matter on risc-v mailing lists or somewhere? If the RISC-V Base ISA is now ratified, I think it is too late to change such things.

Edit: seems to be too late. According to [0], SLTx instructions "set the destination register to one or zero depending on whether the relation is true or not."

[0] https://www.imperialviolet.org/2016/12/31/riscv.html

Re:Ratification of the RISC-V Base ISA and Privileged Archit... by cesarb on Wednesday July 10, 2019 @04:57PM (#20406472)
> And the motivation is maybe to be able to toggle boolean values with one instruction?

You can already do that: use XORI with immediate 1 to toggle.

Re:Ratification of the RISC-V Base ISA and Privileged Archit... by nsajko on Wednesday July 10, 2019 @05:07PM (#20406559)
Fun fact: riscv does not even have a machine not instruction. In assembly it is just an alias for xori.
Re:Ratification of the RISC-V Base ISA and Privileged Archit... by Vogtinator on Thursday July 11, 2019 @02:57AM (#20409628)
Fun fact, neither does AArch64, it uses ORRN with xzr instead.
Re:Ratification of the RISC-V Base ISA and Privileged Archit... by ncmncm on Wednesday July 10, 2019 @06:23PM (#20407222)
Yes, I was hasty. Boolean true should be ~0.
Re:Ratification of the RISC-V Base ISA and Privileged Archit... by brianpaul on Wednesday July 10, 2019 @11:33PM (#20408910)
Converting true=1 to true=~0 is trivial: negate the value, or subtract from zero.