-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return unsigned integers from some signed integer functions
- Loading branch information
1 parent
c948b70
commit 0a1e745
Showing
2 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0a1e745
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 was trying to use these in a const generic way and got stuck I think because the return types all differ.
I like this change to unsigned, but is there any advantage to making each return type different over choosing a fixed unsigned integer that would be sufficient for all valid vector sizes?
0a1e745
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.
To be efficient, the return type must have the same width as the input. Functions that change the total vector size are often not very efficient. You could use
cast
to produce a uniform result type, but it will take more instructions.