Ignore:
Timestamp:
May 15, 2009, 2:11:10 PM (16 years ago)
Author:
[email protected]
Message:

2009-05-15 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

Add FP support to the MacroAssembler, port JITArithmetic over to make use of this. Also add
API to determine whether FP support is available 'MacroAssembler::supportsFloatingPoint()',
FP is presently only supported on SSE2 platforms, not x87. On platforms where a suitable
hardware FPU is not available 'supportsFloatingPoint()' may simply return false, and all
other methods ASSERT_NOT_REACHED().

  • assembler/AbstractMacroAssembler.h:
  • assembler/MacroAssemblerX86.h: (JSC::MacroAssemblerX86::MacroAssemblerX86): (JSC::MacroAssemblerX86::branch32): (JSC::MacroAssemblerX86::branchPtrWithPatch): (JSC::MacroAssemblerX86::supportsFloatingPoint):
  • assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::): (JSC::MacroAssemblerX86Common::loadDouble): (JSC::MacroAssemblerX86Common::storeDouble): (JSC::MacroAssemblerX86Common::addDouble): (JSC::MacroAssemblerX86Common::subDouble): (JSC::MacroAssemblerX86Common::mulDouble): (JSC::MacroAssemblerX86Common::convertInt32ToDouble): (JSC::MacroAssemblerX86Common::branchDouble): (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32): (JSC::MacroAssemblerX86Common::branch32): (JSC::MacroAssemblerX86Common::branch16): (JSC::MacroAssemblerX86Common::branchTest32): (JSC::MacroAssemblerX86Common::branchAdd32): (JSC::MacroAssemblerX86Common::branchMul32): (JSC::MacroAssemblerX86Common::branchSub32): (JSC::MacroAssemblerX86Common::set32): (JSC::MacroAssemblerX86Common::setTest32): (JSC::MacroAssemblerX86Common::x86Condition): (JSC::MacroAssemblerX86Common::isSSE2Present):
  • assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::movePtrToDouble): (JSC::MacroAssemblerX86_64::moveDoubleToPtr): (JSC::MacroAssemblerX86_64::setPtr): (JSC::MacroAssemblerX86_64::branchPtr): (JSC::MacroAssemblerX86_64::branchTestPtr): (JSC::MacroAssemblerX86_64::branchAddPtr): (JSC::MacroAssemblerX86_64::branchSubPtr): (JSC::MacroAssemblerX86_64::supportsFloatingPoint):
  • assembler/X86Assembler.h:
  • jit/JIT.cpp: (JSC::JIT::JIT):
  • jit/JIT.h:
  • jit/JITArithmetic.cpp: (JSC::JIT::emit_op_rshift): (JSC::JIT::emitSlow_op_rshift): (JSC::JIT::emitSlow_op_jnless): (JSC::JIT::emitSlow_op_jnlesseq): (JSC::JIT::compileBinaryArithOp): (JSC::JIT::compileBinaryArithOpSlowCase): (JSC::JIT::emit_op_add): (JSC::JIT::emitSlow_op_add): (JSC::JIT::emit_op_mul): (JSC::JIT::emitSlow_op_mul):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompilePutByIdTransition):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/MacroAssemblerX86.h

    r43619 r43781  
    3737class MacroAssemblerX86 : public MacroAssemblerX86Common {
    3838public:
     39    MacroAssemblerX86()
     40        : m_isSSE2Present(isSSE2Present())
     41    {
     42    }
     43
    3944    static const Scale ScalePtr = TimesFour;
    4045
     
    96101    {
    97102        m_assembler.cmpl_rm(right, left.m_ptr);
    98         return Jump(m_assembler.jCC(cond));
     103        return Jump(m_assembler.jCC(x86Condition(cond)));
    99104    }
    100105
     
    102107    {
    103108        m_assembler.cmpl_im(right.m_value, left.m_ptr);
    104         return Jump(m_assembler.jCC(cond));
     109        return Jump(m_assembler.jCC(x86Condition(cond)));
    105110    }
    106111
     
    125130        m_assembler.cmpl_ir_force32(initialRightValue.asIntptr(), left);
    126131        dataLabel = DataLabelPtr(this);
    127         return Jump(m_assembler.jCC(cond));
     132        return Jump(m_assembler.jCC(x86Condition(cond)));
    128133    }
    129134
     
    132137        m_assembler.cmpl_im_force32(initialRightValue.asIntptr(), left.offset, left.base);
    133138        dataLabel = DataLabelPtr(this);
    134         return Jump(m_assembler.jCC(cond));
     139        return Jump(m_assembler.jCC(x86Condition(cond)));
    135140    }
    136141
     
    140145        return DataLabelPtr(this);
    141146    }
     147
     148    bool supportsFloatingPoint() const { return m_isSSE2Present; }
     149
     150private:
     151    const bool m_isSSE2Present;
    142152};
    143153
Note: See TracChangeset for help on using the changeset viewer.