-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add imuldw function #220
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 imuldw function #220
Conversation
kgryte
left a comment
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.
@rei2hu Just minor nitpicks, and then should be ready for merge!
|
|
||
| #### imuldw( \[out,\] a, b ) | ||
|
|
||
| > Multiplies two signed 32-bit integers and returns an array of two signed 32-bit integers which represents the 64-bit signed integer product. |
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.
| > Multiplies two signed 32-bit integers and returns an array of two signed 32-bit integers which represents the 64-bit signed integer product. | |
| Multiplies two signed 32-bit integers and returns an array of two signed 32-bit integers which represents the 64-bit signed integer product. |
| var imuldw = require( '@stdlib/math/base/special/imuldw' ); | ||
| ``` | ||
|
|
||
| #### imuldw( \[out,\] a, b ) |
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.
| #### imuldw( \[out,\] a, b ) | |
| #### imuldw( \[out,] a, b ) |
Only the first bracket needs to be escaped.
| @@ -0,0 +1,30 @@ | |||
|
|
|||
| {{alias}}( [out,] a, b ) | |||
| Multiplies two unsigned 32-bit integers and returns an array of two | |||
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.
| Multiplies two unsigned 32-bit integers and returns an array of two | |
| Multiplies two signed 32-bit integers and returns an array of two signed |
|
|
||
| {{alias}}( [out,] a, b ) | ||
| Multiplies two unsigned 32-bit integers and returns an array of two | ||
| unsigned 32-bit integers which represents the 64-bit unsigned integer |
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.
| unsigned 32-bit integers which represents the 64-bit unsigned integer | |
| 32-bit integers which represents the 64-bit signed integer product. |
| {{alias}}( [out,] a, b ) | ||
| Multiplies two unsigned 32-bit integers and returns an array of two | ||
| unsigned 32-bit integers which represents the 64-bit unsigned integer | ||
| product. |
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.
| product. |
You'll want to check that the lines are the proper width, but I believe the edits above should be correct.
| t = ( ( la * hb ) + w2 ) >>> 0; | ||
| k = ( t >> 16 ) >>> 0; | ||
|
|
||
| out[0] = ( ( ha * hb ) + w1 + k ) | 0; // the higher 32 bits; convert to signed 32 bit |
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.
| out[0] = ( ( ha * hb ) + w1 + k ) | 0; // the higher 32 bits; convert to signed 32 bit | |
| out[ 0 ] = ( ( ha * hb ) + w1 + k ) | 0; // the higher 32 bits; convert to signed 32 bit |
| k = ( t >> 16 ) >>> 0; | ||
|
|
||
| out[0] = ( ( ha * hb ) + w1 + k ) | 0; // the higher 32 bits; convert to signed 32 bit | ||
| out[1] = ( ( t << 16 ) + w3 ) | 0; // the lower 32 bits; convert to signed 32 bit |
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.
| out[1] = ( ( t << 16 ) + w3 ) | 0; // the lower 32 bits; convert to signed 32 bit | |
| out[ 1 ] = ( ( t << 16 ) + w3 ) | 0; // the lower 32 bits; convert to signed 32 bit |
| "stdmath", | ||
| "mathematics", | ||
| "math", | ||
| "math.imuldw", |
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.
| "math.imuldw", |
|
|
||
| fprintf( f, "\"expected\":[" ); | ||
| for ( i = 0; i < len; i++ ) { | ||
| // write an unnamed array |
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.
| // write an unnamed array |
lib/node_modules/@stdlib/math/base/special/imuldw/test/fixtures/c/runner.c
Outdated
Show resolved
Hide resolved
|
@rei2hu Would you mind pulling in the latest changes to |
kgryte
left a comment
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.
@rei2hu Thanks for working on this!
|
Will merge pending CircleCI. :) |
|
The CircleCI failure is due to an unrelated flaky test. Merging... :) |
Resolves #206.
Checklist
develop.developbranch.Description
This pull request:
Related Issues
This pull request:
Questions
No.
Other
No.
@stdlib-js/reviewers