min P1, P2, P3
max P1, P2, P3
where P1 ends up with the lesser (or greater) of P2 and P3.
On the one hand this'd make some of the code I'm generating now
simpler, but on the other it'd only make one specific chunk simpler,
and I'm not sure that really warrants new ops.
Opinions?
--
Dan
--------------------------------------it's like this-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk
Subroutine, man, subroutine. NCI if you need it to be fast.
--
Brent "Dax" Royal-Gordon <br...@brentdax.com>
Perl and Parrot hacker
Oceania has always been at war with Eastasia.
Feh on a subroutine--it's three or four ops with a few branches.
Which was the point--it eliminates the branches.
P1 = P2
if P2 < P3 goto done
P1 = P3
or
if P2 < P3 goto useP2
P1 = P3
branch done
useP2:
P1 = P2
done:
depending on whether the extra assignment's an issue. Still, tosses
the branches. Probably not worth it, since it's not going to be used
too often by code generators.
> min P1, P2, P3
> max P1, P2, P3
Which cmp operation of the three we have? I smell opcode bloat.
> On the one hand this'd make some of the code I'm generating now
> simpler
dynops/dan.ops does exist already :)
leo
Yeah, I've already given up on it. :)
### min P1, P2, P3 ###
isgt I0, P2, P3
choose P1, I0, P2, P3