summaryrefslogtreecommitdiffstats
path: root/runtime/utils.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-11-12 14:05:46 -0800
committerAndreas Gampe <agampe@google.com>2014-11-13 16:31:59 -0800
commit851df20225593b10e698a760ac3cd5243620700b (patch)
treee4414bc2fbad4e73785e3ef336ab2278d85aa496 /runtime/utils.h
parent3225b83903329ba7745f6785127e09ff040492cf (diff)
downloadart-851df20225593b10e698a760ac3cd5243620700b.tar.gz
art-851df20225593b10e698a760ac3cd5243620700b.tar.bz2
art-851df20225593b10e698a760ac3cd5243620700b.zip
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
Diffstat (limited to 'runtime/utils.h')
-rw-r--r--runtime/utils.h14
1 files changed, 14 insertions, 0 deletions
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<size_t>(N), 8 * sizeof(int32_t));
+ int32_t limit = static_cast<int32_t>(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<size_t>(N), 8 * sizeof(int64_t));
+ int64_t limit = static_cast<int64_t>(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);