if (__builtin_setjmp(env_sigill)) {
have_F = False;
} else {
- __asm__ __volatile__("fmr 0,0");
+ __asm__ __volatile__(".long 0xFC000090"); /*fmr 0,0 */
}
/* Altivec insns */
if (__builtin_setjmp(env_sigill)) {
have_FX = False;
} else {
- __asm__ __volatile__("fsqrt 0,0");
+ __asm__ __volatile__(".long 0xFC00002C"); /*fsqrt 0,0 */
}
/* Graphics optional (stfiwx, fres, frsqrte, fsel) */
if (__builtin_setjmp(env_sigill)) {
have_GX = False;
} else {
- __asm__ __volatile__("frsqrte 0,0");
+ __asm__ __volatile__(".long 0xFC000034"); /* frsqrte 0,0 */
}
r = VG_(sigaction)(VKI_SIGILL, &saved_act, NULL);
if (__builtin_setjmp(env_sigill)) {
have_V = False;
} else {
- __asm__ __volatile__("vor 0,0,0");
+ __asm__ __volatile__(".long 0x10000484"); /*vor 0,0,0*/
}
/* General-Purpose optional (fsqrt, fsqrts) */
if (__builtin_setjmp(env_sigill)) {
have_FX = False;
} else {
- __asm__ __volatile__("fsqrt 0,0");
+ __asm__ __volatile__(".long 0xFC00002C"); /*fsqrt 0,0*/
}
/* Graphics optional (stfiwx, fres, frsqrte, fsel) */
if (__builtin_setjmp(env_sigill)) {
have_GX = False;
} else {
- __asm__ __volatile__("frsqrte 0,0");
+ __asm__ __volatile__(".long 0xFC000034"); /*frsqrte 0,0*/
}
VG_(sigaction)(VKI_SIGILL, &saved_act, NULL);
// Given a pointer to a function as obtained by "& functionname" in C,
-// produce a pointer to the actual entry point for the function. For
-// most platforms it's the identity function. Unfortunately, on
-// ppc64-linux it isn't (sigh).
+// produce a pointer to the actual entry point for the function.
void* VG_(fnptr_to_fnentry)( void* f )
{
-#if defined(VGP_x86_linux)
- return f;
-#elif defined(VGP_amd64_linux)
- return f;
-#elif defined(VGP_ppc32_linux)
+#if defined(VGP_x86_linux) || defined(VGP_amd64_linux) \
+ || defined(VGP_ppc32_linux)
return f;
-#elif defined(VGP_ppc64_linux)
- /* f is a pointer to a 3-word function descriptor, of which
- the first word is the entry address. */
- /* Don't ask me. Really. I have no idea why. */
- ULong* descr = (ULong*)f;
+#elif defined(VGP_ppc64_linux) || defined(VGP_ppc32_aix5) \
+ || defined(VGP_ppc64_aix5)
+ /* All other ppc variants use the AIX scheme, in which f is a
+ pointer to a 3-word function descriptor, of which the first word
+ is the entry address. */
+ UWord* descr = (UWord*)f;
return (void*)(descr[0]);
#else
# error "Unknown platform"
#include "pub_tool_machine.h"
-#if defined(VGA_x86)
+#if defined(VGP_x86_linux)
# define VG_ELF_DATA2XXX ELFDATA2LSB
# define VG_ELF_MACHINE EM_386
# define VG_ELF_CLASS ELFCLASS32
-#elif defined(VGA_amd64)
+# undef VG_PLAT_USES_PPCTOC
+#elif defined(VGP_amd64_linux)
# define VG_ELF_DATA2XXX ELFDATA2LSB
# define VG_ELF_MACHINE EM_X86_64
# define VG_ELF_CLASS ELFCLASS64
-#elif defined(VGA_ppc32)
+# undef VG_PLAT_USES_PPCTOC
+#elif defined(VGP_ppc32_linux)
# define VG_ELF_DATA2XXX ELFDATA2MSB
# define VG_ELF_MACHINE EM_PPC
# define VG_ELF_CLASS ELFCLASS32
-#elif defined(VGA_ppc64)
+# undef VG_PLAT_USES_PPCTOC
+#elif defined(VGP_ppc64_linux)
# define VG_ELF_DATA2XXX ELFDATA2MSB
# define VG_ELF_MACHINE EM_PPC64
# define VG_ELF_CLASS ELFCLASS64
+# define VG_PLAT_USES_PPCTOC 1
+#elif defined(VGO_aix5)
+# undef VG_ELF_DATA2XXX
+# undef VG_ELF_MACHINE
+# undef VG_ELF_CLASS
+# define VG_PLAT_USES_PPCTOC 1
#else
-# error Unknown arch
+# error Unknown platform
#endif
#if defined(VGA_x86)
#ifndef __PUB_TOOL_MACHINE_H
#define __PUB_TOOL_MACHINE_H
-#if defined(VGA_x86)
+#if defined(VGP_x86_linux)
# define VG_MIN_INSTR_SZB 1 // min length of native instruction
# define VG_MAX_INSTR_SZB 16 // max length of native instruction
# define VG_CLREQ_SZB 14 // length of a client request, may
// be larger than VG_MAX_INSTR_SZB
# define VG_STACK_REDZONE_SZB 0 // number of addressable bytes below %RSP
-#elif defined(VGA_amd64)
+#elif defined(VGP_amd64_linux)
# define VG_MIN_INSTR_SZB 1
# define VG_MAX_INSTR_SZB 16
# define VG_CLREQ_SZB 19
# define VG_STACK_REDZONE_SZB 128
-#elif defined(VGA_ppc32)
+#elif defined(VGP_ppc32_linux)
# define VG_MIN_INSTR_SZB 4
# define VG_MAX_INSTR_SZB 4
# define VG_CLREQ_SZB 20
# define VG_STACK_REDZONE_SZB 0
-#elif defined(VGA_ppc64)
+#elif defined(VGP_ppc64_linux)
# define VG_MIN_INSTR_SZB 4
# define VG_MAX_INSTR_SZB 4
# define VG_CLREQ_SZB 20
# define VG_STACK_REDZONE_SZB 288 // number of addressable bytes below R1
// from 64-bit PowerPC ELF ABI Supplement 1.7
+#elif defined(VGP_ppc32_aix5)
+# define VG_MIN_INSTR_SZB 4
+# define VG_MAX_INSTR_SZB 4
+# define VG_CLREQ_SZB 20
+ /* The PowerOpen ABI actually says 220 bytes, but that is not an
+ 8-aligned number, and frequently forces Memcheck's
+ mc_{new,die}_mem_stack_N routines into slow cases by losing
+ 8-alignment of the area to be messed with. So let's just say
+ 224 instead. Gdb has a similar kludge. */
+# define VG_STACK_REDZONE_SZB 224
+#elif defined(VGP_ppc64_aix5)
+# define VG_MIN_INSTR_SZB 4
+# define VG_MAX_INSTR_SZB 4
+# define VG_CLREQ_SZB 20
+# define VG_STACK_REDZONE_SZB 288 // is this right?
#else
-# error Unknown arch
+# error Unknown platform
#endif
// Guest state accessors