Changeset 218519 in webkit
- Timestamp:
- Jun 19, 2017 5:50:23 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r218512 r218519 1 2017-06-19 Caio Lima <ticaiolima@gmail.com> 2 3 [ARMv6][DFG] ARM MacroAssembler is always emitting cmn when immediate is 0 4 https://bugs.webkit.org/show_bug.cgi?id=172972 5 6 Reviewed by Mark Lam. 7 8 We are changing internalCompare32 implementation in ARM 9 MacroAssembler to emit "cmp" when the "right.value" is 0. 10 It is generating wrong comparison cases, since the 11 semantics of cmn is opposite of cmp[1]. One case that it's breaking is 12 "branch32(MacroAssembler::Above, gpr, TrustedImm32(0))", where ends 13 resulting in following assembly code: 14 15 ``` 16 cmn $r0, #0 17 bhi <address> 18 ``` 19 20 However, as cmn is similar to "adds", it will never take the branch 21 when $r0 > 0. In that case, the correct opcode is "cmp". With this 22 patch we will fix current broken tests that uses 23 "branch32(MacroAssembler::Above, gpr, TrustedImm32(0))", 24 such as ForwardVarargs, Spread and GetRestLength. 25 26 [1] - http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Cihiddid.html 27 28 * assembler/MacroAssemblerARM.h: 29 (JSC::MacroAssemblerARM::internalCompare32): 30 1 31 2017-06-19 Joseph Pecoraro <pecoraro@apple.com> 2 32 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
r217756 r218519 1601 1601 void internalCompare32(RegisterID left, TrustedImm32 right) 1602 1602 { 1603 ARMWord tmp = ( static_cast<unsigned>(right.m_value) == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value);1603 ARMWord tmp = (!right.value || static_cast<unsigned>(right.m_value) == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value); 1604 1604 if (tmp != ARMAssembler::InvalidImmediate) 1605 1605 m_assembler.cmn(left, tmp); … … 1610 1610 void internalCompare32(Address left, TrustedImm32 right) 1611 1611 { 1612 ARMWord tmp = ( static_cast<unsigned>(right.m_value) == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value);1612 ARMWord tmp = (!right.value || static_cast<unsigned>(right.m_value) == 0x80000000) ? ARMAssembler::InvalidImmediate : m_assembler.getOp2(-right.m_value); 1613 1613 load32(left, ARMRegisters::S1); 1614 1614 if (tmp != ARMAssembler::InvalidImmediate)
Note: See TracChangeset
for help on using the changeset viewer.