OSDN Git Service

ART: Special-case cb(n)z even for in-reg constant
authorAndreas Gampe <agampe@google.com>
Sat, 26 Jul 2014 08:40:39 +0000 (01:40 -0700)
committerAndreas Gampe <agampe@google.com>
Sat, 26 Jul 2014 08:40:39 +0000 (01:40 -0700)
commitb07c1f9f4d6088ca2d4c1a10819e57b19acf7f22
tree2cc79731690f73a5f2b81ff1c643d8d503a8c9b2
parent3bcac48f23094fa0f46315a080ec47fc368fd4c2
ART: Special-case cb(n)z even for in-reg constant

Call out to OpCmpImmBranch in GenCompareAndBranch if the constant
is zero and we are testing == or !=, even when zero has been loaded
to a register already. This avoids a register size mismatch on 64b
architectures when basically doing a null check, and generally
squashes a cmp + branch to a cbz or cbnz on Arm and Mips. X86 is
not degraded.

Bug: 16562601
Change-Id: I1997760f43dc186a84247ad30ae91053f71d102d
compiler/dex/quick/gen_common.cc