# Stupid question on SP/DP & FP

Discussion in 'GPGPU Technology & Programming' started by LarsJurgen, Apr 29, 2008.

1. ### LarsJurgen Newcomer

Joined:
Apr 28, 2008
Messages:
3
0
When talking about SP & DP FP calculations, can one compare apple & oranges or is it the same thing?

I am on thin ice, but is a FP always a FP, except it being SP OR DP? Or is there tons of ISA things to consider? CAN a GPGPU be helped to improved FP performance on a PC systems? Or must, for example a game, be designed for it & if so for a brand? IE NVIDIA or AMD. Can a "program" be used so that it aids the CPU in FP calculations?

#1
2. ### pcchen Moderator ModeratorVeteranSubscriber

Joined:
Feb 6, 2002
Messages:
2,751
127
Location:
Taiwan
Of course, both SP and DP are floating point numbers. The difference is just the number of digits. 32 bits FP (single precision) is roughly equivalent to about 7 decimal digits, while 64 bits FP (double precision) is roughly 16 decimal digits.

Basically, in most practical use, 7 decimal digits seem to be quite good enough. However, depending on algorithms, error can accumulate and sometimes to a quite large amount, even with stable algorithms, especially when the amount of data is large.

Other considerations are not actually about precision, but about other things. For example, current NVIDIA GPU do not have accurate FP divider (it uses "multiply by reciprocal" to do division). In some applications these can be very bad.

On the other hand, many applications do not need high precision. For example, many image processing algorithms can work well with single precision FP, since their input values are limited in digits (8 bits per component is the most common form).

#2
3. ### LarsJurgen Newcomer

Joined:
Apr 28, 2008
Messages:
3
0
So FP "real performance", ISA does not matter? & you can throw the same problem at a cell, GPGPU, FPGA made for FP or x86 cpu?

#3
4. ### 3dilettante LegendAlpha

Joined:
Sep 15, 2003
Messages:
8,122
2,873
Location:
Well within 3d
ISA and implementation can have effects.

In the ISA case, a brain-dead ISA can royally screw up FP performance.
x87 is proof enough of that.

In the case of just throwing any problem at any architecture, I'd say yes and no.
If you mean just throwing a given algorithmic implementation to any architecture, no. The more exotic the architecture, the more likely you'd hit a snag where performance craters without refactoring something.

In the case of using the same program, no.
Some amount of change is often necessary, as even different x86 architectures don't always output bit-identical results.

#4
5. ### Tim Murray the Windom Earle of mobile SOCs Veteran

Joined:
May 25, 2003
Messages:
3,278
66
Location:
Mountain View, CA
Correct. The ISA doesn't matter. What matters is how the chip conforms (or diverges) from the IEEE 754 spec (assuming you're comparing to an x86 CPU--I don't know if there are others worth considering from other exotic architectures).

#5
6. ### ChronoReverse Newcomer

Joined:
Apr 14, 2004
Messages:
245
1
Someone somewhere said that the RV770 DP isn't IEEE compliant while the GT200 DP is. I'm wondering if this is true?

#6
7. ### 3dilettante LegendAlpha

Joined:
Sep 15, 2003
Messages:
8,122
2,873
Location:
Well within 3d
I'm not sure any GPU, or CELL is truly completely IEEE-754 compliant.
There's usually some corner cases with rounding modes and whatnot that just aren't covered.

GT200's DP unit seems to be more compliant with respect to denormals or at least reporting them, but I'm not sure it fully covers the spec.

Only SSE and some of the FP coprocessors like Clearspeed are fully (almost fully?) compliant on SP and DP.

Unless something changes, those that care the most about compliance might not be overly swayed by either GPU vendor.
Larrabee, if its vector instructions don't sacrifice compliance, would have a leg up unless future GPUs change.

#7
8. ### Arun Unknown. ModeratorLegendVeteran

Joined:
Aug 28, 2002
Messages:
5,023
299
Location:
UK
Heh, don't believe the hype: Last I looked, current Clearspeed solutions don't even handle denormals properly(!)

#8
9. ### 3dilettante LegendAlpha

Joined:
Sep 15, 2003
Messages:
8,122
2,873
Location:
Well within 3d
That just leaves x87 and SSE, possibly.

#9
Similar Threads - Stupid question

Replies:
25
Views:
2,233

Replies:
17
Views:
3,301

Replies:
6
Views:
1,971

Replies:
8
Views:
1,858

Replies:
3
Views:
1,783

Replies:
2
Views:
885