3 ms·
Technically right now if they have AVX instructions my lifter screams at me and tells me to not be lazy and implement those instructions ;) However if I were t
by gamozolabs 8y ago
Technically right now if they have AVX instructions my lifter screams at me and tells me to not be lazy and implement those instructions ;)
However if I were to lift AVX instructions I would lift them to their scalar counterparts in my IL (eg. by emitting 16 32-bit operations). Lets say there are 16 `vpaddd`s in a row, thus creating a 16x16 matrix, when I lift it I'd lift these adds to 128 individual adds, and then generate 128 `vpaddd`s. While I'm doing 16x more the `vpaddd`s I'm also running 16x more VMs than the application originally had, thus it cancels out, and the net effect is that I'm still running `vpaddd`s as fast as the CPU can execute them. Technically in this case my stuff might even be faster as it's going to be 128 adds instead of 16, which means the CPU is running based on instruction throughput longer and decoding the same instruction and keeping latencies down.
However it's possible that this transposition of the matrix might increase dependencies between instructions or something of the sorts which might slow down performance.
That being said, AVX is pretty much only used for memory loads and stores in string operations in most programs anyways, so it doesn't matter much.