Improve x86 long multiply and shifts
Generate inline code for long shifts by constants and do long
multiplication inline. Convert multiplication by a constant to a
shift when we can. Fix some x86 assembler problems and add the new
instructions that were needed (64 bit shifts).
Change-Id: I6237a31c36159096e399d40d01eb6bfa22ac2772
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h
index b59ec5e..b54bc7b 100644
--- a/compiler/dex/quick/mir_to_lir.h
+++ b/compiler/dex/quick/mir_to_lir.h
@@ -873,6 +873,29 @@
CompilationUnit* GetCompilationUnit() {
return cu_;
}
+ /*
+ * @brief Returns the index of the lowest set bit in 'x'.
+ * @param x Value to be examined.
+ * @returns The bit number of the lowest bit set in the value.
+ */
+ int32_t LowestSetBit(uint64_t x);
+ /*
+ * @brief Is this value a power of two?
+ * @param x Value to be examined.
+ * @returns 'true' if only 1 bit is set in the value.
+ */
+ bool IsPowerOfTwo(uint64_t x);
+ /*
+ * @brief Do these SRs overlap?
+ * @param rl_op1 One RegLocation
+ * @param rl_op2 The other RegLocation
+ * @return 'true' if the VR pairs overlap
+ *
+ * Check to see if a result pair has a misaligned overlap with an operand pair. This
+ * is not usual for dx to generate, but it is legal (for now). In a future rev of
+ * dex, we'll want to make this case illegal.
+ */
+ bool BadOverlap(RegLocation rl_op1, RegLocation rl_op2);
/*
* @brief Force a location (in a register) into a temporary register