Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Do we really need SNE & FSNE? #142

Open
mbitsnbites opened this issue Sep 17, 2022 · 0 comments
Open

Do we really need SNE & FSNE? #142

mbitsnbites opened this issue Sep 17, 2022 · 0 comments
Milestone

Comments

@mbitsnbites
Copy link
Member

mbitsnbites commented Sep 17, 2022

Problem

We already have SEQ, and we can branch on BNS, for instance. Thus SNE appears to be superfluous (eating up encoding space).

Investigate if any code sequences would be worse if we didn't have SNE.

Also investigate FSNE.

Code sequences

With SNE Without SNE Good/Bad Comment
sne r1, r1, r5
bs r1, #foo
seq r1, r1, r5
bns r1, #foo
Good Branch if not equal
sne r1, r1, r5
bns r1, #foo
seq r1, r1, r5
bs r1, #foo
Good Branch if equal
sne r1, r1, #123
sub r1, z, r1
seq r1, r1, #123
add r1, r1, #1
Good a != b -> 0 / 1 (C/C++ arithmetic)
(Tricky to get working in GCC?)
sne r4, r1, #0
sel r4, r2, r3
seq r4, r1, #0
sel.132 r4, r2, r3
Good Conditional select with registers
sne r3, r1, #0
sel r3, r2, #123
seq r3, r1, #0
xor r3, r3, #-1
sel r3, r2, #123
BAD Conditional select with immediates
@mbitsnbites mbitsnbites added this to the v0.4 milestone Sep 17, 2022
@mbitsnbites mbitsnbites changed the title Do we really need SNE? Do we really need SNE & FSNE? Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant