News for hackers. Stuff that matters.
Re:Don't waste money on a math coprocessor they said by rob74 on Monday November 13, 2023 @04:03AM (#38248353)
I was actually hoping that by the end of the blog post, the mystery of why the game didn't run would be cleared up, but sadly it wasn't. Looks like it had trouble accessing the HDD - but why should HDD access for a DOS game running under OS/2 require a math coprocessor?!

I have my own story of living happily without a math coprocessor for quite some time: from 1992 to 1997, I had an IBM PS/1000 with a "Blue Lightning" CPU which can be best described as a "486SX3" (25 MHz bus clock, 75MHz internal). Then I tried to run the Quake demo and found out that "real" 3D games need an FPU :(

Re:Don't waste money on a math coprocessor they said by glimshe on Monday November 13, 2023 @04:19AM (#38248435)
I got a math coprocessor relatively early for my 386SX20 - I wanted to use 3D Studio, the killer app for math processors back in the day! The vast majority of games simply used integer math and didn't require, or could take an advantage from a coprocessor, but I have no idea what was going on in the article. In the early 90s, the only games I can remember that could optionally leverage a coprocessor was the Falcon 3.0 family of simulators.
Re:Don't waste money on a math coprocessor they said by Loic on Monday November 13, 2023 @04:30AM (#38248498)
20+ floppy disks to get 3D Studio and of course you always had a bad one and not the first.
Re:Don't waste money on a math coprocessor they said by tacone on Monday November 13, 2023 @07:43AM (#38249524)
Reminds me of Monkey Island 2 asking to insert floppy 3bis. Good times :)
Re:Don't waste money on a math coprocessor they said by sillywalk on Monday November 13, 2023 @03:08PM (#38254716)
I can still imagine the floppy drive making the "chug-chug-chug" sound when you knew that the disk was bad.
Re:Don't waste money on a math coprocessor they said by tecleandor on Monday November 13, 2023 @04:56AM (#38248642)
Ah, I also had a 386SX, and some games (not a lot, maybe three or four) never run properly on my machine. :(

Edit: I just remembered one of them was "Eye of the Beholder III"

Re:Don't waste money on a math coprocessor they said by danparsonson on Monday November 13, 2023 @11:32AM (#38252042)
> Edit: I just remembered one of them was "Eye of the Beholder III"

If it's any consolation, you didn't miss much - III was a wet rag compared to the majesty of the first two games!

Re:Don't waste money on a math coprocessor they said by marhee on Monday November 13, 2023 @07:08AM (#38249304)
I remember "Dune 2" (1992) could use a co-processor? Not sure, we never had a machine with a co-processor but a friend had and he said that at start-up the game said something like "Co-processor found - let's use it!" and then game could run faster I believe (not sure).

Edit- Dune 2, not Dune 2000

Re:Don't waste money on a math coprocessor they said by wigster on Monday November 13, 2023 @09:04AM (#38250207)
i remember a friend of mine had falcon for the amiga 500. i don't think he EVER managed to take off without some "cheat" being activated.

a rather difficult game.

f16 however was a joy. happy days

Re:Don't waste money on a math coprocessor they said by rwmj on Monday November 13, 2023 @10:20AM (#38251162)
For me the killer app was POVRAY. Ran so much faster with a 387 (I seem to recall something like 100x faster but it was a long long time ago).
Re:Don't waste money on a math coprocessor they said by weinzierl on Monday November 13, 2023 @11:16AM (#38251901)
You lucky. I always dreamt of one, that and a TARGA graphics card. The last one not only for the looks but speed as well. Converting a *.TGA to a indexed color took a considerable amount of time.
Re:Don't waste money on a math coprocessor they said by russh on Monday November 13, 2023 @11:38AM (#38252120)
I remember being tired all day long after waking up many time during the night to check the progress of my renders or to tweak it and restart. And then I got a math coprocessor so I could wake up more often in the night to check my renders.
Re:Don't waste money on a math coprocessor they said by geon on Wednesday November 15, 2023 @06:53AM (#38275741)
I too slept badly because of povray rendering. But I just had trouble sleeping with the fan noise.
Re:Don't waste money on a math coprocessor they said by qingcharles on Thursday November 16, 2023 @10:27PM (#38299110)
I would just set them before bed and then check them before going to school in the morning, and set another one running, of course :D
Re:Don't waste money on a math coprocessor they said by mobilio on Monday November 13, 2023 @04:08AM (#38248376)
I have similar experience DX4 overclocked to 120 MHz vs. Pentium running on 75 MHz

Hint: Pentium FPU was faster

Re:Don't waste money on a math coprocessor they said by consp on Monday November 13, 2023 @05:16AM (#38248733)
My Retro-socket3-toy-unit with a P83@100 MHz is fast (40MHz bus), but the DX5x86@150mhz (50MHz bus) beats everything except in quake. Timings aren't that great for the memory but the synchronous PCI bus (and working PCI VGA card at that speed) beats everything you throw at it.
Re:Don't waste money on a math coprocessor they said by mobilio on Monday November 13, 2023 @05:43AM (#38248859)
Same here - all DOS games was faster on DX4, but Pentium was so smooth on Quake.
Re:Don't waste money on a math coprocessor they said by TerrifiedMouse on Monday November 13, 2023 @06:15AM (#38249029)
Carmack and Abrash optimized the heck out of Quake making use of a “quirk” in the Pentium where you can overlap integer operations and floating point DIV to eke out every last drop of performance.

Unfortunately the trick doesn’t work on early AMD K5/6 nor Cyrix CPUs - although Cyrix CPUs probably had other more serious problems.

https://youtu.be/DWVhIvZlytc?si=DBE9zpTLj_16-GAt

Re:Don't waste money on a math coprocessor they said by Sharlin on Monday November 13, 2023 @06:47AM (#38249189)
Yeah. Their perspective correct texture mapping did a perspective div only every 16 pixels drawn – in itself a considerable optimization with almost imperceptible loss in quality – but the big deal was that on the Pentium specifically, the integer pipeline could be almost perfectly cycle-optimized to process sixteen pixels in the time the FPU executed the next perspective division in parallel so the result was ready just as it was needed!
Re:Don't waste money on a math coprocessor they said by touisteur on Monday November 13, 2023 @07:53AM (#38249593)
More on this in the Black Book graphic shttps://news.ycombinator.com/item?id=35738709 . Programming on Pentium is towards the end.
Re:Don't waste money on a math coprocessor they said by rasz on Tuesday November 14, 2023 @02:05AM (#38260018)
K5/Cyrix could overlap Integer and FPU operations, what they couldnt do was interleave (pipeline) FPU operations so that multiple floating point instructions ran in parallel.

https://www.phatcode.net/res/224/files/html/ch63/63-02.html

Here a non perspective correction related Quake FPU code example https://github.com/id-Software/Quake/blob/bf4ac424ce754894ac...

    Lcliploop:
     fld ds:dword ptr[0+0+esi]
     fmul ds:dword ptr[0+0+ebx]
     fld ds:dword ptr[0+4+esi]
     fmul ds:dword ptr[0+4+ebx]
     fld ds:dword ptr[0+8+esi]
     fmul ds:dword ptr[0+8+ebx]
     fxch st(1)
     faddp st(2),st(0)
     fld ds:dword ptr[0+0+edx]
     fmul ds:dword ptr[0+0+ebx]
     fld ds:dword ptr[0+4+edx]
     fmul ds:dword ptr[0+4+ebx]
     fld ds:dword ptr[0+8+edx]
     fmul ds:dword ptr[0+8+ebx]
     fxch st(1)
     faddp st(2),st(0)
     fxch st(3)
     faddp st(2),st(0)
     faddp st(2),st(0)
     fsub ds:dword ptr[12+ebx]
     fxch st(1)
     fsub ds:dword ptr[12+ebx]
     fxch st(1)
     fstp ds:dword ptr[Ld0]
     fstp ds:dword ptr[Ld1]

FXCH instruction is free (zero cycles) on Pentium for most instruction combinations, AMD caught up in late 1998 with CXT revision K6-2. http://www.azillionmonkeys.com/qed/cpuwar.html
Re:Don't waste money on a math coprocessor they said by _the_inflator on Monday November 13, 2023 @05:25AM (#38248772)
Pentium was very significant in comparison to predecessors. In the beginning Intel shipped a Pentium 66 and it smoked the 486 DX 100 easily.

We kind of marveled back then because MHz meant speed.

Re:Don't waste money on a math coprocessor they said by vikingerik on Monday November 13, 2023 @12:52PM (#38252976)
Part of that was the bus and memory speed as well. The 486 bus ran at 33 MHz (the "DX4" is actually only clock-tripled to 100), while the Pentium bus and memory ran at 66.
Re:Don't waste money on a math coprocessor they said by _the_inflator on Monday November 13, 2023 @01:58PM (#38253767)
Yes, I know. Setting the jumpers for the right bus speed for the multiplication was key. This was the time of the fine tuning and over clocking. Asus boards were the best for this job back then.

Some Pentium ran at 60, not 66.

Re:Don't waste money on a math coprocessor they said by hurryer on Monday November 13, 2023 @05:26AM (#38248779)
Pentium was the first CPU which could run two integer operations per cycle.
Re:Don't waste money on a math coprocessor they said by mobilio on Monday November 13, 2023 @05:33AM (#38248806)
I remember that - U pipe and V pipe.

And that's why it's first x86 that was superscalar.

Re:Don't waste money on a math coprocessor they said by johnklos on Monday November 13, 2023 @02:23PM (#38254101)
It wasn't the first CPU that was superscalar by far, but it was the first x86 CPU that was superscalar.
Re:Don't waste money on a math coprocessor they said by pak9rabid on Monday November 13, 2023 @11:54AM (#38252307)
Yep. The P5 arch (original Pentium) superscalar design, combined with its much faster FPU and separation of data and code caches meant it could run circles around a 486-based CPU, even if it was running up to twice the speed of a 486 contender.
Re:Don't waste money on a math coprocessor they said by mrlonglong on Monday November 13, 2023 @05:36PM (#38256328)
I had a dual Pentium Pro 166Mhz w/512kb caches running on a Tyan mobo. That thing was fast under Linux.

EDIT: Present day, rocking a thread ripper with 48 logical cores. Still running Linux.

Re:Don't waste money on a math coprocessor they said by ggambetta on Monday November 13, 2023 @04:45AM (#38248589)
My parents were architects and they used AutoCAD. A very early version, maybe 3? So our PC had a math coprocessor... on a 286!!! Yes, the 80287 was a thing.
Re:Don't waste money on a math coprocessor they said by NikkiA on Monday November 13, 2023 @05:30AM (#38248795)
In the 286 era there were even different types of co-processor, the Weitek implementation (2167) absolutely trounced the official 80287 (and it's second source versions) at CAD, that's most likely what your parents had.
Re:Don't waste money on a math coprocessor they said by saltcured on Monday November 13, 2023 @04:17PM (#38255526)
I searched the comments page to find you were the only one who mentioned them. I think we had a 20 MHz 286 with a Weitek coprocessor when I was a kid.

It seems Weitek also had a coprocessor to go with 386.

Re:Don't waste money on a math coprocessor they said by NikkiA on Monday November 13, 2023 @11:54PM (#38259347)
They had one (4167) for the 486 too, I have no idea if it only worked with 486SX systems, or if it could work alongside a DX (but then who'd have a co-processor socket on a DX board anyway, co-processor sockets had already become scarce in the 386 period).

By that era they appear to have mostly pivotted to their own 486 clones and VGA chipsets though.

edit: I just realised, it could have been like the Cyrix 487S which installed as a PCB carrier that plugged into the 486DX socket, and then had a socket on the carrier for the CPU itself, alongside the 487S chip.

Re:Don't waste money on a math coprocessor they said by lproven on Wednesday November 15, 2023 @05:57AM (#38275389)
Re:Don't waste money on a math coprocessor they said by selcuka on Monday November 13, 2023 @07:25AM (#38249415)
I had an 8086 PS/2 clone (Multitech, then rebranded themselves as Acer) with a coprocessor, so yeah, even 8087 was a thing.
Re:Don't waste money on a math coprocessor they said by benj111 on Monday November 13, 2023 @04:49AM (#38248607)
I wondered if it was a hardware fault, and the fpu is allowing enough electrons to flow where they need to be.

Although the infocom 'boot' step suggests a race condition somewhere? Or some register not being properly set by the os.

Re:Don't waste money on a math coprocessor they said by wzdd on Monday November 13, 2023 @06:54AM (#38249234)
Or installing the coprocessor reseated a slightly-loose cable or created a better connection on a broken trace. The "boot step" could simply result in the system being warmer, which would make marginal connections like this behave differently.

To be sure, the author should remove and reinstall the coprocessor 10 times, testing after each. :)

Re:Don't waste money on a math coprocessor they said by scruffyherder on Tuesday November 14, 2023 @05:11PM (#38270542)
I replaced the 386 today with one from 1990. I was able to boot a disk I keep around that has MS-DOS 3.30a and Windows/386 2.11 on it. I also have Battletech on there and yes it ran with no issues! It didn’t work at all on the older processor.

When I pushed it into the socket it made such a loud “ker chunk” noise that I wouldn’t want to constantly pull out and reseat these chips. Especially since I don’t have the Intel “rake” like puller I had to use a pair of card edge blanks to gently rock it out of the socket.

Although I do appreciate the 10x humor of it.

It’s weird that so many people focus on the software, which runs perfectly fine in emulation, but seem to lose their minds that an $8,000 machine from 1987 shipped with a buggy CPU…

Hopefully this tbh t will encourage someone out there with a 386 to try to replicate this.

Re:Don't waste money on a math coprocessor they said by consp on Monday November 13, 2023 @05:49AM (#38248890)
> I was actually hoping that by the end of the blog post, the mystery of why the game didn't run would be cleared up, but sadly it wasn't.

My best guess would be something of the following: The software tries to determine if the CPU has a 80(2/3)87 device some way. Thinks it does have it and then tries a FPU instruction to get the error signal firing and getting the eventual INT02 to blow up in it's face. But I'm not limited by any actual knowledge here so this might just as well be something completely different.

Re:Don't waste money on a math coprocessor they said by bcoates on Monday November 13, 2023 @07:04AM (#38249285)
My guess is that the Infocom game was setting up some sort of FP emulation TSR and not cleaning it up, and BattleTech was coincidentally using it. Or whatever the equivalent of a windows 3.x VxD is for OS/2, if that exists. Or just otherwise messing with the interrupt tables involved in the arcane x87 protocol in a way that un-breaks things.

Also it looks like there may be some issues with FP/FP emulation on the OS/2 DOS extender host: https://www.os2museum.com/wp/floating-point-exceptions-and-d...

Re:Don't waste money on a math coprocessor they said by consp on Monday November 13, 2023 @07:49AM (#38249563)
That sounds quite more plausible than my idea. FP emulation is always interesting if performed by multiple programs/companies messing with each other's implementation. Lots of fun with layers of interrupts, real/virtual/protected mode switches and all the other magic the original 87 was not designed for.
Re:Don't waste money on a math coprocessor they said by mst on Monday November 13, 2023 @08:05AM (#38249669)
"I'm not limited by any actual knowledge here" is an excellent way of putting it and I shall endeavour to remember it next time I'm in such a situation.

Poor though my memory is, it happens often enough that I have a decent chance.

Re:Don't waste money on a math coprocessor they said by scruffyherder on Monday November 13, 2023 @12:18PM (#38252598)
I just got a newer cpu today I just wanted to write something out as I wasn’t expecting this kind of response.

There is no problem with the drive on dos, windows or os/2 1.2 so it’s something about it being an early 2.0 beta and probably an older 386 cpu.

Re:Don't waste money on a math coprocessor they said by Narishma on Monday November 13, 2023 @03:40PM (#38255082)
You didn't actually miss much because even with an FPU, Quake wasn't really playable on a 486. It was optimized for the Pentium.
Re:Don't waste money on a math coprocessor they said by Projectiboga on Monday November 13, 2023 @05:38PM (#38256350)
Might have a been copy protection code requiring the coprocessor?
Re:Don't waste money on a math coprocessor they said by jandrese on Monday November 13, 2023 @05:40PM (#38256365)
The suggestion in the article was simply that his 386 was a crappy early one that may also be slightly defective seems plausible. IIRC the 387 was a full 386 plus the floating point logic, and when you installed it the coprocessor took over most of the processing and the 386 was reduced to being a data broker.
Re:Don't waste money on a math coprocessor they said by _ihaque on Monday November 13, 2023 @05:46PM (#38256424)
I believe the 387 was an actual coprocessor; the _487_ may be what you're thinking of -- the 487SX contained a whole 486DX inside and just disabled the host processor [1].

[1] https://en.wikipedia.org/wiki/X87#80487

Re:Don't waste money on a math coprocessor they said by ForOldHack on Monday November 13, 2023 @11:32PM (#38259200)
I would concur: The 386sx was just 16 bit. The 387sx was for that 16 bit processor. The 486sx was no math co-processor, and the 487 was a whole 486 DX, i.e. the vacancy slot, brought to you by Intel Marketing.
Re:Don't waste money on a math coprocessor they said by scruffyherder on Monday November 13, 2023 @07:44PM (#38257365)
The 487 was the “full” replacement chip upgrade.

I still don’t know why the addition of the math coprocessor helped so much

Re:Don't waste money on a math coprocessor they said by lproven on Wednesday November 15, 2023 @05:58AM (#38275394)