>>nerd sniped I honestly don't know anything about this stuff, but the title is awesome.
I got nerd sniped into benchmarking legacy x86 instructions (2019)
21–30 of 47 posts
Re: I got nerd sniped into benchmarking legacy x86 instructions (2019)
#22>>nerd sniped I honestly don't know anything about this stuff, but the title is awesome.
Re: I got nerd sniped into benchmarking legacy x86 instructions (2019)
#23> The meme is wrong The third panel is generally meant to be the correct technical answer, while the last panel is reserved for the punchline. Understanding the 'galaxy brain' format might have saved the author the trouble (or at least guided proper expectations), although it was a cool exercise.
I always thought of the last panel as an initially silly-sounding answer that could still be considered correct in some unexpected way. In this case it fits, because if you compile with `-Os`, xlatb is probably the ideal output. I doubt llvm can output xlatb, but I'd be pleasantly surprised if it could
If space efficiency (or fitting in cache) are important, then this instruction being more compact but having worse execution performance could be a good tradeoff!
Re: I got nerd sniped into benchmarking legacy x86 instructions (2019)
#24Would someone mind explaining what all the assembly instructions in the meme do? In particular I'm wondering why you would do xor rcx, rcx when that result is always 0
(Neighbor’s got it, and I am as unsure of contemporary relevance as they are.)
Re: I got nerd sniped into benchmarking legacy x86 instructions (2019)
#25xlatb is looking better here. There are also some front end concerns that may favor xlatb, in particular if it's friendlier to the decoder. xlat is also fewer muops, taking less of the muop cache once decoded.
Re: I got nerd sniped into benchmarking legacy x86 instructions (2019)
#26> The meme is wrong The third panel is generally meant to be the correct technical answer, while the last panel is reserved for the punchline. Understanding the 'galaxy brain' format might have saved the author the trouble (or at least guided proper expectations), although it was a cool exercise.
Re: I got nerd sniped into benchmarking legacy x86 instructions (2019)
#27Would someone mind explaining what all the assembly instructions in the meme do? In particular I'm wondering why you would do xor rcx, rcx when that result is always 0
> why you would do xor rcx, rcx when that result is always 0 It's an idiomatic way to populate a register with the value zero. Not sure if it's still true, but IIRC it took fewer cycles than the more obvious "load #0 into $rcx" instruction.
48 31 c9 xor rcx,rcx
48 c7 c1 00 00 00 00 mov rcx,0x0
(This is even shorter: 31 c9 xor ecx,ecx
)Re: I got nerd sniped into benchmarking legacy x86 instructions (2019)
#28>>nerd sniped I honestly don't know anything about this stuff, but the title is awesome.
Re: I got nerd sniped into benchmarking legacy x86 instructions (2019)
#29Sometimes it's not about being faster, sometimes it's about taking up less space. The graphic doesn't say what it's aiming for, and based on what I see in the graphic, the 4th panel seems to take up the least space.