From: leathm AT solwarra DOT gbrmpa DOT gov DOT au (Leath Muller) Message-Id: <199705202353.JAA10694@solwarra.gbrmpa.gov.au> Subject: Re: float & ints & triangle3d_f To: wapex AT silesia DOT top DOT pl (Michal) Date: Wed, 21 May 1997 09:53:09 +1000 (EST) Cc: djgpp AT delorie DOT com In-Reply-To: <3381C71A.28FF@silesia.top.pl> from "Michal" at May 20, 97 05:45:30 pm Content-Type: text Precedence: bulk > > This is true, but if your just checking for a < b, sub a from b, store and > > check the sign bit. If the sign is 0 then a <= b... If you weave the code > > properly, you can do a check in about (from memory) 5 cycles... (compared > > to an int's 1 though) > This is true, but the compiler won't do it for you, and I can't imagine > writing all coparisions in assembler... so avoid it. > There is another trick you maight find usefull. To convert float point > to integer just add 0x59c00000 (have to be single precision fadd), store > the result and use it as it was integer. It's only 1 clock less, but you > have beter scheduling opportunities (can execute up to 4 integer > instruction in a gap after fadd). Doesn't this method have problems? Hmm... will have to go back to the ol' references... :) Leathal.