Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
gshift as gforce optimized shift #5205
gshift as gforce optimized shift #5205
Changes from 31 commits
5813501
13fe55c
55f5775
6364212
ad63180
4eada97
1b08e59
3437ea0
91696e5
9c88df1
5073709
db16894
60a7509
0280a45
381eaea
3187a8c
c11d9ba
98848ce
e0dd981
b591b74
d03d30e
373217f
bdc7fa0
7d63674
9e339b6
7a930ea
4a79037
9599dbe
7f9e358
9a98673
48b1775
9b9f0bb
973f749
f2e3361
f5aad19
1e5c2b3
0f766c0
a6abac3
5eec8f2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we prefer to re-use the code in shift.c here (to the extent possible)? otherwise it'll be a pain to always update code in both places going forward.
It might require some refactoring/modularizing of the original shift.c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try to recycle as much as possible but there are some different things to consider about both implementations.
memmove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe basic shift could be redirected to call gshift then? It would have to call gforce prep function first, perhaps in a dummy way to trick gshift into working. Then it would be common code and all existing tests of shift would cover the new gforce gshift too.
Perhaps not now. Happy to merge this PR as is, subject to integer64. A task could be created to redirect shift to gshift in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally I'm seeing this warning (from gcc with
-std=c99
I think but it might be due to gcc 10.3.0) :There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIC it should also work without the cast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the casting of
fill
between NA_REAL and NA_INTEGER64 though?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was just about to merge (looks awesome!) and then just saw
integer64
missed here (andtest_bit64
added to tests). Bug fix 45 startsshift(xInt64, fill=0)
so now thatshift
is optimized I wonder if theshift
problems of int64 would return. Maybe existing tests of shift int64 don't test it by group then.Can't think of anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
integer64
support. Interestingly we don't do anything special aboutinteger64
anymore inshift.c
orgshift
except usingcoerceAs
for coercing andcopyMostAttrib
for copying classinteger64
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. The
coerceAs
is forfill
butfill
isn't currently tested by the new gforce test 2224. A loop of differently typedfill
needs adding to the test then, and I suspect a specific case here for integer64 will then be needed to pass that? Can I leave that to you, and the C99 warning, hence WIP again.