Skip to content

Conversation

bnoordhuis
Copy link
Contributor

There was no definition of the macro for compilers that were not gcc, clang or msvc. While it would be easy to add one, a better approach is to switch to memcpy() and avoid type punning altogether.

Fixes: #270

There was no definition of the macro for compilers that were not gcc,
clang or msvc. While it would be easy to add one, a better approach is
to switch to memcpy() and avoid type punning altogether.

Fixes: quickjs-ng#270
@bnoordhuis bnoordhuis merged commit 56d6002 into quickjs-ng:master Feb 18, 2024
@bnoordhuis bnoordhuis deleted the fix270 branch February 18, 2024 12:39
@chqrlie
Copy link
Collaborator

chqrlie commented Feb 18, 2024

The PACK macro was ugly indeed. Does the assembly look good in the code generator?

@bnoordhuis
Copy link
Contributor Author

Yes, it's pretty much what you'd expect on x86: a single load or store.

(You have to look pretty hard because the get and put functions all get inlined themselves too.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commit 48e4c63a breaks tcc build

3 participants