diff options
author | 2015-07-30 15:07:22 +0100 | |
---|---|---|
committer | 2015-09-01 10:10:37 +0100 | |
commit | 73cf0fb75de2a449ce4fe329b5f1fb42eef1372f (patch) | |
tree | d5b0957414c355254babfcd1a797ce87a0eb85a2 /compiler/utils/arm/assembler_arm32.h | |
parent | 9ee5d6cdc14ac94b64ea1961bf221bad48746929 (diff) |
ART: Add 16-bit Thumb2 ROR, NEGS and CMP for high registers.
Also clean up the usage of set_cc flag. Define a SetCc
enumeration that specifies whether to set or keep condition
codes or whether we don't care and a 16-bit instruction
should be selected if one exists.
This reduces the size of Nexus 5 boot.oat by 44KiB (when
compiled with Optimizing which is not the default yet).
Change-Id: I047072dc197ea678bf2019c01bcb28943fa9b604
Diffstat (limited to 'compiler/utils/arm/assembler_arm32.h')
-rw-r--r-- | compiler/utils/arm/assembler_arm32.h | 83 |
1 files changed, 44 insertions, 39 deletions
diff --git a/compiler/utils/arm/assembler_arm32.h b/compiler/utils/arm/assembler_arm32.h index 1c38eec12c..b96bb74182 100644 --- a/compiler/utils/arm/assembler_arm32.h +++ b/compiler/utils/arm/assembler_arm32.h @@ -39,25 +39,29 @@ class Arm32Assembler FINAL : public ArmAssembler { } // Data-processing instructions. - void and_(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void and_(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void eor(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void eor(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void sub(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; - void subs(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void sub(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void rsb(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; - void rsbs(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void rsb(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void add(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void add(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void adds(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void adc(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void adc(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void sbc(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void sbc(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; - - void rsc(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void rsc(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; void tst(Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; @@ -67,16 +71,17 @@ class Arm32Assembler FINAL : public ArmAssembler { void cmn(Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; - void orr(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; - void orrs(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void orr(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void mov(Register rd, const ShifterOperand& so, Condition cond = AL) OVERRIDE; - void movs(Register rd, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void mov(Register rd, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void bic(Register rd, Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void bic(Register rd, Register rn, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; - void mvn(Register rd, const ShifterOperand& so, Condition cond = AL) OVERRIDE; - void mvns(Register rd, const ShifterOperand& so, Condition cond = AL) OVERRIDE; + virtual void mvn(Register rd, const ShifterOperand& so, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; // Miscellaneous data-processing instructions. void clz(Register rd, Register rm, Condition cond = AL) OVERRIDE; @@ -204,25 +209,25 @@ class Arm32Assembler FINAL : public ArmAssembler { void bl(Label* label, Condition cond = AL) OVERRIDE; void blx(Register rm, Condition cond = AL) OVERRIDE; void bx(Register rm, Condition cond = AL) OVERRIDE; - void Lsl(Register rd, Register rm, uint32_t shift_imm, bool setcc = false, - Condition cond = AL) OVERRIDE; - void Lsr(Register rd, Register rm, uint32_t shift_imm, bool setcc = false, - Condition cond = AL) OVERRIDE; - void Asr(Register rd, Register rm, uint32_t shift_imm, bool setcc = false, - Condition cond = AL) OVERRIDE; - void Ror(Register rd, Register rm, uint32_t shift_imm, bool setcc = false, - Condition cond = AL) OVERRIDE; - void Rrx(Register rd, Register rm, bool setcc = false, - Condition cond = AL) OVERRIDE; - - void Lsl(Register rd, Register rm, Register rn, bool setcc = false, - Condition cond = AL) OVERRIDE; - void Lsr(Register rd, Register rm, Register rn, bool setcc = false, - Condition cond = AL) OVERRIDE; - void Asr(Register rd, Register rm, Register rn, bool setcc = false, - Condition cond = AL) OVERRIDE; - void Ror(Register rd, Register rm, Register rn, bool setcc = false, - Condition cond = AL) OVERRIDE; + virtual void Lsl(Register rd, Register rm, uint32_t shift_imm, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; + virtual void Lsr(Register rd, Register rm, uint32_t shift_imm, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; + virtual void Asr(Register rd, Register rm, uint32_t shift_imm, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; + virtual void Ror(Register rd, Register rm, uint32_t shift_imm, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; + virtual void Rrx(Register rd, Register rm, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; + + virtual void Lsl(Register rd, Register rm, Register rn, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; + virtual void Lsr(Register rd, Register rm, Register rn, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; + virtual void Asr(Register rd, Register rm, Register rn, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; + virtual void Ror(Register rd, Register rm, Register rn, + Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE; void Push(Register rd, Condition cond = AL) OVERRIDE; void Pop(Register rd, Condition cond = AL) OVERRIDE; @@ -305,7 +310,7 @@ class Arm32Assembler FINAL : public ArmAssembler { void EmitType01(Condition cond, int type, Opcode opcode, - int set_cc, + SetCc set_cc, Register rn, Register rd, const ShifterOperand& so); |