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

Spec syntax, text, binary, and execution for bulk array ops #387

Merged
merged 3 commits into from
Jun 27, 2023

Conversation

tlively
Copy link
Member

@tlively tlively commented Jun 22, 2023

No description provided.

@tlively
Copy link
Member Author

tlively commented Jun 22, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Base automatically changed from exec-access-traps to main June 26, 2023 07:58
Copy link
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

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

Great, thanks!

.. math::
~\\[-1ex]
\begin{array}{l}
S; (\REFARRAYADDR~a)~(\I32.\CONST~d)~(\REFARRAYADDR~b)~(\I32.\CONST~s)~(\I32.\CONST~n)~(\ARRAYCOPY~x~y)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: b is the metavariable for bytes, so it would be better to use a1, a2 here.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

(\otherwise, \iff & F.\AMODULE.\MITYPES[x] = \TARRAY~\X{ft} \\
\land & t = \unpacktype(\X{ft}) \\
\land & b^\ast = S.\SDATAS[F.\AMODULE.\MIDATAS[y]].\DIDATA[s \slice |\X{ft}|] \\
\land & \bytes_{\X{ft}}(i) = \unpackval_{\X{ft}}(b^\ast))
Copy link
Member

Choose a reason for hiding this comment

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

Hm, something is wrong here, unpackval expects a value, not a byte sequence. Also, it expects an sx if ft is actually a packed type.

But I believe you can simply drop the unpackval, since we do not need any sign extension.

Copy link
Member Author

Choose a reason for hiding this comment

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

The semantics involve (t.const i) and produce t by unpacking the field type ft. Is (ft.const i) well-defined if we skip unpacking and use the field type directly? My guess is no, in which case we need to keep the unpacking.

This usage of unpackval was copied from the semantics of array.new_data, so whatever fix we apply here, we should apply there as well.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, you're right, that's already messed up. See #391 for a fix. I think you can do the same here.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is now fixed. PTAL!

@rossberg rossberg mentioned this pull request Jun 23, 2023
53 tasks
@tlively tlively merged commit 2b7d386 into main Jun 27, 2023
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