Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: src/asmjs/asm-typer.cc

Issue 2200213002: asm.js. Adds support for clz32 in asm.js. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addresses comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/asmjs/asm-typer.h ('k') | src/asmjs/asm-wasm-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-typer.cc
diff --git a/src/asmjs/asm-typer.cc b/src/asmjs/asm-typer.cc
index 80f296052f16279531c4b42b67820cd3e12241db..031d901797c1bfd4077a248d89630b9ab5d6f753 100644
--- a/src/asmjs/asm-typer.cc
+++ b/src/asmjs/asm-typer.cc
@@ -178,6 +178,9 @@ void AsmTyper::InitializeStdlib() {
s2s->AsFunctionType()->AddArgument(s);
auto* i = AsmType::Int();
+ auto* i2s = AsmType::Function(zone_, s);
+ i2s->AsFunctionType()->AddArgument(i);
+
auto* ii2s = AsmType::Function(zone_, s);
ii2s->AsFunctionType()->AddArgument(i);
ii2s->AsFunctionType()->AddArgument(i);
@@ -248,6 +251,10 @@ void AsmTyper::InitializeStdlib() {
{"SQRT1_2", kMathSQRT1_2, d},
{"imul", kMathImul, ii2s},
{"abs", kMathAbs, abs},
+ // NOTE: clz32 should return fixnum. The current typer can only return
+ // Signed, Float, or Double, so it returns Signed in our version of
+ // asm.js.
+ {"clz32", kMathClz32, i2s},
{"ceil", kMathCeil, ceil},
{"floor", kMathFloor, floor},
{"fround", kMathFround, fround},
« no previous file with comments | « src/asmjs/asm-typer.h ('k') | src/asmjs/asm-wasm-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698