Skip to content

Commit

Permalink
core-*, stress-*: replace memcmp to shim_memcmp
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Dec 20, 2024
1 parent b59703e commit 171c9e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion stress-dfp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "stress-ng.h"
#include "core-arch.h"
#include "core-attribute.h"
#include "core-builtin.h"
#include "core-madvise.h"
#include "core-put.h"
#include "core-target-clones.h"
Expand Down Expand Up @@ -336,7 +337,7 @@ static int stress_dfp_call_method(
switch (dfp_type) {
#if defined(HAVE_Decimal32)
case STRESS_DFP_TYPE_DECIMAL32:
ret = memcmp(&dfp_data[i].d32.r[0], &dfp_data[i].d32.r[1], sizeof(dfp_data[i].d32.r[0]));
ret = shim_memcmp(&dfp_data[i].d32.r[0], &dfp_data[i].d32.r[1], sizeof(dfp_data[i].d32.r[0]));
r0 = (long double)dfp_data[i].d32.r[0];
r1 = (long double)dfp_data[i].d32.r[1];
break;
Expand Down
15 changes: 8 additions & 7 deletions stress-fp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "stress-ng.h"
#include "core-arch.h"
#include "core-attribute.h"
#include "core-builtin.h"
#include "core-madvise.h"
#include "core-put.h"
#include "core-target-clones.h"
Expand Down Expand Up @@ -505,45 +506,45 @@ static int stress_fp_call_method(

switch (fp_type) {
case STRESS_FP_TYPE_LONG_DOUBLE:
ret = memcmp(&fp_data[i].ld.r[0], &fp_data[i].ld.r[1], sizeof(fp_data[i].ld.r[0]));
ret = shim_memcmp(&fp_data[i].ld.r[0], &fp_data[i].ld.r[1], sizeof(fp_data[i].ld.r[0]));
r0 = (long double)fp_data[i].ld.r[0];
r1 = (long double)fp_data[i].ld.r[1];
break;
case STRESS_FP_TYPE_DOUBLE:
ret = memcmp(&fp_data[i].d.r[0], &fp_data[i].d.r[1], sizeof(fp_data[i].d.r[0]));
ret = shim_memcmp(&fp_data[i].d.r[0], &fp_data[i].d.r[1], sizeof(fp_data[i].d.r[0]));
r0 = (long double)fp_data[i].d.r[0];
r1 = (long double)fp_data[i].d.r[1];
break;
case STRESS_FP_TYPE_FLOAT:
ret = memcmp(&fp_data[i].f.r[0], &fp_data[i].f.r[1], sizeof(fp_data[i].f.r[0]));
ret = shim_memcmp(&fp_data[i].f.r[0], &fp_data[i].f.r[1], sizeof(fp_data[i].f.r[0]));
r0 = (long double)fp_data[i].f.r[0];
r1 = (long double)fp_data[i].f.r[1];
break;
#if defined(HAVE_Float32)
case STRESS_FP_TYPE_FLOAT32:
ret = memcmp(&fp_data[i].f32.r[0], &fp_data[i].f32.r[1], sizeof(fp_data[i].f32.r[0]));
ret = shim_memcmp(&fp_data[i].f32.r[0], &fp_data[i].f32.r[1], sizeof(fp_data[i].f32.r[0]));
r0 = (long double)fp_data[i].f32.r[0];
r1 = (long double)fp_data[i].f32.r[1];
break;
#endif
#if defined(HAVE_Float64)
case STRESS_FP_TYPE_FLOAT64:
ret = memcmp(&fp_data[i].f64.r[0], &fp_data[i].f64.r[1], sizeof(fp_data[i].f64.r[0]));
ret = shim_memcmp(&fp_data[i].f64.r[0], &fp_data[i].f64.r[1], sizeof(fp_data[i].f64.r[0]));
r0 = (long double)fp_data[i].f64.r[0];
r1 = (long double)fp_data[i].f64.r[1];
break;
#endif
#if defined(HAVE__float80)
case STRESS_FP_TYPE_FLOAT80:
ret = memcmp(&fp_data[i].f80.r[0], &fp_data[i].f80.r[1], sizeof(fp_data[i].f80.r[0]));
ret = shim_memcmp(&fp_data[i].f80.r[0], &fp_data[i].f80.r[1], sizeof(fp_data[i].f80.r[0]));
r0 = (long double)fp_data[i].f80.r[0];
r1 = (long double)fp_data[i].f80.r[1];
break;
#endif
#if defined(HAVE__float128) || \
defined(HAVE_Float128)
case STRESS_FP_TYPE_FLOAT128:
ret = memcmp(&fp_data[i].f128.r[0], &fp_data[i].f128.r[1], sizeof(fp_data[i].f128.r[0]));
ret = shim_memcmp(&fp_data[i].f128.r[0], &fp_data[i].f128.r[1], sizeof(fp_data[i].f128.r[0]));
r0 = (long double)fp_data[i].f128.r[0];
r1 = (long double)fp_data[i].f128.r[1];
break;
Expand Down

0 comments on commit 171c9e0

Please sign in to comment.