Skip to content

Commit

Permalink
Merge pull request #33 from camel-cdr/cosmetic
Browse files Browse the repository at this point in the history
fix extern/const usage and remove unused variables
  • Loading branch information
PingTakPeterTang authored Oct 4, 2024
2 parents 7276c0d + 1e39604 commit 9edcfdd
Show file tree
Hide file tree
Showing 93 changed files with 397 additions and 481 deletions.
9 changes: 4 additions & 5 deletions include/rvvlm.h
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,10 @@ union sui64_fp64 {
#define RVVLM_TANHDI_STD rvvlm_tanhI

// Define the various tables for table-driven implementations
extern int64_t expD_tbl64_fixedpt[64];
extern int64_t logD_tbl128_fixedpt[128];
extern double logtbl_4_powD_128_hi_lo[256];
extern double dbl_2ovpi_tbl[28];
extern int64_t factorial_fixedpt[180];
extern const int64_t expD_tbl64_fixedpt[64];
extern const int64_t logD_tbl128_fixedpt[128];
extern const double logtbl_4_powD_128_hi_lo[256];
extern const double dbl_2ovpi_tbl[28];

// Define the functions in the vector math library
void RVVLM_ACOSD_FIXEDPT(size_t x_len, const double *x, double *y);
Expand Down
4 changes: 2 additions & 2 deletions include/rvvlm_asinhcoshD.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// which is computed with care.
void F_VER1(API) {
size_t vlen;
VFLOAT vx, vx_orig, vy, vy_special;
VFLOAT vx, vy, vy_special;
VBOOL special_args;

SET_ROUNDTONEAREST;
Expand All @@ -46,7 +46,7 @@ void F_VER1(API) {
vlen = VSET(_inarg_n);
vx = VFLOAD_INARG1(vlen);
#if defined(COMPILE_FOR_ASINH)
vx_orig = vx;
VFLOAT vx_orig = vx;
#endif

#if defined(COMPILE_FOR_ACOSH)
Expand Down
2 changes: 1 addition & 1 deletion include/rvvlm_atan2D.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ void F_VER1(API) {
divide = __riscv_vmandn(divide, x_neg, vlen);
divide = __riscv_vmand(divide, exp_diff_large, vlen);

VFLOAT abs_y = __riscv_vfsgnj(vy, fp_posOne, vlen);
#if defined(COMPILE_FOR_ATAN2)
VFLOAT abs_y = __riscv_vfsgnj(vy, fp_posOne, vlen);
VFLOAT tmp1 = __riscv_vfdiv(divide, abs_y, vx, vlen);
tmp1 = __riscv_vfmerge(tmp1, 0x1.0p-60, no_divide, vlen);
tmp1 = __riscv_vfsgnj(tmp1, vx, vlen);
Expand Down
2 changes: 1 addition & 1 deletion include/rvvlm_atanD.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static_assert(false, "Must specify atan or atanpi" __FILE__);
// r and s into fixed point.
void F_VER1(API) {
size_t vlen;
VFLOAT vx_orig, vx, vy, vy_special;
VFLOAT vx_orig, vy, vy_special;
VBOOL special_args;

SET_ROUNDTONEAREST;
Expand Down
2 changes: 1 addition & 1 deletion include/rvvlm_erfcD.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static_assert(false,
// cdfnorm(|x|) = 1 - cdfnorm(-|x|)
void F_VER1(API) {
size_t vlen;
VFLOAT vx, vx_orig, vy, vy_special;
VFLOAT vx, vx_orig, vy_special;
VBOOL special_args;

SET_ROUNDTONEAREST;
Expand Down
5 changes: 2 additions & 3 deletions include/rvvlm_expint1D.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
// On return rat_hi and rat_lo are floating-point values
#define EXPINT1_RAT_GE1(x_hi, x_lo, scale, rat_hi, rat_lo, vlen) \
do { \
VINT P75, P81, P89, Q74, Q81, Q89, Ysq, Y4; \
VINT P75, P81, P89, Q74, Q81, Q89; \
VINT _X; \
FLT2FIX((x_hi), (x_lo), (scale), _X, (vlen)); \
P75 = PSTEP_I_SLL(P_10, P_11, 1, _X, (vlen)); \
Expand Down Expand Up @@ -242,7 +242,6 @@
FAST2SUM(_p_tmp2_hi, _p_tmp2_lo, _p_hi, _p_lo, (vlen)); \
/* (_p_hi, _p_lo) is an accurate version of p(x) */ \
\
VFLOAT AA, aa; \
Q74 = PSTEP_I_SLL(Q_10, Q_11, 1, _X, (vlen)); \
Q74 = PSTEP_I_SLL(Q_9, _X, 1, Q74, (vlen)); \
Q74 = PSTEP_I_SLL(Q_8, _X, 1, Q74, (vlen)); \
Expand Down Expand Up @@ -342,7 +341,7 @@

void F_VER1(API) {
size_t vlen;
VFLOAT vx, vx_sign, vy, vy_special;
VFLOAT vx, vy, vy_special;
VBOOL special_args;
VINT n_adjust;

Expand Down
1 change: 1 addition & 0 deletions include/rvvlm_powD.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
vy = __riscv_vfmin_mu(current_cases, vy, vy, 0x1.0p53, vlen); \
vy = __riscv_vfmax_mu(current_cases, vy, vy, -0x1.0p53, vlen); \
VINT y_to_int = __riscv_vfcvt_x(current_cases, vy, vlen); \
/* TODO: y_to_int_fp and y_is_int need to be used */ \
VFLOAT y_to_int_fp = __riscv_vfcvt_f(current_cases, y_to_int, vlen); \
VBOOL y_is_int = __riscv_vmfeq(current_cases, vy, y_to_int_fp, vlen); \
VINT sign_z = __riscv_vsll(y_to_int, 63, vlen); \
Expand Down
1 change: 0 additions & 1 deletion include/rvvlm_tgammaD.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ void F_VER1(API) {
vx_lo = __riscv_vmerge(vx_lo, a_tmp_lo, x_lt_0, vlen);
}

VFLOAT y_hi, y_lo;
VINT n, EXP;

VINT XF = __riscv_vsll(VMVI_VX(1, vlen), 61, vlen);
Expand Down
2 changes: 1 addition & 1 deletion src/rvvlm_2ovpi_tbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// This is 2^500 * (2/pi) and the lsb of dbl_2ovpi_tbl[j] is 2^(500-(j+1)*52),
// j=0,1,...,27
const extern double dbl_2ovpi_tbl[28] = {
const double dbl_2ovpi_tbl[28] = {
0x1.45f306dc9c882p+499, 0x1.4a7f09d5f47d4p+446, 0x1.a6ee06db14ad0p+393,
-0x1.b0ef1bef806bcp+342, 0x1.8eaf7aef1586cp+290, 0x1.c91b8e909374cp+238,
-0x1.ff9b6d115f630p+184, 0x1.921cfe1deb1d0p+132, -0x1.3b5963045df74p+82,
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_acosD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_acosDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_acoshD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_acoshDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_acospiD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_acospiDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_asinD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_asinDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_asinhD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_asinhDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_asinpiD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_asinpiDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atan2D.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_21
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atan2DI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_21
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atan2piD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_21
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atan2piDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_21
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atanD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atanDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atanhD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atanhDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atanpiD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_atanpiDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cbrtD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cbrtDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cdfnormD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cdfnormDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cdfnorminvD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cdfnorminvDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cosD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cosDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_coshD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_coshDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cospiD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_cospiDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
1 change: 0 additions & 1 deletion src/rvvlm_erfD.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

#include <riscv_vector.h>
#include <stdio.h>

#include "rvvlm.h"
#define API_SIGNATURE API_SIGNATURE_11
Expand Down
Loading

0 comments on commit 9edcfdd

Please sign in to comment.