From 851df20225593b10e698a760ac3cd5243620700b Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 12 Nov 2014 14:05:46 -0800 Subject: ART: Multiview assembler_test, fix x86-64 assembler Expose "secondary" names for registers so it is possible to test 32b views for 64b architectures. Add floating-point register testing. Refactor assembler_test for better code reuse (and simpler adding of combination drivers). Fix movss, movsd (MR instead of RM encoding), xchgl, xchgq, both versions of EmitGenericShift. Tighten imull(Reg,Imm), imulq(Reg,Imm), xchgl and xchgq encoding. Clarify cv*** variants with a comment. Add tests for movl, addl, imull, imuli, mull, subl, cmpqi, cmpl, xorq (regs), xorl, movss, movsd, addss, addsd, subss, subsd, mulss, mulsd, divss, divsd, cvtsi2ss, cvtsi2sd, cvtss2si, cvtss2sd, cvtsd2si, cvttss2si, cvttsd2si, cvtsd2ss, cvtdq2pd, comiss, comisd, sqrtss, sqrtsd, xorps, xorpd, fincstp, fsin, fcos, fptan, xchgl (disabled, see code comment), xchgq, testl, andl, andq, orl, orq, shll, shrl, sarl, negq, negl, notq, notl, enter and leave, call, ret, and jmp, and make some older ones more exhaustive. Follow-up TODOs: 1) Support memory (Address). 2) Support tertiary and quaternary register views. Bug: 18117217 Change-Id: I1d583a3bec552e3cc7c315925e1e006f393ab687 --- runtime/utils.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'runtime/utils.h') diff --git a/runtime/utils.h b/runtime/utils.h index 669fe6cd06..a0082c462a 100644 --- a/runtime/utils.h +++ b/runtime/utils.h @@ -115,6 +115,20 @@ static inline bool IsInt(int N, intptr_t value) { return (-limit <= value) && (value < limit); } +static inline bool IsInt32(int N, int32_t value) { + CHECK_LT(0, N); + CHECK_LT(static_cast(N), 8 * sizeof(int32_t)); + int32_t limit = static_cast(1) << (N - 1); + return (-limit <= value) && (value < limit); +} + +static inline bool IsInt64(int N, int64_t value) { + CHECK_LT(0, N); + CHECK_LT(static_cast(N), 8 * sizeof(int64_t)); + int64_t limit = static_cast(1) << (N - 1); + return (-limit <= value) && (value < limit); +} + static inline bool IsUint(int N, intptr_t value) { CHECK_LT(0, N); CHECK_LT(N, kBitsPerIntPtrT); -- cgit v1.2.3