mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
Make all current test cases pass in Darwin PowerPC.
* lib/jit_ppc-cpu.c: Make movr a function that checks arguments so that other code can safely assume it is a noop if src and dst are the same register. Implement rem{r,i}{,_u} as a div{,u}/mul/sub. Correct ANDIS, ORIS and XORIS calls to cast the argument to unsigned before the shift to avoid an assertion if the argument had the topmost bit set. Implement lshi, rshi and rshi_u as functions to test for a zero argument, that would otherwise trigger an assertion when computing the shift value. Do a simple implementation of bm{s,c}{r,i} with a temporary, "andr" of arguments and jump based on comparison with zero. Correct typo in ldxi_c. * lib/jit_ppc-fpu.c: Correct wrong arguments to FDIV* and STF*. * lib/jit_ppc.c: Correct wrong check for 6 instead of 8 integer arguments in registers. If calling a varargs function and passing a float or double argument, also either store the value in the stack or in integer registers, as varargs functions do not fetch it from float registers. Add "case" for new functions and incorrectly missing ones. Call libgcc's __clear_cache, that should know what to do if the hardware needs flushing cache before execution. * lib/lightning.c: Do a simple/trivial logic in jit_regset_scan1, that should make it easier for the compiler to optimize it, and that also corrects the previously wrong code for big endian, and that was causing problems in ppc due to not saving all callee save registers as it was not "finding" them in the regset due to the little endian assumption bug.
This commit is contained in:
parent
7e3d863767
commit
a04df966c0
5 changed files with 248 additions and 48 deletions
|
@ -262,31 +262,10 @@ _jit_unget_reg(jit_state_t *_jit, jit_int32_t regno)
|
|||
unsigned long
|
||||
jit_regset_scan1(jit_regset_t set, jit_int32_t offset)
|
||||
{
|
||||
jit_int32_t index;
|
||||
jit_int32_t length;
|
||||
union {
|
||||
jit_uint64_t ul;
|
||||
jit_uint8_t uc[8];
|
||||
} data;
|
||||
|
||||
assert(offset >= 0 && offset <= 63);
|
||||
data.ul = set;
|
||||
if (data.uc[index = offset >> 3]) {
|
||||
length = (index + 1) << 3;
|
||||
for (; offset < length; offset++) {
|
||||
if (set & (1LL << offset))
|
||||
return (offset);
|
||||
}
|
||||
}
|
||||
for (index++; index < 8; index++) {
|
||||
if (data.uc[index]) {
|
||||
offset = index << 3;
|
||||
length = (index + 1) << 3;
|
||||
for (; offset < length; offset++) {
|
||||
if (set & (1LL << offset))
|
||||
return (offset);
|
||||
}
|
||||
}
|
||||
for (; offset < 64; offset++) {
|
||||
if (set & (1LL << offset))
|
||||
return (offset);
|
||||
}
|
||||
return (ULONG_MAX);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue