mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-04 03:00:20 +02:00
Rewrite jit_regset_scan1 for easier optimization.
* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h, include/lightning/jit_hppa.h, include/lightning/jit_ia64.h, include/lightning/jit_mips.h, include/lightning/jit_ppc.h, include/lightning/jit_s390x.h, include/lightning/jit_sparc.h, include/lightning/jit_x86.h: Change jit_regset_t to an unsigned type, to allow safe right shift. * lib/lightning.c: Rewrite jit_regset_scan1 to allow easier compiler optimization.
This commit is contained in:
parent
b1d3217b63
commit
6e75c0352d
11 changed files with 33 additions and 16 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2014-19-02 Paulo Andrade <pcpa@gnu.org>
|
||||
|
||||
* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
|
||||
include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
|
||||
include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
|
||||
include/lightning/jit_s390x.h, include/lightning/jit_sparc.h,
|
||||
include/lightning/jit_x86.h: Change jit_regset_t to an
|
||||
unsigned type, to allow safe right shift.
|
||||
|
||||
* lib/lightning.c: Rewrite jit_regset_scan1 to allow easier
|
||||
compiler optimization.
|
||||
|
||||
2013-12-03 Paulo Andrade <pcpa@gnu.org>
|
||||
|
||||
* lib/jit_x86-x87.c: Correct wrong optimization when
|
||||
|
|
|
@ -90,6 +90,6 @@ typedef enum {
|
|||
#define JIT_NOREG _NOREG
|
||||
} jit_reg_t;
|
||||
|
||||
typedef jit_int64_t jit_regset_t;
|
||||
typedef jit_uint64_t jit_regset_t;
|
||||
|
||||
#endif /* _jit_aarch64_h */
|
||||
|
|
|
@ -123,7 +123,7 @@ typedef struct {
|
|||
jit_uint32_t ldrt_strt : 1;
|
||||
} jit_cpu_t;
|
||||
|
||||
typedef jit_int64_t jit_regset_t;
|
||||
typedef jit_uint64_t jit_regset_t;
|
||||
|
||||
/*
|
||||
* Initialization
|
||||
|
|
|
@ -133,6 +133,6 @@ typedef enum {
|
|||
_NOREG,
|
||||
} jit_reg_t;
|
||||
|
||||
typedef jit_int64_t jit_regset_t;
|
||||
typedef jit_uint64_t jit_regset_t;
|
||||
|
||||
#endif /* _jit_hppa */
|
||||
|
|
|
@ -118,10 +118,10 @@ typedef enum {
|
|||
} jit_reg_t;
|
||||
|
||||
typedef struct {
|
||||
jit_int64_t rl;
|
||||
jit_int64_t rh;
|
||||
jit_int64_t fl;
|
||||
jit_int64_t fh;
|
||||
jit_uint64_t rl;
|
||||
jit_uint64_t rh;
|
||||
jit_uint64_t fl;
|
||||
jit_uint64_t fh;
|
||||
} jit_regset_t;
|
||||
|
||||
#endif /* _jit_ia64_h */
|
||||
|
|
|
@ -119,6 +119,6 @@ typedef enum {
|
|||
_NOREG,
|
||||
} jit_reg_t;
|
||||
|
||||
typedef jit_int64_t jit_regset_t;
|
||||
typedef jit_uint64_t jit_regset_t;
|
||||
|
||||
#endif /* _jit_mips_h */
|
||||
|
|
|
@ -103,6 +103,6 @@ typedef enum {
|
|||
#define JIT_NOREG _NOREG
|
||||
} jit_reg_t;
|
||||
|
||||
typedef jit_int64_t jit_regset_t;
|
||||
typedef jit_uint64_t jit_regset_t;
|
||||
|
||||
#endif /* _jit_ppc_h */
|
||||
|
|
|
@ -67,6 +67,6 @@ typedef enum {
|
|||
#define JIT_NOREG _NOREG
|
||||
} jit_reg_t;
|
||||
|
||||
typedef jit_int32_t jit_regset_t;
|
||||
typedef jit_uint32_t jit_regset_t;
|
||||
|
||||
#endif /* _jit_s390x_h */
|
||||
|
|
|
@ -65,6 +65,6 @@ typedef enum {
|
|||
_NOREG,
|
||||
} jit_reg_t;
|
||||
|
||||
typedef jit_int64_t jit_regset_t;
|
||||
typedef jit_uint64_t jit_regset_t;
|
||||
|
||||
#endif /* _jit_sparc_h */
|
||||
|
|
|
@ -139,9 +139,9 @@ typedef struct {
|
|||
} jit_cpu_t;
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
typedef jit_int32_t jit_regset_t;
|
||||
typedef jit_uint32_t jit_regset_t;
|
||||
#else
|
||||
typedef jit_int64_t jit_regset_t;
|
||||
typedef jit_uint64_t jit_regset_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -496,10 +496,15 @@ jit_regset_scan1(jit_regset_t *set, jit_int32_t offset)
|
|||
unsigned long
|
||||
jit_regset_scan1(jit_regset_t *set, jit_int32_t offset)
|
||||
{
|
||||
jit_regset_t mask;
|
||||
assert(offset >= 0 && offset <= 63);
|
||||
for (; offset < 64; offset++) {
|
||||
if (*set & (1LL << offset))
|
||||
return (offset);
|
||||
if ((mask = *set >> offset)) {
|
||||
for (;;) {
|
||||
if (mask & 1)
|
||||
return (offset);
|
||||
mask >>= 1;
|
||||
++offset;
|
||||
}
|
||||
}
|
||||
return (ULONG_MAX);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue