benchmarking Poly/ML & floating point

Matthew Fluet fluet@CS.Cornell.EDU
Tue, 12 Sep 2000 14:13:23 -0400 (EDT)


> > Well, there is the efficiency question.  Real_equal is implemented by
> > and-ing and comparing th floating point status word and then doing a setz.
> > So, Real_nequal is done exactly the same way, except with a setnz.  If you
> > define it as  not o Real.==  then (currently) there would be an extra not
> > instruction.  But, I should be able to peephole that away.  In fact, I
> > really should look into that because any use of the polymorphic != would
> > suffer from this as well.
> 
> Actually, the CPS optimizer should eliminate the not by switching the labels on
> the cases from the Real.==.  Lemme know if you see a case where it doesn't.

That's true for branches, but something like:

map (Real.!=) l

or even

map (op =) l

which doesn't get uselessed away could benefit from changing
sete T1       setne T2
mov T1,T2 ==>
not T2

I'll look into it.