Skip to content

Feature, Use JERRY_NUMBER_TYPE_FLOAT64 to guard arithmetic with double only, always storage float as FLOAT64 #5174

Open
@lygstate

Description

@lygstate

Currently, the JERRY_NUMBER_TYPE_FLOAT64 == 0 have too much drawback because it's can not represent full int32_t, so indeed
all 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 use double to do storage.

Metadata

Metadata

Assignees

Labels

discussionOngoing discussionecma coreRelated to core ECMA functionalityfeature requestRequested feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions