5 ms·
As an engineer who has spent thousands of hours programming SIMD assembly -- using them as buffers which can then be operated upon in batch is literally the ent
by emerged 9y ago
As an engineer who has spent thousands of hours programming SIMD assembly -- using them as buffers which can then be operated upon in batch is literally the entire reason they exist.
So this reads to me as a programmer who isn't familiar with SIMD discovering one small part of why it exists and then writing an article about that as if it was a new idea outside the scope of normal SIMD usage.
It's nice that this may give exposure into some low level details to those unfamiliar, but it isn't an innovation.
- emily-c 9y agoInnovation? That's quite a stretch. Using them together as a contiguous buffer is the not the reason they exist. Not quite sure how you took the article like you did but I have added some extra clarification that this is /not/ how they were designed to be used as well as another example.
- emerged 9y agoOf course they are. You load the registers with data from RAM. You permute the entire array and/or insert/extract individual elements. They are in fundamental nature a contiguous array. Most often you are literally loading them with a contiguous array from memory so you can work with it more efficiently before writing it back to memory. Downvote me as much as you want for saying so but it is the literal reason why the registers and instructions exist.
- joshAg 9y agoAren't they designed specifically for SIMD instructions though? This seems to be more just using them as another cache layer and not using them for their intended-SIMD use.
- emerged 9y agoI'm baffled by the downvotes that I'm receiving / why this is a controversial opinion. When you program SIMD, the registers are literally a temporary cache so that you can work with the data without touching RAM. The instructions are designed to load/store/manipulate these cached buffers. I didn't mean any offense to OP, if that's the cause for bad response. I've been using these instructions for well over a decade and the description given is without exaggeration the precise reason they exist and is what I've always used them for.
- joshAg 9y agoOk, I'll try to explain it since you replied to me, even though I didn't downvote you. The purpose of XMM buffers is for SIMD instructions, which implies that the buffers store multiple atoms and does the same instruction on each atom in the buffer at once. This interesting bit of this little hack is how it breaks that expected data level parallelism and instead provides a (relatively) high-level interface for the new usage. It has nothing to do with shuffling data to and from those registers. You're getting downvoted because your initial comment ignored the bit that used the registers in a way that wasn't intended and focused on the bits that were the same as the intended usage. And then you're being condescending about the points you're trying to make. You might not have intended to be condescending, but you are being condescending nonetheless.
- emerged 9y agoYou know what at this point I have no incentive to further engage since my attempt to elucidate was also downvoted. Each post that I submit is a further cost. Such a silly game. Let those who havent worked with SIMD reject an authentic attempt from a vet to elucidate err and be happy with that click. Whatever. If you can drain my remaining few hundred karma I'll have an excuse to stop clicking another Bitcoin rehash article every day and will thank you.
- joshAg 9y agoI suggest optimizing for understanding over hacker news karma points, but to each their own. You're not being downvoted for a technical issue.
- emerged 9y agoI'm clearly not optimizing for karma since I literally have invited downvotes at this point. I'm accepting the karmatic expense of making meta commentary.
- deleted 9y ago[deleted]
- slavik81 9y agoYou would be more convincing (and informative) if you were to include some examples and explanation of where this technique has been applied. An appeal to authority shouldn't be neccessary for the point you're making.