Skip to content

Commit

Permalink
Implement more Float32 support
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSant0s committed Jun 28, 2023
1 parent f05e6d8 commit 756c119
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/quickjs/quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -14432,10 +14432,10 @@ static no_inline __exception int js_unary_arith_slow(JSContext *ctx,
f = JS_VALUE_GET_FLOAT32(op1);
switch(op) {
case OP_inc:
f++;
f+=1.0f;
break;
case OP_dec:
f--;
f-=1.0f;
break;
case OP_plus:
break;
Expand Down Expand Up @@ -36169,6 +36169,15 @@ static JSValue JS_ReadObjectRec(BCReaderState *s)
obj = __JS_NewFloat64(ctx, u.d);
}
break;
case BC_TAG_FLOAT32:
{
JSFloat32Union u;
if (bc_get_u32(s, &u.u32))
return JS_EXCEPTION;
bc_read_trace(s, "%g\n", u.f);
obj = custom_JS_NewFloat32(ctx, u.f);
}
break;
case BC_TAG_STRING:
{
JSString *p;
Expand Down

0 comments on commit 756c119

Please sign in to comment.