Posted (June 20, 2011, 7:18 a.m.)
-
src/arch/alpha/isa/mem.isa (Diff revision 1) -
I have a couple of issues: 1) Where did the byte swapping come from? I don't see it elsewhere. 2) We've never used typeof before. Should we start? In the future (c++0x), we'll have auto, but typeof is nonstandard. Would it be bad to do the following? Mem = htog(Mem) and then just use Mem as the parameter to that function? Updating in place could of course be sketchy if the value is not ephemeral. If it is, could we not simply use: uint%(mem_acc_size)d_t gMem = htog(Mem); There are other options involving templates too.
Posted (July 1, 2011, 4:23 a.m.)
Having a new, separate header for each ISA that does nothing but import the helpers from GenericISA into the specific ISA namespace seems overly complicated... do they really need to be in the ISA namespace to be used in the ISA definitions? Would it be so bad to just have these outside of a namespace in a header somewhere that just gets included directly where needed? Other than that admittedly nitpicky complaint, this looks great to me.
Thanks! This seems less convoluted. As you mentioned before, since the x86 versions have different type signatures you could throw all the helper functions in a single file (though if you do that I would definitely make the x86 getMem() more symmetric by making it a void function and returning the data via a reference param), but unless/until the unlikely event that we have another ISA that needs those helpers this seems fine to me.
