At 10:08 AM -0700 6/16/04, Brent 'Dax' Royal-Gordon wrote:
Dan Sugalski wrote:
   min P1, P2, P3
   max P1, P2, P3

Opinions?

Subroutine, man, subroutine. NCI if you need it to be fast.

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.
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to