Skip to content

Commit a8bce18

Browse files
committed
Fix definition of some constants when sizeof(long)==4
1 parent f7504b5 commit a8bce18

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/fglm/fglm_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,15 +504,15 @@ static inline void sparse_mat_fglm_mult_vec(CF_t *res, sp_matfglm_t *mat,
504504
nmod_t mod;
505505
uint64_t pow2_precomp;
506506
nmod_init(&mod, (uint64_t)prime);
507-
NMOD_RED(pow2_precomp, (UWORD(1) << __DOT_SPLIT_BITS), mod);
507+
NMOD_RED(pow2_precomp, (UINT64_C(1) << __DOT_SPLIT_BITS), mod);
508508

509509
_avx512_matrix_vector_product(vres, mat->dense_mat, vec, mat->dst,
510510
ncols, nrows, mod, pow2_precomp, st);
511511
#elif defined(HAVE_AVX2)
512512
nmod_t mod;
513513
uint64_t pow2_precomp;
514514
nmod_init(&mod, (uint64_t)prime);
515-
NMOD_RED(pow2_precomp, (UWORD(1) << __DOT_SPLIT_BITS), mod);
515+
NMOD_RED(pow2_precomp, (UINT64_C(1) << __DOT_SPLIT_BITS), mod);
516516

517517
_avx2_matrix_vector_product(vres, mat->dense_mat, vec, mat->dst,
518518
ncols, nrows, mod, pow2_precomp, st);
@@ -565,15 +565,15 @@ static inline void sparse_mat_fglm_colon_mult_vec(CF_t *res, sp_matfglmcol_t *ma
565565
nmod_t mod;
566566
uint64_t pow2_precomp;
567567
nmod_init(&mod, (uint64_t)prime);
568-
NMOD_RED(pow2_precomp, (UWORD(1) << __DOT_SPLIT_BITS), mod);
568+
NMOD_RED(pow2_precomp, (UINT64_C(1) << __DOT_SPLIT_BITS), mod);
569569

570570
_avx512_matrix_vector_product(vres, mat->dense_mat, vec, mat->dst,
571571
ncols, nrows, mod, pow2_precomp, st);
572572
#elif defined(HAVE_AVX2)
573573
nmod_t mod;
574574
uint64_t pow2_precomp;
575575
nmod_init(&mod, (uint64_t)prime);
576-
NMOD_RED(pow2_precomp, (UWORD(1) << __DOT_SPLIT_BITS), mod);
576+
NMOD_RED(pow2_precomp, (UINT64_C(1) << __DOT_SPLIT_BITS), mod);
577577

578578
_avx2_matrix_vector_product(vres, mat->dense_mat, vec, mat->dst,
579579
ncols, nrows, mod, pow2_precomp, st);

src/fglm/linalg-fglm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
// parameters for splitting
4242
#define __DOT_SPLIT_BITS 56
43-
#define __DOT_SPLIT_MASK 72057594037927935UL // (1UL << __DOT_SPLIT_BITS) - 1
43+
#define __DOT_SPLIT_MASK UINT64_C(72057594037927935) // (1ULL << __DOT_SPLIT_BITS) - 1
4444

4545
/*--------------------------------------*/
4646
/* non-vectorized matrix vector product */

0 commit comments

Comments
 (0)