Skip to content
Permalink
Browse files
[aarch64] moveConditionally32(), moveConditionallyTest32() should mov…
…e from/to 64-bit registers

https://bugs.webkit.org/show_bug.cgi?id=170891

Reviewed by Saam Barati.

moveConditionally32() and moveConditionallyTest32() operations in
MacroAssemblerARM64 properly perform comparisons and tests on 32-bit
values, but end up performing the moves from and to 32-bit registers.

Move operations should instead be done on 64-bit registers, just like
on the X86_64 platform. This is achieved by specifying 64 as the data
size for the csel instructions.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::moveConditionally32):
(JSC::MacroAssemblerARM64::moveConditionallyTest32):


Canonical link: https://commits.webkit.org/188135@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
zdobersek committed Apr 25, 2017
1 parent ba2b92c commit 6c2077982a46634a3e6d357545b943c4e1f6207a
Showing 2 changed files with 24 additions and 5 deletions.
@@ -1,3 +1,22 @@
2017-04-25 Zan Dobersek <zdobersek@igalia.com>

[aarch64] moveConditionally32(), moveConditionallyTest32() should move from/to 64-bit registers
https://bugs.webkit.org/show_bug.cgi?id=170891

Reviewed by Saam Barati.

moveConditionally32() and moveConditionallyTest32() operations in
MacroAssemblerARM64 properly perform comparisons and tests on 32-bit
values, but end up performing the moves from and to 32-bit registers.

Move operations should instead be done on 64-bit registers, just like
on the X86_64 platform. This is achieved by specifying 64 as the data
size for the csel instructions.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::moveConditionally32):
(JSC::MacroAssemblerARM64::moveConditionallyTest32):

2017-04-24 Joseph Pecoraro <pecoraro@apple.com>

test262: test262/test/language/expressions/object/method-definition/early-errors-object-method-duplicate-parameters.js
@@ -2233,13 +2233,13 @@ class MacroAssemblerARM64 : public AbstractMacroAssembler<ARM64Assembler, MacroA
void moveConditionally32(RelationalCondition cond, RegisterID left, RegisterID right, RegisterID src, RegisterID dest)
{
m_assembler.cmp<32>(left, right);
m_assembler.csel<32>(dest, src, dest, ARM64Condition(cond));
m_assembler.csel<64>(dest, src, dest, ARM64Condition(cond));
}

void moveConditionally32(RelationalCondition cond, RegisterID left, RegisterID right, RegisterID thenCase, RegisterID elseCase, RegisterID dest)
{
m_assembler.cmp<32>(left, right);
m_assembler.csel<32>(dest, thenCase, elseCase, ARM64Condition(cond));
m_assembler.csel<64>(dest, thenCase, elseCase, ARM64Condition(cond));
}

void moveConditionally32(RelationalCondition cond, RegisterID left, TrustedImm32 right, RegisterID thenCase, RegisterID elseCase, RegisterID dest)
@@ -2297,19 +2297,19 @@ class MacroAssemblerARM64 : public AbstractMacroAssembler<ARM64Assembler, MacroA
void moveConditionallyTest32(ResultCondition cond, RegisterID testReg, RegisterID mask, RegisterID src, RegisterID dest)
{
m_assembler.tst<32>(testReg, mask);
m_assembler.csel<32>(dest, src, dest, ARM64Condition(cond));
m_assembler.csel<64>(dest, src, dest, ARM64Condition(cond));
}

void moveConditionallyTest32(ResultCondition cond, RegisterID left, RegisterID right, RegisterID thenCase, RegisterID elseCase, RegisterID dest)
{
m_assembler.tst<32>(left, right);
m_assembler.csel<32>(dest, thenCase, elseCase, ARM64Condition(cond));
m_assembler.csel<64>(dest, thenCase, elseCase, ARM64Condition(cond));
}

void moveConditionallyTest32(ResultCondition cond, RegisterID left, TrustedImm32 right, RegisterID thenCase, RegisterID elseCase, RegisterID dest)
{
test32(left, right);
m_assembler.csel<32>(dest, thenCase, elseCase, ARM64Condition(cond));
m_assembler.csel<64>(dest, thenCase, elseCase, ARM64Condition(cond));
}

void moveConditionallyTest64(ResultCondition cond, RegisterID testReg, RegisterID mask, RegisterID src, RegisterID dest)

0 comments on commit 6c20779

Please sign in to comment.