On 06/22/11 12:18, nathan binkert wrote: >> ... but just to be clear, I'm saying let's keep readBytes/writeBytes >> as the official ExecContext interface, but provide global templates >> that map basic data types like uint64_t to those functions as a >> convenience for when they can be used (but these templates can be >> bypassed when appropriate). Then we can hide the byte swapping and >> tracing goop inside those templates in the typical case. > The write templates in AtomicSimpleCPU and base_dyn_inst are > different. I don't see how they become global. Also, I think that > the the need to have many specializations of read and write stems from > the improper implementation of those templates. (base_dyn_inst) > doesn't need specializations. It should be possible for us to write > the templates for read/write in such a way that they only need to know > the ISA (endianness).
You need to know the type for two reasons, one so you don't have to figure out at run time how much to swap, and two so that you know how to swap it beyond just how big it is. We have those twin types for SPARC which don't just get reversed, they get element-wise reversed. Other types might have arbitrary rules for switching endianness. > Nate > _______________________________________________ > gem5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/gem5-dev _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
