Live data from Hacker News

Exercises in Emulation: Xbox 360’s FMA Instruction

randomascii.wordpress.com

31–40 of 50 posts

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#31

Earlier quoted context omitted.

Looking at the events that lead up to the financial crash, not much you'd think. What with people putting mortgages on their dogs and whatnot.

As a self-employed person who has applied for a mortgage both before and after the crash, I can tell you that a lot has changed. It's just taken me nearly a month of back-and-forth to get approved despite having a near-perfect credit history.

I wasn't clear, but I meant back in the day, it seems what you filled in didn't have much to do with your mortgage. Nowadays, yes, they verify a lot of things.

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#32
post #30
post #22

Earlier quoted context omitted.

https://www.eurogamer.net/articles/digitalfoundry-2017-xbox-...

This makes me wonder if the Halo Master Chief Collection release on PC will be based on emulation.

IIRC nothing in MCC is emulated.

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#33
Personally found this article overly dramatic and a bit dumb. All this wall of text just to point out that FMA needs to be emulated... ok.. but it’s a solved problem. This is also not a new problem.. fmaf is defined in C99 standard so There are multiple open source library implementations of FMA using round to odd for years.

You can just read that code and see how it’s done. Despite the ridiculous ending there was no mystery to begin with.

https://www.lri.fr/~melquion/doc/08-tc.pdf

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#34

> If you apply for a mortgage when your job title is emulation ninja then you are in a quandary. If you write that on the mortgage application then you look like a lunatic. If you write “software engineer” then you get in trouble when the mortgage broker calls your employer. You know. Hypothetically.

As an employed "software engineer" who has recently applied for a mortgage (house closing tomorrow!), I'm highly interested in this statement. I've encountered no trouble whatsoever, and I'm honestly surprised that its gone as smoothly and quickly as it has.

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#35
post #30
post #22

Earlier quoted context omitted.

https://www.eurogamer.net/articles/digitalfoundry-2017-xbox-...

This makes me wonder if the Halo Master Chief Collection release on PC will be based on emulation.

It's a remaster and it's published by Microsoft, I doubt they'd let a sub-par Windows experience slide for their own product.

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#36
post #16

Earlier quoted context omitted.

They do. Slight problems with floating point behavior are the cause of many historical problems with GameCube and Wii games in the Dolphin emulator (which also has to emulate PPC on x86/x64) For a simpler example from personal experience, I had a textbook implementation of triangulation via ear clipping to turn polygons into a list of triangles I could send to the GPU. On Windows it worked great but when I ran it on…

> This turned out to be because the rounding behavior on the 360 was different and the algorithm is fundamentally unstable using floats. That sounds like a bug though but I guess that's the point. Unless you're bug for bug compatible a reasonable amount of code will fail a significant amount of time...

There's not really a bug here. Some algorithms based on floating point numbers require floating point operations to work in certain ways. x86 floating point operates differently than most other floating point systems, in large part because of when it was developed, and that it can't change because it needs to remain compatible with existing code.

It would be a bug to release code that required x86 floating point behavior on a non-x86 system, but in this case, it was easily caught during early testing.

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#37
post #13

Do games really rely on the rounding behaviors of floats to not break? Seems like there should always be plenty of margin around that. But maybe something does a loop with these instructions over and over and the error compounds? And wouldn't the solution on x86 be to use the more than double precision floats that are available in the platform? https://en.wikipedia.org/wiki/Extended_precision

Yep. IIRC, this was why several of the Sonic Adventure ports from Dreamcast has issues where the player character could fall through tiny seams in the floor.

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#38
post #30
post #22

Earlier quoted context omitted.

https://www.eurogamer.net/articles/digitalfoundry-2017-xbox-...

This makes me wonder if the Halo Master Chief Collection release on PC will be based on emulation.

The Xbox One is x86/64, so emulation shouldn't be necessary for the MCC. The remaining questions are how much it is a "port" from what was released on the Xbox One.

- Supposedly the early Xbox One games used a fork/version of DirectX that wasn't ever quite released in that form in Windows 10. Rumors are that has been corrected in the upcoming April Release.

- Also, the early Xbox One games used very different Microsoft Store asset servers/etc. The State of Decay Insider tests seem to indicate that April Release of Windows 10's Microsoft Store can now speak to Xbox asset servers/etc directly. (Indications that the State of Decay game installed from possibly the exact same assets in the April Release as it would on an Xbox One.)

- Finally, early Xbox One games sometimes made assumptions that they ran in lightweight VMs with almost no multitasking (except for Kinect-related restrictions when that was mandatory) and some very specific performance characteristics versus the wild west of available PC hardware. Rumors abound that Hyper-V improvements in Windows 10 solve some of the VM/multitasking issues. Leaving only, perhaps, the need to test on a variety of PC hardware configurations.

Obviously, a lot of speculation there. Presumably a lot more information will surface as the April Release happens and as E3 approaches.

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#39

The whole time I was reading I was interested in what they chose to do... a lot of build up and no solution :/ Maybe they did recompile the games for backwards compatibility, maybe they do have an emulator, IDK, but I want to know how they would have fixed this issue.

They ended up shipping processors that support FMA on the xbone, so they probably just used that.

Re: Exercises in Emulation: Xbox 360’s FMA Instruction

#40
post #13

Do games really rely on the rounding behaviors of floats to not break? Seems like there should always be plenty of margin around that. But maybe something does a loop with these instructions over and over and the error compounds? And wouldn't the solution on x86 be to use the more than double precision floats that are available in the platform? https://en.wikipedia.org/wiki/Extended_precision

> Do games really rely on the rounding behaviors of floats to not break? Seems like there should always be plenty of margin around that. But maybe something does a loop with these instructions over and over and the error compounds?

I remember that in PearPC the sin function of cocoa (IIRC) would crash if the FMA instructions did not provide enough accuracy. It would access a table of precomputed values out of bounds or so.

Post reply on HN