1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Revert shift of ndim in array tag from 3df3ba1a2c

To avoid breaking ABI.

* libguile/arrays.h (SCM_I_ARRAY_DIM, scm_i_raw_array): As stated.
* module/system/vm/assembler.scm: As stated.
This commit is contained in:
Daniel Llorens 2021-09-17 11:20:24 +02:00
parent af741e50e9
commit 96e3686db1
2 changed files with 3 additions and 3 deletions

View file

@ -94,7 +94,7 @@ typedef struct scm_t_array_dim
/* internal. */ /* internal. */
#define SCM_I_ARRAYP(a) SCM_TYP16_PREDICATE (scm_tc7_array, a) #define SCM_I_ARRAYP(a) SCM_TYP16_PREDICATE (scm_tc7_array, a)
#define SCM_I_ARRAY_NDIM(x) ((size_t) (SCM_CELL_WORD_0 (x)>>16)) #define SCM_I_ARRAY_NDIM(x) ((size_t) (SCM_CELL_WORD_0 (x)>>17))
#define SCM_I_ARRAY_V(a) SCM_CELL_OBJECT_1 (a) #define SCM_I_ARRAY_V(a) SCM_CELL_OBJECT_1 (a)
#define SCM_I_ARRAY_BASE(a) ((size_t) SCM_CELL_WORD_2 (a)) #define SCM_I_ARRAY_BASE(a) ((size_t) SCM_CELL_WORD_2 (a))
#define SCM_I_ARRAY_DIMS(a) ((scm_t_array_dim *) SCM_CELL_OBJECT_LOC (a, 3)) #define SCM_I_ARRAY_DIMS(a) ((scm_t_array_dim *) SCM_CELL_OBJECT_LOC (a, 3))
@ -106,7 +106,7 @@ typedef struct scm_t_array_dim
static inline SCM static inline SCM
scm_i_raw_array (int ndim) scm_i_raw_array (int ndim)
{ {
return scm_words (((scm_t_bits) ndim << 16) + scm_tc7_array, 3 + ndim*3); return scm_words (((scm_t_bits) ndim << 17) + scm_tc7_array, 3 + ndim*3);
} }
SCM_INTERNAL SCM scm_i_make_array (int ndim); SCM_INTERNAL SCM scm_i_make_array (int ndim);

View file

@ -2063,7 +2063,7 @@ should be .data or .rodata), and return the resulting linker object.
(let-values (let-values
;; array tag + rank ;; array tag + rank
;; see libguile/arrays.h: SCM_I_ARRAY_NDIM, SCM_I_ARRAYP, scm_i_raw_array ;; see libguile/arrays.h: SCM_I_ARRAY_NDIM, SCM_I_ARRAYP, scm_i_raw_array
(((tag) (logior tc7-array (ash (array-rank obj) 16))) (((tag) (logior tc7-array (ash (array-rank obj) 17)))
((bv-set! bvs-set!) ((bv-set! bvs-set!)
(case word-size (case word-size
((4) (values bytevector-u32-set! bytevector-s32-set!)) ((4) (values bytevector-u32-set! bytevector-s32-set!))