Hi Gabor, In short, yes, definitely, these should be going through the MacroAssembler – this code predates the introduction of the MacroAssembler interface, and hasn't been brought up to date. It largely hasn't been touched since there hasn't been a need to do so yet (and I find layers of abstraction tend to be developed best where there is actually something to usefully abstract :-) ). I would imaging that interface for floating-point math would be very similar to the integer math API, something like: void add32(RegisterID src, RegisterID dest) void load32(ImplicitAddress address, RegisterID dest) void store32(ImplicitAddress address, RegisterID dest) void addDouble(FPRegisterID src, FPRegisterID dest) void loadDouble(ImplicitAddress address, FPRegisterID dest) void storeDouble(ImplicitAddress address, FPRegisterID dest) We may need put a little thought into how this will extend to cover vector operations (on x86 these operate on the same register set as floating-point, this may not be true for all platforms). As I think you may well be aware, there is currently a lot of work on our number representation going on in the nitro-extreme branch of svn; I know there has been discussion of abstracting FP through the MacroAssembler before that lands. cheers, G. On May 14, 2009, at 8:08 AM, Gabor Loki wrote:
Hi,
I was wondering why JITArithmetic.cpp uses so many functions from X86Assembler. This should not be happened. MacroAssembler was introduced to be the 'common interface' for every back ends (not only for x86). Am I right?
For example: In 'emit_op_rshift' function
http://trac.webkit.org/browser/trunk/JavaScriptCore/jit/JITArithmetic.cpp#L1...
121#if USE(ALTERNATE_JSIMMEDIATE) 122 addSlowCase(emitJumpIfNotImmediateNumber(regT0)); 123 __ movq_rr(regT0, X86::xmm0); 124#else 125 emitJumpSlowCaseIfNotJSCell(regT0, op1); 126 addSlowCase(checkStructure(regT0, m_globalData-
numberStructure.get()));
127 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), regT0, X86::xmm0); ******************* 128#endif
IMHO, if a platform specific solution have to be used, creates a separate file which will contain those solutions/optimizations.
What do you think about this issue?
--Gabor
_______________________________________________ squirrelfish-dev mailing list squirrelfish-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/squirrelfish-dev