Software Optimization Guide for AMD64 Processors25112 Rev. 3.06 September 2005

Table 5: Comparisons among Two Floats

 

Use this …

 

Instead of this.

 

 

 

 

 

 

 

 

 

 

float t = f1

- f2;

 

if (f1

<= f2)

if (FLOAT2INTCAST(t)

<= 0)

 

 

 

 

 

 

 

float t = f1

- f2;

 

if (f1

> f2)

if (FLOAT2INTCAST(t)

> 0)

 

 

 

 

 

 

 

float t = f1

- f2;

 

if (f1

>= f2)

f (FLOAT2UINTCAST(f)

<= 0x80000000U)

 

 

 

 

 

 

 

56

C and C++ Source-Level Optimizations

Chapter 2

Page 72
Image 72
AMD 250 manual Comparisons among Two Floats