News for hackers. Stuff that matters.
Re:Faster arithmetic by flipping signs by benj111 on Friday May 10, 2019 @06:22AM (#19876511)
I thought this was going to be about 2s complement bit flipping. But no it's for floating point!
Re:Faster arithmetic by flipping signs by MayeulC on Friday May 10, 2019 @09:42AM (#19877575)
Shadow of the Tomb Raider is a quite recent game, and was not released on Xbox 360 (according to my memory and the helpfully linked wikipedia article). Wouldn't this piece be about Rise of the Tomb Raider instead?

Of course, this nitpick only concerns the introduction, the rest is a good piece.

Re:Faster arithmetic by flipping signs by tntn on Friday May 10, 2019 @11:33AM (#19878716)
> tasked with optimizing the cloth simulation code in Shadow of the Tomb Raider. It had been fine tuned extensively with PowerPC intrinsics for the Xbox 360 but its performance was lacking on XboxOne (x64).

Sounds to me like they were recycling some old cloth simulation code from previous games and it needed to be optimized for Xbox one for the release of the new game.

Re:Faster arithmetic by flipping signs by zeno490 on Tuesday May 14, 2019 @11:07AM (#19910231)
Correct, their game engine has been around since the very first Tomb Raider and even before that. The code evolved over the years of course and the cloth simulation code as well. Shadow of the Tomb Raider used much more cloth in the environment and on the characters than previous games and it needed a bit of help. I don't remember off the top of my head how much I managed to speed it up but tuning the assembly for x64 and SSE yielded a 1.5-2x speedup over the old code due to various optimizations.
Re:Faster arithmetic by flipping signs by lawlessone on Friday May 10, 2019 @07:18AM (#19876738)
Does this work with GLSL?
Re:Faster arithmetic by flipping signs by Asooka on Friday May 10, 2019 @08:41AM (#19877151)
You'll need to examine the binary generated for a particular architecture by the driver. It may work on one driver+GPU combination, but be slower on another. Also, the semantics for floating-point math are somewhat looser in GLSL so the driver is given more power to reorder expressions and might exploit this trick on its own. As usual, you should profile and benchmark.
Re:Faster arithmetic by flipping signs by jamewatson on Friday May 10, 2019 @05:15AM (#19876254)
That's a nice little optimisation! Would you mind sharing the aarch64 assembly from before and after applying the optimisation? It would be good to know the compiler flags used too :)
Re:Faster arithmetic by flipping signs by filleokus on Friday May 10, 2019 @07:44AM (#19876841)
OT, but, this account seems to be reposting comments from the original article as HN comments. I wonder if it's automatic or manual. Regardless, it doesn't really seem to work (-6 karma as per the writing of this comment).
Re:Faster arithmetic by flipping signs by pfortuny on Friday May 10, 2019 @08:10AM (#19876973)
Possibly someone playing with that AI text generation software whose name I forget. Looks similar.