Live data from Hacker News

Reverse Engineering the Constants in the Pentium FPU

righto.com

11–20 of 24 posts

Re: Reverse Engineering the Constants in the Pentium FPU

#11
post #10

I guess the unused entries spell "bad FC" (for floating constant). Also I think constants 6 through 10 are relevant for the decimal-to-binary conversion or vice versa, as evident from the following observation: 0x5c3bd5191b525a249 ~= 2^123 / 10^17 0x470de4df820000000 = 2^13 * 10^16

Thanks! I think you've figured out those mystery constants. How did you recognize them?

That somehow looked very similar to the typical powers of ten table found in floating point conversion routines. I got the first confirmation by searching for 0x5c3bd5191b525a249 / 2^67, which happened to match how many exabytes are equal to 5 exbibits.

Re: Reverse Engineering the Constants in the Pentium FPU

#12
post #2

Author here for your Pentium questions...

Feels like an honor to be able to ask. I've appreciated your work for a few years now especially on the Apollo gear restoration.

Anyway, question on the ones you thought were wrong (I think "just" the trig functions). Is there a running system you can use that can be used to confirm your findings? Especially considering your previous post on the pentium division bug, maybe they got this wrong too?

Re: Reverse Engineering the Constants in the Pentium FPU

#13
post #10

Earlier quoted context omitted.

Thanks! I think you've figured out those mystery constants. How did you recognize them?

That somehow looked very similar to the typical powers of ten table found in floating point conversion routines. I got the first confirmation by searching for 0x5c3bd5191b525a249 / 2^67, which happened to match how many exabytes are equal to 5 exbibits.

I've updated my article along with a credit to you. Unfortunately, I couldn't figure out the other constants despite a whole lot of brute-force checking.

Re: Reverse Engineering the Constants in the Pentium FPU

#15
post #2

Author here for your Pentium questions...

Are you working your way up through the eras of CPU's? How far do you predict you'll be able to get? (Ps. Thanks for all the awesome insight you've shared)

It's sort of random. My intent is to focus on the 8086, but someone asked about the 386 so I looked at that a bit. Then I saw the Navajo Pentium rug in a museum so I figured I should look at a real Pentium to compare. And then I wondered if I could find the FDIV bug. So one thing leads to another. I don't think I'll be able to go much beyond the Pentium with an optical microscope, though.

Re: Reverse Engineering the Constants in the Pentium FPU

#16
post #12
post #2

Author here for your Pentium questions...

Feels like an honor to be able to ask. I've appreciated your work for a few years now especially on the Apollo gear restoration. Anyway, question on the ones you thought were wrong (I think "just" the trig functions). Is there a running system you can use that can be used to confirm your findings? Especially considering your previous post on the pentium division bug, maybe they got this wrong too?

A running system won't really help me since I'm sure it will give the right answer. I need to know what's happening internally, which remains hidden in a running processor.

Re: Reverse Engineering the Constants in the Pentium FPU

#17
post #13

Earlier quoted context omitted.

That somehow looked very similar to the typical powers of ten table found in floating point conversion routines. I got the first confirmation by searching for 0x5c3bd5191b525a249 / 2^67, which happened to match how many exabytes are equal to 5 exbibits.

I've updated my article along with a credit to you. Unfortunately, I couldn't figure out the other constants despite a whole lot of brute-force checking.

There used to be a site called the Inverse Symbolic Calculator (also a sibling site, Plouffe's Inverter) where you could give in a decimal expansion and it would search for known constants. Unfortunately, it seems to be down (the frontend exists, the backend just gives 404). Maybe someone else made something similar?

Edit: I found https://mrob.com/pub/ries/, which may or may not help.

Re: Reverse Engineering the Constants in the Pentium FPU

#18
post #10

Earlier quoted context omitted.

Thanks! I think you've figured out those mystery constants. How did you recognize them?

That somehow looked very similar to the typical powers of ten table found in floating point conversion routines. I got the first confirmation by searching for 0x5c3bd5191b525a249 / 2^67, which happened to match how many exabytes are equal to 5 exbibits.

Constant 9 does match the expression ( at least when I truncate the output in KCalc 2^13*10^16/2^28 shows base16 0x470de4df82 )...

However, I don't know enough about floating point conversion to understand why that value's useful, or why it's stored where a fractional part normally would be in that same format.

Constants 6 and 7 visually appear to be in a similar fractional range and possibly as if extending precision of a fraction to 8 bit, 16 bit, and 32 bit words. I wonder if something along that line of thought might have an answer similar to the constant 10.

Re: Reverse Engineering the Constants in the Pentium FPU

#20
post #17
post #13

Earlier quoted context omitted.

I've updated my article along with a credit to you. Unfortunately, I couldn't figure out the other constants despite a whole lot of brute-force checking.

There used to be a site called the Inverse Symbolic Calculator (also a sibling site, Plouffe's Inverter) where you could give in a decimal expansion and it would search for known constants. Unfortunately, it seems to be down (the frontend exists, the backend just gives 404). Maybe someone else made something similar? Edit: I found https://mrob.com/pub/ries/ , which may or may not help.

The ries program is very cool for turning a number into an equation. However, I tried it on some of the Pentium constants and it didn't do very well. In particular, it seems to be allergic to numeric constants, preferring complicated symbolic expressions. For instance, if I put in 0.5625, I expect to get 9/16 out. However, ries doesn't come up with that, instead suggesting the best answer is sin(pi*sqrt(x)) = 1/sqrt(2). It's impressive that it came up with that formula, but it's not helpful.
Post reply on HN