Skip to content
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

Add support for float binary pattern matching #830

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

bettio
Copy link
Collaborator

@bettio bettio commented Oct 2, 2023

Allow doing:

<<Val:32/little-float>> = Bin,
<<Val2:64/big-float>> = Bin2

<<0:4, Val:64/big-float>> = Bin is not supported with this PR.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Copy link
Collaborator

@fadushin fadushin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question.

src/libAtomVM/opcodesswitch.h Outdated Show resolved Hide resolved
Add support to bs_get_float2 instruction in order to enable pattern
matching for encoded floats, such as `<<F:32/float>> = Bin`.

Float and double values must still be aligned on byte boundaries.

Signed-off-by: Davide Bettio <davide@uninstall.it>
@bettio bettio merged commit 008fe12 into atomvm:master Dec 8, 2023
83 of 84 checks passed
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.

2 participants