-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Implement some missing maths-related intrinsics #4095
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1746,6 +1746,11 @@ if (!Math['clz32']) Math['clz32'] = function(x) { | |
}; | ||
Math.clz32 = Math['clz32'] | ||
|
||
if (!Math['trunc']) Math['trunc'] = function(x) { | ||
return x < 0 ? Math.ceil(x) : Math.floor(x); | ||
}; | ||
Math.trunc = Math['trunc']; | ||
|
||
var Math_abs = Math.abs; | ||
var Math_cos = Math.cos; | ||
var Math_sin = Math.sin; | ||
|
@@ -1764,6 +1769,7 @@ var Math_imul = Math.imul; | |
var Math_fround = Math.fround; | ||
var Math_min = Math.min; | ||
var Math_clz32 = Math.clz32; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since |
||
var Math_trunc = Math.trunc; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kripken: why do we do this kind of redirection btw? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We actually might not need this any more, since we do it in the asm scope. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to add this line, otherwise I got an error because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, must be somewhere that depends on it, that we can probably remove. But not a problem for this pr anyhow. |
||
|
||
// A counter of dependencies for calling run(). If we need to | ||
// do asynchronous work before running, increment this and | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,9 @@ c5,de,15,8a | |
22 | ||
13 | ||
72057594037927936 | ||
125 | ||
243 | ||
18 | ||
-12 | ||
27 | ||
-9 |
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.
Are there such things as
llvm_trunc_f32
andllvm_floor_f32
? If so, could add those as well?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.
Will do.