We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 647fc89 commit 6ce09cdCopy full SHA for 6ce09cd
core/iwasm/aot/aot_intrinsic.c
@@ -5,6 +5,8 @@
5
6
#include "aot_intrinsic.h"
7
8
+#include <float.h>
9
+
10
typedef struct {
11
const char *llvm_intrinsic;
12
const char *native_intrinsic;
@@ -425,6 +427,9 @@ int32
425
427
aot_intrinsic_f32_cmp(AOTFloatCond cond, float32 lhs, float32 rhs)
426
428
{
429
switch (cond) {
430
+ case FLOAT_EQ:
431
+ return fabsf(lhs - rhs) <= __FLT_EPSILON__ ? 1 : 0;
432
433
case FLOAT_LT:
434
return lhs < rhs ? 1 : 0;
435
@@ -453,6 +458,9 @@ int32
453
458
aot_intrinsic_f64_cmp(AOTFloatCond cond, float64 lhs, float64 rhs)
454
459
455
460
461
462
+ return fabs(lhs - rhs) <= __DBL_EPSILON__ ? 1 : 0;
463
456
464
457
465
466
0 commit comments