Changeset 65993 in webkit for trunk/JavaScriptCore/assembler
- Timestamp:
- Aug 25, 2010, 12:52:16 AM (15 years ago)
- Location:
- trunk/JavaScriptCore/assembler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/assembler/ARMAssembler.h
r65303 r65993 162 162 VCVT_F64_S32 = 0x0eb80bc0, 163 163 VCVT_S32_F64 = 0x0ebd0b40, 164 VCVTR_S32_F64 = 0x0ebd0bc0, 164 165 VMRS_APSR = 0x0ef1fa10, 165 166 #if WTF_ARM_ARCH_AT_LEAST(5) … … 372 373 } 373 374 375 void cmn_r(int rn, ARMWord op2, Condition cc = AL) 376 { 377 emitInst(static_cast<ARMWord>(cc) | CMN | SET_CC, 0, rn, op2); 378 } 379 374 380 void orr_r(int rd, int rn, ARMWord op2, Condition cc = AL) 375 381 { … … 577 583 ASSERT(!(sd & 0x1)); // sd must be divisible by 2 578 584 emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VCVT_S32_F64, (sd >> 1), 0, dm); 585 } 586 587 void vcvtr_s32_f64_r(int sd, int dm, Condition cc = AL) 588 { 589 ASSERT(!(sd & 0x1)); // sd must be divisible by 2 590 emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VCVTR_S32_F64, (sd >> 1), 0, dm); 579 591 } 580 592 -
trunk/JavaScriptCore/assembler/MacroAssemblerARM.h
r65303 r65993 770 770 bool supportsFloatingPointTruncate() const 771 771 { 772 return false;772 return s_isVFPPresent; 773 773 } 774 774 … … 879 879 // If the result is not representable as a 32 bit value, branch. 880 880 // May also branch for some values that are representable in 32 bits 881 // (specifically, in this case, INT_MIN ).881 // (specifically, in this case, INT_MIN and INT_MAX). 882 882 Jump branchTruncateDoubleToInt32(FPRegisterID src, RegisterID dest) 883 883 { 884 UNUSED_PARAM(src); 885 UNUSED_PARAM(dest); 886 ASSERT_NOT_REACHED(); 887 return jump(); 884 m_assembler.vcvtr_s32_f64_r(ARMRegisters::SD0 << 1, src); 885 // If VCVTR.S32.F64 can't fit the result into a 32-bit 886 // integer, it saturates at INT_MAX or INT_MIN. Testing this is 887 // probably quicker than testing FPSCR for exception. 888 m_assembler.vmov_arm_r(dest, ARMRegisters::SD0 << 1); 889 m_assembler.sub_r(ARMRegisters::S0, dest, ARMAssembler::getOp2(0x80000000)); 890 m_assembler.cmn_r(ARMRegisters::S0, ARMAssembler::getOp2(1), ARMCondition(NotEqual)); 891 return Jump(m_assembler.jmp(ARMCondition(Equal))); 888 892 } 889 893
Note:
See TracChangeset
for help on using the changeset viewer.