Changeset 50593 in webkit for trunk/JavaScriptCore/assembler
- Timestamp:
- Nov 5, 2009, 11:28:56 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/assembler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/assembler/ARMAssembler.h
r50553 r50593 134 134 BL = 0x0b000000, 135 135 FMSR = 0x0e000a10, 136 FMRS = 0x0e100a10, 136 137 FSITOD = 0x0eb80bc0, 138 FTOSID = 0x0ebd0b40, 137 139 FMSTAT = 0x0ef1fa10, 138 140 #if ARM_ARCH_VERSION >= 5 … … 503 505 } 504 506 507 void fmrs_r(int dd, int rn, Condition cc = AL) 508 { 509 emitInst(static_cast<ARMWord>(cc) | FMRS, rn, dd, 0); 510 } 511 505 512 void fsitod_r(int dd, int dm, Condition cc = AL) 506 513 { 507 514 emitInst(static_cast<ARMWord>(cc) | FSITOD, dd, 0, dm); 515 } 516 517 void ftosid_r(int fd, int dm, Condition cc = AL) 518 { 519 emitInst(static_cast<ARMWord>(cc) | FTOSID, fd, 0, dm); 508 520 } 509 521 -
trunk/JavaScriptCore/assembler/MacroAssemblerARM.h
r50531 r50593 39 39 40 40 class MacroAssemblerARM : public AbstractMacroAssembler<ARMAssembler> { 41 static const int DoubleConditionMask = 0x0f; 42 static const int DoubleConditionBitSpecial = 0x10; 43 COMPILE_ASSERT(!(DoubleConditionBitSpecial & DoubleConditionMask), DoubleConditionBitSpecial_should_not_interfere_with_ARMAssembler_Condition_codes); 41 44 public: 42 45 enum Condition { … … 58 61 59 62 enum DoubleCondition { 60 DoubleEqualOrUnordered = ARMAssembler::EQ, 63 // These conditions will only evaluate to true if the comparison is ordered - i.e. neither operand is NaN. 64 DoubleEqual = ARMAssembler::EQ, 65 DoubleNotEqual = ARMAssembler::NE | DoubleConditionBitSpecial, 61 66 DoubleGreaterThan = ARMAssembler::GT, 62 67 DoubleGreaterThanOrEqual = ARMAssembler::GE, 68 DoubleLessThan = ARMAssembler::CC, 69 DoubleLessThanOrEqual = ARMAssembler::LS, 70 // If either operand is NaN, these conditions always evaluate to true. 71 DoubleEqualOrUnordered = ARMAssembler::EQ | DoubleConditionBitSpecial, 72 DoubleNotEqualOrUnordered = ARMAssembler::NE, 73 DoubleGreaterThanOrUnordered = ARMAssembler::HI, 74 DoubleGreaterThanOrEqualOrUnordered = ARMAssembler::CS, 63 75 DoubleLessThanOrUnordered = ARMAssembler::LT, 64 76 DoubleLessThanOrEqualOrUnordered = ARMAssembler::LE, … … 715 727 m_assembler.fcmpd_r(left, right); 716 728 m_assembler.fmstat(); 717 return Jump(m_assembler.jmp(static_cast<ARMAssembler::Condition>(cond))); 729 if (cond & DoubleConditionBitSpecial) 730 m_assembler.cmp_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::VS); 731 return Jump(m_assembler.jmp(static_cast<ARMAssembler::Condition>(cond & ~DoubleConditionMask))); 718 732 } 719 733 … … 728 742 ASSERT_NOT_REACHED(); 729 743 return jump(); 744 } 745 746 // Convert 'src' to an integer, and places the resulting 'dest'. 747 // If the result is not representable as a 32 bit value, branch. 748 // May also branch for some values that are representable in 32 bits 749 // (specifically, in this case, 0). 750 void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp) 751 { 752 m_assembler.ftosid_r(src, ARMRegisters::SD0); 753 m_assembler.fmrs_r(ARMRegisters::SD0, dest); 754 755 // Convert the integer result back to float & compare to the original value - if not equal or unordered (NaN) then jump. 756 m_assembler.fsitod_r(ARMRegisters::SD0, ARMRegisters::SD0); 757 failureCases.append(branchDouble(DoubleNotEqual, src, ARMRegisters::SD0)); 758 759 // If the result is zero, it might have been -0.0, and 0.0 equals to -0.0 760 failureCases.append(branchTest32(Zero, dest)); 730 761 } 731 762
Note:
See TracChangeset
for help on using the changeset viewer.