SimEng icon indicating copy to clipboard operation
SimEng copied to clipboard

Replace A64Instruction address/data vectors with arrays

Open hal-jones opened this issue 6 years ago • 0 comments

Generated addresses and memory data are currently held in vectors in A64Instruction. These should be replaced with arrays to reduce the number of expensive heap allocations.

Some memory-accessing instructions may generate disproportionately more addresses than the average, i.e. a 2048-bit SVE gather/scatter byte instruction may generate 256 individual memory accesses. To account for this, a "local-first" system similar to the one used by the RegisterValue class may be more appropriate: a suitably small array (2-4) is reserved for addresses, falling back to a vector when too many addresses are needed. This allows for increased performance for common, simpler memory instructions, while still permitting more complex ones.

Profiling with a test implementation using purely fixed arrays suggests that this improvement should result in a 10-15% performance increase for memory-intensive programs.

hal-jones avatar May 13 '19 14:05 hal-jones