-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature, Use JERRY_NUMBER_TYPE_FLOAT64 to guard arithmetic with double only, always storage float as FLOAT64 #5174
Comments
The original goal of JERRY_NUMBER_TYPE_FLOAT64 == 0 build configuration is supporting platforms which doesn't have hardware accelerated double precision floating point support. For example ESP32 has only single precision floating point support, using double numbers can be done only with softfp, which is significantly slower. Of course, this configuration has drawbacks, for example loosing ECMAScript compatibility, many features, etc. |
If that's only for I have the will do sumbit a MR for that, I need to know if this is the right direction and acceptable |
Sounds good to me, but I can speak only for myself. |
This is an outdated feature from ES 5.1. Since that JS become far more complex. If somebody needs float, probably an old, ES 5.1 version of the engine is enough. From newer versions, this feature could be deleted. |
OK let's me delete it first |
Currently, the
JERRY_NUMBER_TYPE_FLOAT64 == 0
have too much drawback because it's can not represent full int32_t, so indeedall bitwise operation is invalid when
JERRY_NUMBER_TYPE_FLOAT64 == 0
, if JERRY_NUMBER_TYPE_FLOAT64 is not for save memory,then we can use float do arithmatic but use double do storage.
From my point of view,
ECMA_TYPE_FLOAT = 2, /**< pointer to a 64 or 32 bit floating point number */
can not save memory memory, because the minimal alignment of pointer is 8, so the size of allocated address minimal is 8, the
JERRY_NUMBER_TYPE_FLOAT64 == 0
can not save memory, only increase performance.So my will is only use
JERRY_NUMBER_TYPE_FLOAT64 == 0
to do floating arithmetic, but usedouble
to do storage.The text was updated successfully, but these errors were encountered: