From 2222925e9ddcdc05f84ffa3c3eba633c22b0eeae Mon Sep 17 00:00:00 2001 From: Olaf Bernstein Date: Mon, 16 Sep 2024 17:39:58 +0200 Subject: [PATCH 1/3] remove wrong and unused constants that overlap __STDC_WANT_IEC_60559_BFP_EXT__ SNAN/QNAN/PINF/NINF/NEGZERO where intitialized from a double, but they all have a union type of which the first element is an int64_t. gcc warns about this, e.g. "overflow [...] changes value from '+SNaN' to '0'" --- include/rvvlm_fp.inc.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/rvvlm_fp.inc.h b/include/rvvlm_fp.inc.h index 86d2a9d..a8bf49b 100644 --- a/include/rvvlm_fp.inc.h +++ b/include/rvvlm_fp.inc.h @@ -227,12 +227,6 @@ static const double fp_posInf = __builtin_inf(); static const double fp_negInf = -__builtin_inf(); static const double fp_negZero = -0.; -static const union sui64_fp64 SNAN = {fp_sNaN}; -static const union sui64_fp64 QNAN = {fp_qNaN}; -static const union sui64_fp64 PINF = {fp_posInf}; -static const union sui64_fp64 NINF = {fp_negInf}; -static const union sui64_fp64 NEGZERO = {fp_negZero}; - static const double fp_posZero = 0.0; static const double fp_posOne = 0x1.0p0; static const double fp_negOne = -0x1.0p0; From 0aff5807125da1fee7c79b45612d46d71f78dbf6 Mon Sep 17 00:00:00 2001 From: Olaf Bernstein Date: Mon, 16 Sep 2024 17:46:09 +0200 Subject: [PATCH 2/3] fixed use of uninitialized vlen --- include/rvvlm_fp.inc.h | 1 + include/rvvlm_lgammaD.inc.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/rvvlm_fp.inc.h b/include/rvvlm_fp.inc.h index a8bf49b..caf0d1a 100644 --- a/include/rvvlm_fp.inc.h +++ b/include/rvvlm_fp.inc.h @@ -166,6 +166,7 @@ static_assert(false, "API_SIGNATURE ill or undefined" __FILE__); #define MAKE_VBOOL(A) __PASTE3(A, 8, _t) #endif #define VSET __PASTE2(__riscv_vsetvl_e, __PASTE3(BIT_WIDTH, m, LMUL)) +#define VSETMAX __PASTE2(__riscv_vsetvlmax_e, __PASTE3(BIT_WIDTH, m, LMUL)) #define VSE __PASTE2(__riscv_vse, BIT_WIDTH) #define VSSE __PASTE2(__riscv_vsse, BIT_WIDTH) #define MAKE_REINTERPRET(A, B) \ diff --git a/include/rvvlm_lgammaD.inc.h b/include/rvvlm_lgammaD.inc.h index 7c01c6b..669f623 100644 --- a/include/rvvlm_lgammaD.inc.h +++ b/include/rvvlm_lgammaD.inc.h @@ -480,7 +480,7 @@ } while (0) void F_VER1(API) { - size_t vlen; + size_t vlen = VSETMAX(); VFLOAT vx, vx_orig, vy, vy_special; VBOOL special_args; VFLOAT zero = VFMV_VF(fp_posZero, vlen); From 54cfd32186655299080cc4870b5236758c54cd10 Mon Sep 17 00:00:00 2001 From: Olaf Bernstein Date: Sat, 21 Sep 2024 18:02:32 +0200 Subject: [PATCH 3/3] vsetvlmax to vl=AVL --- include/rvvlm_fp.inc.h | 1 - include/rvvlm_lgammaD.inc.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/rvvlm_fp.inc.h b/include/rvvlm_fp.inc.h index caf0d1a..a8bf49b 100644 --- a/include/rvvlm_fp.inc.h +++ b/include/rvvlm_fp.inc.h @@ -166,7 +166,6 @@ static_assert(false, "API_SIGNATURE ill or undefined" __FILE__); #define MAKE_VBOOL(A) __PASTE3(A, 8, _t) #endif #define VSET __PASTE2(__riscv_vsetvl_e, __PASTE3(BIT_WIDTH, m, LMUL)) -#define VSETMAX __PASTE2(__riscv_vsetvlmax_e, __PASTE3(BIT_WIDTH, m, LMUL)) #define VSE __PASTE2(__riscv_vse, BIT_WIDTH) #define VSSE __PASTE2(__riscv_vsse, BIT_WIDTH) #define MAKE_REINTERPRET(A, B) \ diff --git a/include/rvvlm_lgammaD.inc.h b/include/rvvlm_lgammaD.inc.h index 669f623..9b66e14 100644 --- a/include/rvvlm_lgammaD.inc.h +++ b/include/rvvlm_lgammaD.inc.h @@ -480,7 +480,7 @@ } while (0) void F_VER1(API) { - size_t vlen = VSETMAX(); + size_t vlen = VSET(_inarg_n); VFLOAT vx, vx_orig, vy, vy_special; VBOOL special_args; VFLOAT zero = VFMV_VF(fp_posZero, vlen);