Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Hardware

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 04:40 PM
Dave (from the UK)
 
Posts: n/a
Default How many bits internally on FPU?

I know the Intel floating point units (8087, 80287, 80387, 486 etc) all
use 80 bits internally which gives about 19 significant digits. When
writing to RAM only 64 bits (8 bytes) are used.

Does a SPARC FPU use more than 64 bits interally? I'm particulary
interstined in the UltraSPARC II CPUs in my Ultra 80.


--
Dave (from the UK)

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@althorne.org
Hitting reply will work for a few months only - later set it manually.

http://chessdb.sourceforge.net/ - a Free open-source Chess Database
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 04:40 PM
Raymond Toy
 
Posts: n/a
Default Re: How many bits internally on FPU?

>>>>> "Dave" == Dave <(from the UK)" <see-my-signature@see-below.com>> writes:

Dave> I know the Intel floating point units (8087, 80287, 80387,
Dave> 486 etc) all use 80 bits internally which gives about 19
Dave> significant digits. When writing to RAM only 64 bits (8
Dave> bytes) are used.

Dave> Does a SPARC FPU use more than 64 bits interally? I'm
Dave> particulary interstined in the UltraSPARC II CPUs in my
Dave> Ultra 80.

I'm pretty sure there are only 64 bits. There might be more, but I
know of know way to access them.

Ray

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 04:40 PM
Dave (from the UK)
 
Posts: n/a
Default Re: How many bits internally on FPU?

Raymond Toy wrote:
>>>>>>"Dave" == Dave <(from the UK)" <see-my-signature@see-below.com>> writes:

>
>
> Dave> I know the Intel floating point units (8087, 80287, 80387,
> Dave> 486 etc) all use 80 bits internally which gives about 19
> Dave> significant digits. When writing to RAM only 64 bits (8
> Dave> bytes) are used.
>
> Dave> Does a SPARC FPU use more than 64 bits interally? I'm
> Dave> particulary interstined in the UltraSPARC II CPUs in my
> Dave> Ultra 80.
>
> I'm pretty sure there are only 64 bits. There might be more, but I
> know of know way to access them.
>
> Ray
>



IIRC I did find a way on the Intel CPU of getting all 80 bits, in
assembly code. But it must be 15+ years since I wrote any assembly code.

But I was more interested in not whether one can get them or not, but
whether they are used internally.


--
Dave (from the UK)

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@althorne.org
Hitting reply will work for a few months only - later set it manually.

http://chessdb.sourceforge.net/ - a Free open-source Chess Database
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 04:40 PM
gerryt
 
Posts: n/a
Default Re: How many bits internally on FPU?

On Sep 1, 5:13 am, "Dave (from the UK)" <see-my-signat...@see-
below.com> wrote:
> Raymond Toy wrote:
> >>>>>>"Dave" == Dave <(from the UK)" <see-my-signat...@see-below.com>> writes:

> > Dave> I know the Intel floating point units (8087, 80287, 80387,
> > Dave> 486 etc) all use 80 bits internally which gives about 19
> > Dave> significant digits. When writing to RAM only 64 bits (8
> > Dave> bytes) are used.
> > Dave> Does a SPARC FPU use more than 64 bits interally? I'm
> > Dave> particulary interstined in the UltraSPARC II CPUs in my
> > Dave> Ultra 80.
> > I'm pretty sure there are only 64 bits. There might be more, but I
> > know of know way to access them.

> IIRC I did find a way on the Intel CPU of getting all 80 bits, in
> assembly code. But it must be 15+ years since I wrote any assembly code.


I recall the same thing but that book mouders away in the basement so
I cannot
say for sure, but popping 80 bit results results off the FPU stack
auto populated the
target memory area...?

> But I was more interested in not whether one can get them or not, but
> whether they are used internally.


What do you mean by internally?
Anything could be thought of as internal... ; >

A quote from the The SPARC Architecture Manual Version 9

"The store quad floating-point instruction (STQF) copies the contents
of a quad floatingpoint
register into a word-aligned quadword in memory."
and :
"3.1.2 Floating-Point Unit (FPU)
The FPU has 32 32-bit (single-precision) floating-point registers, 32
64-bit (double-precision)
floating-point registers, and 16 128-bit (quad-precision) floating-
point registers,
some of which overlap."

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 04:40 PM
Dave
 
Posts: n/a
Default Re: How many bits internally on FPU?

gerryt wrote:

>> IIRC I did find a way on the Intel CPU of getting all 80 bits, in
>> assembly code. But it must be 15+ years since I wrote any assembly code.

>
> I recall the same thing but that book mouders away in the basement so
> I cannot


Same with me I suspect.

> say for sure, but popping 80 bit results results off the FPU stack
> auto populated the
> target memory area...?
>
>> But I was more interested in not whether one can get them or not, but
>> whether they are used internally.

>
> What do you mean by internally?
> Anything could be thought of as internal... ; >


I was thinking along the lines of that the actual computations might use
>64 bits, so that the all 64 bits were most likely to be correct, and

so the last few not inaccurate due to rounding errors.

>
> A quote from the The SPARC Architecture Manual Version 9
>
> "The store quad floating-point instruction (STQF) copies the contents
> of a quad floatingpoint
> register into a word-aligned quadword in memory."
> and :
> "3.1.2 Floating-Point Unit (FPU)
> The FPU has 32 32-bit (single-precision) floating-point registers, 32
> 64-bit (double-precision)
> floating-point registers, and 16 128-bit (quad-precision) floating-
> point registers,
> some of which overlap."


Interesting about the 128 bit ones. That suggest that perhaps the
internal computations are done with more than 64-bits. Although perhaps
it means you can read a 128-bit register which simply has the data from
two 64-bit registers, which contain totally unrelated numbers.

I guess from a practical point of view it does not make too much
difference to me. I'm surprised someone else's C code averages 3 numbers
with 4 digits (two before the decimal point and two after) and gets a
value which differs from that on my Sun by 0.02. (It's slightly more
complex than simple averaging as the numbers known are the logs of the
numbers that need averaging, so an anitlog has to be performed first).

Perhaps we have discovered another bug in the FPU of an Intel CPU! What
did the one on the early Pentium cost Intel? I will investigate this a
bit more I think!





Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-16-2008, 04:40 PM
Raymond Toy
 
Posts: n/a
Default Re: How many bits internally on FPU?

>>>>> "Dave" == Dave <someplace@nowhere-nice.com> writes:

Dave> gerryt wrote:

>>> IIRC I did find a way on the Intel CPU of getting all 80 bits, in
>>> assembly code. But it must be 15+ years since I wrote any assembly code.

>> I recall the same thing but that book mouders away in the basement so
>> I cannot


Dave> Same with me I suspect.

There is an instruction to save all 80 bits to memory. (And load it
from memory too.)

>> say for sure, but popping 80 bit results results off the FPU stack
>> auto populated the
>> target memory area...?
>>
>>> But I was more interested in not whether one can get them or not, but
>>> whether they are used internally.

>> What do you mean by internally?
>> Anything could be thought of as internal... ; >


Dave> I was thinking along the lines of that the actual
Dave> computations might use 64 bits, so that the all 64 bits were
Dave> most likely to be correct, and so the last few not
Dave> inaccurate due to rounding errors.

I'm pretty sure all 64 bits are correctly rounded. I don't know how
many extra bits are needed to make sure all operations are correctly
rounded. I think you need at least a sticky bit to indicate something
about all the bits that were thrown away when rounding.

Dave> Interesting about the 128 bit ones. That suggest that perhaps the
Dave> internal computations are done with more than 64-bits. Although
Dave> perhaps it means you can read a 128-bit register which simply has the
Dave> data from two 64-bit registers, which contain totally unrelated
Dave> numbers.

AFAIK, no Ultrasparc actually implements the 128-bit floats in
hardware. Everything is emulated via kernel traps. In fact, I
vaguely recall some note saying that the quad-float instructions
should probably not be used, and the quad-float subroutines should be
used instead, because of the kernel trap overhead.

I think Fujitsu's Sparc chip might implement 128-bit floats, but I'm
not sure.

Dave> I guess from a practical point of view it does not make too much
Dave> difference to me. I'm surprised someone else's C code averages 3
Dave> numbers with 4 digits (two before the decimal point and two after) and
Dave> gets a value which differs from that on my Sun by 0.02. (It's slightly
Dave> more complex than simple averaging as the numbers known are the logs
Dave> of the numbers that need averaging, so an anitlog has to be performed
Dave> first).

But this could be due to all kinds of things. Computations being done
in a different order, the Intel chip using all 80-bits whereas a Sparc
only has 64, or special functions aren't implemented with the same
accuracy, etc., etc.

Ray
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-16-2008, 04:40 PM
gerryt
 
Posts: n/a
Default Re: How many bits internally on FPU?

On Sep 6, 3:57 am, Dave <somepl...@nowhere-nice.com> wrote:
> gerryt wrote:
> >> IIRC I did find a way on the Intel CPU of getting all 80 bits, in
> >> assembly code. But it must be 15+ years since I wrote any assembly code.

> > I recall the same thing but that book mouders away in the basement so
> > I cannot

> Same with me I suspect.


Mouldering away in a basement??!
Never mind : >

> > say for sure, but popping 80 bit results results off the FPU stack
> > auto populated the
> > target memory area...?
> >> But I was more interested in not whether one can get them or not, but
> >> whether they are used internally.

> > What do you mean by internally?
> > Anything could be thought of as internal... ; >

> I was thinking along the lines of that the actual computations might use
> >64 bits, so that the all 64 bits were most likely to be correct, and

> so the last few not inaccurate due to rounding errors.


Havent seen the die or the tapes but I would hope that a few gates
switched on or off would do the calcs in hardware, end up in the stack
where you then you pop the results off into memory woth a STQF.

> > A quote from the The SPARC Architecture Manual Version 9
> > "The store quad floating-point instruction (STQF) copies the contents
> > of a quad floatingpoint
> > register into a word-aligned quadword in memory."
> > and :
> > "3.1.2 Floating-Point Unit (FPU)
> > The FPU has 32 32-bit (single-precision) floating-point registers, 32
> > 64-bit (double-precision)
> > floating-point registers, and 16 128-bit (quad-precision) floating-
> > point registers,
> > some of which overlap."

>
> Interesting about the 128 bit ones. That suggest that perhaps the
> internal computations are done with more than 64-bits. Although perhaps
> it means you can read a 128-bit register which simply has the data from
> two 64-bit registers, which contain totally unrelated numbers.


Possibly but why offer fake goods..

> I guess from a practical point of view it does not make too much
> difference to me. I'm surprised someone else's C code averages 3 numbers
> with 4 digits (two before the decimal point and two after) and gets a
> value which differs from that on my Sun by 0.02. (It's slightly more
> complex than simple averaging as the numbers known are the logs of the
> numbers that need averaging, so an anitlog has to be performed first).
>
> Perhaps we have discovered another bug in the FPU of an Intel CPU! What
> did the one on the early Pentium cost Intel? I will investigate this a
> bit more I think!


Have fun. The Arch manual I found here:
http://www.sparc.com/standards/v9.ps.Z

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-16-2008, 04:40 PM
Dave (from the UK)
 
Posts: n/a
Default Re: How many bits internally on FPU?

Raymond Toy (RT/EUS) wrote:

> Dave> I guess from a practical point of view it does not make too much
> Dave> difference to me. I'm surprised someone else's C code averages 3
> Dave> numbers with 4 digits (two before the decimal point and two after) and
> Dave> gets a value which differs from that on my Sun by 0.02. (It's slightly
> Dave> more complex than simple averaging as the numbers known are the logs
> Dave> of the numbers that need averaging, so an anitlog has to be performed
> Dave> first).
>
> But this could be due to all kinds of things. Computations being done
> in a different order, the Intel chip using all 80-bits whereas a Sparc
> only has 64, or special functions aren't implemented with the same
> accuracy, etc., etc.
>
> Ray


The Sun result is the more accurate of the two, which is stange, given
it is probably using less bits (64 vs 80 on an intel chip).

These are 3 the numbers:

-90.55 , -90.06 6 and -88.81

These are power levels in something callled dBm.

http://en.wikipedia.org/wiki/DBm


I need to find the average of these 3 power levels, but because they are
logs of powers, I need to use this method. Assume they are d1, d2 and d3

d1 = -90.55
d2 = -90.06
b3 = -88.81

p1=10^(d1/10)
p2=10^(d2/10)
p3=10^(d3/10)

mean power = pm = (p1+p2+p3)/3

mean power in dBm= 10*log10(pm)


Intel chip gives -89.76 dBm (I don't know any more places). SPARC chip

-89.7434558385774039

Doing this in Mathematica, using 100 digits of working precision, I get:

-89.74345583857740387143584746291068890792783429908 25094614875506378


Writing all 3, one above the other:

-89.74345583857740387143584746291068890792783429908 2 (Mathemaitca)
-89.7434558385774039 (SPARC)
-89.76 (Intel)

I'm using gcc on a Sun. Someone else is using gcc inside Cywin on a
Windows box.



--
Dave (from the UK)

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@althorne.org
Hitting reply will work for a few months only - later set it manually.

http://chessdb.sourceforge.net/ - a Free open-source Chess Database
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-16-2008, 04:40 PM
Carl Lowenstein
 
Posts: n/a
Default Re: How many bits internally on FPU?

In article <46e283f9@212.67.96.135>,
Dave (from the UK) <feb-2007@althorne.org> wrote:
>Raymond Toy (RT/EUS) wrote:
>
>> Dave> I guess from a practical point of view it does not make too much
>> Dave> difference to me. I'm surprised someone else's C code averages 3
>> Dave> numbers with 4 digits (two before the decimal point and two

>after) and
>> Dave> gets a value which differs from that on my Sun by 0.02.

>(It's slightly
>> Dave> more complex than simple averaging as the numbers known are the logs
>> Dave> of the numbers that need averaging, so an anitlog has to be

>performed
>> Dave> first).
>>
>> But this could be due to all kinds of things. Computations being done
>> in a different order, the Intel chip using all 80-bits whereas a Sparc
>> only has 64, or special functions aren't implemented with the same
>> accuracy, etc., etc.
>>
>> Ray

>
>The Sun result is the more accurate of the two, which is stange, given
>it is probably using less bits (64 vs 80 on an intel chip).
>
>These are 3 the numbers:
>
>-90.55 , -90.06 6 and -88.81
>
>These are power levels in something callled dBm.
>
>http://en.wikipedia.org/wiki/DBm
>
>
>I need to find the average of these 3 power levels, but because they are
>logs of powers, I need to use this method. Assume they are d1, d2 and d3
>
>d1 = -90.55
>d2 = -90.06
>b3 = -88.81
>
>p1=10^(d1/10)
>p2=10^(d2/10)
>p3=10^(d3/10)
>
>mean power = pm = (p1+p2+p3)/3
>
>mean power in dBm= 10*log10(pm)
>


>-89.74345583857740387143584746291068890792783429908 2 (Mathemaitca)
>-89.7434558385774039 (SPARC)
>-89.76 (Intel)


-89.743455839 HP 32S calculator

So somebody at Intel screwed up. What else is new?
Or the C math library functions are not the same in both cases (Sun and Intel).
Or the two versions of the program are not identical.

You could run some test cases on both systems, around the values from
-89.0 to -91.0 to see how close the computed 10*log10(10^(x/10))
is to the input value of x.

Also look for possible discrepancies in the value of "10", single- or double-
precision. See if division by 10 is written as multiplication by 0.1.

carl
--
carl lowenstein marine physical lab, u.c. san diego
clowenstein@ucsd.edu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:39 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597