Richard Henderson
7ba30b1906
s390: Inline and tidy ffi_prep_args
...
As per discussion with Ulrich Weigand, document the restrictions
on the code within ffi_call_int as we simultaneously prepare
stack frames for ffi_call_SYSV and the target function.
2014-12-19 11:38:17 -05:00
Richard Henderson
f69ec6f35d
s390: Use pc-relative insns in 31-bit mode
...
It's silly to stick to esa/390 features when the compiler won't.
Detect when brasl and larl are used by the compiler and then use
them in the assembly.
2014-12-18 16:21:07 -05:00
Richard Henderson
2f530de168
s390: Reorganize assembly
...
Avoid using ffi_prep_args as a callback; do all the work setting
up the frame within ffi_call_int directly. Save fewer registers
in ffi_closure_SYSV.
2014-12-18 16:01:59 -05:00
Richard Henderson
97512ded05
s390: Avoid aliasing warnings
2014-12-18 16:01:15 -05:00
Richard Henderson
c860ca9ac0
s390: Kill trailing whitespace
2014-12-17 13:24:03 -05:00
Richard Henderson
c6352b664c
aarch64: Add support for Go closures
2014-11-12 09:29:32 +01:00
Richard Henderson
0e41c73b09
aarch64: Move x8 out of call_context
...
Reduces stack size. It was only used by the closure, and there
are available argument registers.
2014-11-12 09:29:32 +01:00
Richard Henderson
a992f8789b
aarch64: Add support for complex types
2014-11-12 09:29:31 +01:00
Richard Henderson
658b2b5600
aarch64: Remove aarch64_flags
...
This field was useless from the start, since the normal flags
field is available for backend use.
2014-11-12 09:28:44 +01:00
Richard Henderson
4a3cbcaa4f
aarch64: Unify scalar fp and hfa handling
...
Since an HFA of a single element is exactly the same as scalar,
this tidies things up a bit.
2014-11-12 09:28:44 +01:00
Richard Henderson
12cf89ee04
aarch64: Move return value handling into ffi_closure_SYSV
...
As with the change to ffi_call_SYSV, this avoids copying data
into a temporary buffer.
2014-11-12 09:28:44 +01:00
Richard Henderson
4fe1aea121
aarch64: Move return value handling into ffi_call_SYSV
...
This lets us pass return data directly to the caller of ffi_call
in most cases, rather than storing it into temporary storage first.
2014-11-12 09:28:44 +01:00
Richard Henderson
325471ea6a
aarch64: Merge prep_args with ffi_call
...
Use the trick to allocate the stack frame for ffi_call_SYSV
within ffi_call itself.
2014-11-12 09:28:44 +01:00
Richard Henderson
8c8161cb62
aarch64: Tidy up abi manipulation
...
Avoid false abstraction, like get_x_addr. Avoid recomputing data
about the type being manipulated. Use NEON insns for HFA manipulation.
Note that some of the inline assembly will go away in a subsequent patch.
2014-11-12 09:28:44 +01:00
Richard Henderson
b55e03665d
aarch64: Treat void return as not passed in registers
...
This lets us do less post-processing when there's no return value.
2014-11-12 09:28:44 +01:00
Richard Henderson
2e32f9bf6f
aarch64: Use correct return registers
...
There are fewer return registers than argument registers.
2014-11-12 09:28:44 +01:00
Richard Henderson
95a04af134
aarch64: Reduce the size of register_context
...
We don't need to store 32 general and vector registers.
Only 8 of each are used for parameter passing.
2014-11-12 09:28:44 +01:00
Richard Henderson
77c4cddca6
aarch64: Simplify AARCH64_STACK_ALIGN
...
The iOS abi doesn't require padding between arguments, but
that's not what AARCH64_STACK_ALIGN meant. The hardware will
in fact trap if the SP register is not 16 byte aligned.
2014-11-12 09:28:44 +01:00
Richard Henderson
b5f147d847
aarch64: Always distinguish LONGDOUBLE
...
Avoid if-deffery by forcing FFI_TYPE_LONGDOUBLE different
from FFI_TYPE_DOUBLE. This will simply be unused on hosts
that define them identically.
2014-11-12 09:28:44 +01:00
Richard Henderson
38b54b9c18
aarch64: Improve is_hfa
...
The set of functions get_homogeneous_type, element_count, and is_hfa
are all intertwined and recompute data. Return a compound quantity
from is_hfa that contains all the data and avoids the recomputation.
2014-11-12 09:28:44 +01:00
Richard Henderson
18b74ce54a
aarch64: Fix non-apple compilation
2014-11-12 09:28:44 +01:00