TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Exercises in Emulation: Xbox 360’s FMA Instruction

102 pointsby nikbackmabout 6 years ago

7 comments

udpabout 6 years ago
<i>&gt; I left the Xbox team long before the Xbox One shipped and I haven’t paid any attention to it since then, so I don’t know what they decided to do.</i><p>From experience trying to play 360 games on an Xbox One, the console reads nothing from the DVD and instead downloads the game from the Internet. It also only works for specific games. I therefore assume they gave up with emulation and simply recompiled certain 360 games for x64.
评论 #19450187 未加载
评论 #19449835 未加载
anispppabout 6 years ago
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.<p>You can just read that code and see how it’s done. Despite the ridiculous ending there was no mystery to begin with.<p><a href="https:&#x2F;&#x2F;www.lri.fr&#x2F;~melquion&#x2F;doc&#x2F;08-tc.pdf" rel="nofollow">https:&#x2F;&#x2F;www.lri.fr&#x2F;~melquion&#x2F;doc&#x2F;08-tc.pdf</a>
评论 #19455665 未加载
lifthrasiirabout 6 years ago
As far as I know, a correct emulation of FMA involves the double-double approach [1], that is to split a logical mantissa potentially larger than the native mantissa and merge them later. This is of course expensive and probably not a good fit for the OP&#x27;s purpose anyway.<p>[1] <a href="https:&#x2F;&#x2F;hal-ens-lyon.archives-ouvertes.fr&#x2F;inria-00080427v2&#x2F;document" rel="nofollow">https:&#x2F;&#x2F;hal-ens-lyon.archives-ouvertes.fr&#x2F;inria-00080427v2&#x2F;d...</a> has a verified proof.
评论 #19450067 未加载
robbiet480about 6 years ago
&gt; 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.
评论 #19452278 未加载
评论 #19449800 未加载
SlowRobotAheadabout 6 years ago
The whole time I was reading I was interested in what they chose to do... a lot of build up and no solution :&#x2F;<p>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.
评论 #19450130 未加载
评论 #19454699 未加载
pedrocrabout 6 years ago
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?<p>And wouldn&#x27;t the solution on x86 be to use the more than double precision floats that are available in the platform?<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Extended_precision" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Extended_precision</a>
评论 #19450374 未加载
评论 #19450036 未加载
评论 #19450080 未加载
评论 #19456944 未加载
评论 #19453765 未加载
评论 #19455612 未加载
pascal_cuoqabout 6 years ago
Bruce Dawson always does an excellent job of explaining subtle floating-point behaviors simply, but there is one sentence I do not agree with in this particular post:<p>&gt; However, for any rounding rule that you might come up with there is a case where the double rounding will give you a different answer from a true FMA.<p>For every “directed” rounding (up, down, towards zero), rounding the result of one operation first to higher precision and then to the intended precision is identical to rounding directly to the intended precision. For this reason, computing the FMA as “first compute the multiplication in higher precision so that no rounding happens in this step, then add the third operand at the same precision, then round to the nominal precision” does not suffer from double-rounding issues in all these rounding modes (which are all the rounding modes defined by IEEE 754 other than “round to nearest”).<p>So you do not even need to “come up with” them. They already exist, they are all the standardized rounding modes other than “round to nearest”.<p>Note: the reasoning above assumes the result of the multiplication is representable as a normal number in the higher-precision format. It is a property of IEEE 754 formats that the next more precise one can always represent the result of the multiplications of two finite numbers from the format below it as a normal number.