Made VGOFF_(helper_idiv_64_32) and all the similar helper offsets visible to
skins, so they can determine which helper is being called for CALLM
instructions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1415 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_include.h b/coregrind/vg_include.h
index a45f660..a17661c 100644
--- a/coregrind/vg_include.h
+++ b/coregrind/vg_include.h
@@ -1642,45 +1642,7 @@
 /* This thread's LDT pointer. */
 extern Int VGOFF_(ldt);
 
-/* Offsets of addresses of helper functions.  A "helper" function is
-   one which is called from generated code. */
-
-extern Int VGOFF_(helper_idiv_64_32);
-extern Int VGOFF_(helper_div_64_32);
-extern Int VGOFF_(helper_idiv_32_16);
-extern Int VGOFF_(helper_div_32_16);
-extern Int VGOFF_(helper_idiv_16_8);
-extern Int VGOFF_(helper_div_16_8);
-
-extern Int VGOFF_(helper_imul_32_64);
-extern Int VGOFF_(helper_mul_32_64);
-extern Int VGOFF_(helper_imul_16_32);
-extern Int VGOFF_(helper_mul_16_32);
-extern Int VGOFF_(helper_imul_8_16);
-extern Int VGOFF_(helper_mul_8_16);
-
-extern Int VGOFF_(helper_CLD);
-extern Int VGOFF_(helper_STD);
-extern Int VGOFF_(helper_get_dirflag);
-
-extern Int VGOFF_(helper_CLC);
-extern Int VGOFF_(helper_STC);
-
-extern Int VGOFF_(helper_shldl);
-extern Int VGOFF_(helper_shldw);
-extern Int VGOFF_(helper_shrdl);
-extern Int VGOFF_(helper_shrdw);
-
-extern Int VGOFF_(helper_RDTSC);
-extern Int VGOFF_(helper_CPUID);
-
-extern Int VGOFF_(helper_bsf);
-extern Int VGOFF_(helper_bsr);
-
-extern Int VGOFF_(helper_fstsw_AX);
-extern Int VGOFF_(helper_SAHF);
-extern Int VGOFF_(helper_DAS);
-extern Int VGOFF_(helper_DAA);
+/* Nb: Most helper offsets are in include/vg_skin.h, for use by skins */
 
 extern Int VGOFF_(helper_undefined_instruction);
 
diff --git a/include/vg_skin.h b/include/vg_skin.h
index 72c1392..638ee82 100644
--- a/include/vg_skin.h
+++ b/include/vg_skin.h
@@ -59,12 +59,15 @@
 /* Total number of integer registers available for allocation -- all of
    them except %esp, %ebp.  %ebp permanently points at VG_(baseBlock).
    
-   If you change this you'll have to also change at least these:
+   If you increase this you'll have to also change at least these:
      - VG_(rank_to_realreg)()
      - VG_(realreg_to_rank)()
      - ppRegsLiveness()
      - the RegsLive type (maybe -- RegsLive type must have more than
                           VG_MAX_REALREGS bits)
+
+   You can decrease it, and performance will drop because more spills will
+   occur.  If you decrease it too much, everything will fall over.
    
    Do not change this unless you really know what you are doing!  */
 #define VG_MAX_REALREGS 6
@@ -124,6 +127,7 @@
 const Int VG_(skin_interface_major_version) = VG_CORE_INTERFACE_MAJOR_VERSION; \
 const Int VG_(skin_interface_minor_version) = VG_CORE_INTERFACE_MINOR_VERSION;
 
+
 /*====================================================================*/
 /*=== Command-line options                                         ===*/
 /*====================================================================*/
@@ -717,6 +721,7 @@
 extern UInstr* VG_(get_instr)      (UCodeBlock* cb, Int i);
 extern UInstr* VG_(get_last_instr) (UCodeBlock* cb);
    
+
 /*====================================================================*/
 /*=== Instrumenting UCode                                          ===*/
 /*====================================================================*/
@@ -836,6 +841,49 @@
 extern void VG_(set_shadow_archreg)     ( UInt archreg, UInt val );
 extern Addr VG_(shadow_archreg_address) ( UInt archreg );
 
+
+/* ------------------------------------------------------------------ */
+/* Offsets of addresses of helper functions.  A "helper" function is one
+   which is called from generated code via CALLM. */
+
+extern Int VGOFF_(helper_idiv_64_32);
+extern Int VGOFF_(helper_div_64_32);
+extern Int VGOFF_(helper_idiv_32_16);
+extern Int VGOFF_(helper_div_32_16);
+extern Int VGOFF_(helper_idiv_16_8);
+extern Int VGOFF_(helper_div_16_8);
+
+extern Int VGOFF_(helper_imul_32_64);
+extern Int VGOFF_(helper_mul_32_64);
+extern Int VGOFF_(helper_imul_16_32);
+extern Int VGOFF_(helper_mul_16_32);
+extern Int VGOFF_(helper_imul_8_16);
+extern Int VGOFF_(helper_mul_8_16);
+
+extern Int VGOFF_(helper_CLD);
+extern Int VGOFF_(helper_STD);
+extern Int VGOFF_(helper_get_dirflag);
+
+extern Int VGOFF_(helper_CLC);
+extern Int VGOFF_(helper_STC);
+
+extern Int VGOFF_(helper_shldl);
+extern Int VGOFF_(helper_shldw);
+extern Int VGOFF_(helper_shrdl);
+extern Int VGOFF_(helper_shrdw);
+
+extern Int VGOFF_(helper_RDTSC);
+extern Int VGOFF_(helper_CPUID);
+
+extern Int VGOFF_(helper_bsf);
+extern Int VGOFF_(helper_bsr);
+
+extern Int VGOFF_(helper_fstsw_AX);
+extern Int VGOFF_(helper_SAHF);
+extern Int VGOFF_(helper_DAS);
+extern Int VGOFF_(helper_DAA);
+
+
 /*====================================================================*/
 /*=== Generating x86 code from UCode                               ===*/
 /*====================================================================*/
@@ -1002,6 +1050,7 @@
    indication of where they are. */
 extern Addr VG_(get_EIP)( ThreadState *tst );
 
+
 /*====================================================================*/
 /*=== Error reporting                                              ===*/
 /*====================================================================*/