/* A 64-bit pointer value. In LP64 mode, this is effectively a plain
pointer. In ILP32 mode, it's a pointer that's been extended to
64 bits by "addp4". */
+#ifdef __hpux
+typedef void *PTR64;
+#else // some other unix
typedef void *PTR64 __attribute__((mode(DI)));
+#endif
/* Memory image of fp register contents. This is the implementation
specific format used by ldf.fill/stf.spill. All we care about is
point types without type conversions. Type conversion to long double breaks
the denorm support. */
+#ifdef __hpux
+#define stf_spill(addr, value)
+#else
#define stf_spill(addr, value) \
asm ("stf.spill %0 = %1%P0" : "=m" (*addr) : "f"(value));
+#endif
/* Load a value from ADDR, which is in the current cpu implementation's
fp spill format. As above, this must also be a macro. */
+#ifdef __hpux
+#define ldf_fill(result, addr)
+#else
#define ldf_fill(result, addr) \
asm ("ldf.fill %0 = %1%P1" : "=f"(result) : "m"(*addr));
+#endif
/* Return the size of the C type associated with with TYPE. Which will
be one of the FFI_IA64_TYPE_HFA_* values. */
.pred.safe_across_calls p1-p5,p16-p63
.text
+/* HPUX assembler needs to see these symbols, otherwise compilation
+ fails */
+#ifdef __hpux
+ .global memcpy
+ .global ffi_closure_unix_inner
+#endif
/* int ffi_call_unix (struct ia64_args *stack, PTR64 rvalue,
void (*fn)(void), int flags);
mov ar.pfs = loc0
addl r18 = @ltoffx(.Lst_table), gp
;;
+ /* default assembler on HP-UX does not support LDXMOV */
+#ifdef __hpux
+ ld8 r18 = [r18]
+#else
ld8.mov r18 = [r18], .Lst_table
+#endif
mov b0 = loc1
;;
shladd r18 = r16, 3, r18
addl r18 = @ltoffx(.Lld_table), gp
mov ar.pfs = loc0
;;
- ld8.mov r18 = [r18], .Lld_table
+#ifdef __hpux
+ ld8 r18 = [r18]
+#else
+ ld8.mov r18 = [r18], .Lst_table
+#endif
mov b0 = loc1
;;
shladd r18 = r16, 3, r18
;;
.endp ffi_closure_unix
-
+#ifdef __hpux
+ .rodata
+#else
.section .rodata
+#endif
.align 8
.Lst_table:
data8 @pcrel(.Lst_void) // FFI_TYPE_VOID