Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/asmjs/asm-typer.h" | 5 #include "src/asmjs/asm-typer.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <limits> | 8 #include <limits> | 
| 9 #include <memory> | 9 #include <memory> | 
| 10 #include <string> | 10 #include <string> | 
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 auto* f = AsmType::Float(); | 171 auto* f = AsmType::Float(); | 
| 172 auto* fq = AsmType::FloatQ(); | 172 auto* fq = AsmType::FloatQ(); | 
| 173 auto* fq2f = AsmType::Function(zone_, f); | 173 auto* fq2f = AsmType::Function(zone_, f); | 
| 174 fq2f->AsFunctionType()->AddArgument(fq); | 174 fq2f->AsFunctionType()->AddArgument(fq); | 
| 175 | 175 | 
| 176 auto* s = AsmType::Signed(); | 176 auto* s = AsmType::Signed(); | 
| 177 auto* s2s = AsmType::Function(zone_, s); | 177 auto* s2s = AsmType::Function(zone_, s); | 
| 178 s2s->AsFunctionType()->AddArgument(s); | 178 s2s->AsFunctionType()->AddArgument(s); | 
| 179 | 179 | 
| 180 auto* i = AsmType::Int(); | 180 auto* i = AsmType::Int(); | 
| 181 auto* i2s = AsmType::Function(zone_, s); | |
| 182 i2s->AsFunctionType()->AddArgument(i); | |
| 183 | |
| 181 auto* ii2s = AsmType::Function(zone_, s); | 184 auto* ii2s = AsmType::Function(zone_, s); | 
| 182 ii2s->AsFunctionType()->AddArgument(i); | 185 ii2s->AsFunctionType()->AddArgument(i); | 
| 183 ii2s->AsFunctionType()->AddArgument(i); | 186 ii2s->AsFunctionType()->AddArgument(i); | 
| 184 | 187 | 
| 185 auto* minmax_d = AsmType::MinMaxType(zone_, d, d); | 188 auto* minmax_d = AsmType::MinMaxType(zone_, d, d); | 
| 186 // *VIOLATION* The float variant is not part of the spec, but firefox accepts | 189 // *VIOLATION* The float variant is not part of the spec, but firefox accepts | 
| 187 // it. | 190 // it. | 
| 188 auto* minmax_f = AsmType::MinMaxType(zone_, f, f); | 191 auto* minmax_f = AsmType::MinMaxType(zone_, f, f); | 
| 189 auto* minmax_i = AsmType::MinMaxType(zone_, s, i); | 192 auto* minmax_i = AsmType::MinMaxType(zone_, s, i); | 
| 190 auto* minmax = AsmType::OverloadedFunction(zone_); | 193 auto* minmax = AsmType::OverloadedFunction(zone_); | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 {"PI", kMathPI, d}, | 244 {"PI", kMathPI, d}, | 
| 242 {"E", kMathE, d}, | 245 {"E", kMathE, d}, | 
| 243 {"LN2", kMathLN2, d}, | 246 {"LN2", kMathLN2, d}, | 
| 244 {"LN10", kMathLN10, d}, | 247 {"LN10", kMathLN10, d}, | 
| 245 {"LOG2E", kMathLOG2E, d}, | 248 {"LOG2E", kMathLOG2E, d}, | 
| 246 {"LOG10E", kMathLOG10E, d}, | 249 {"LOG10E", kMathLOG10E, d}, | 
| 247 {"SQRT2", kMathSQRT2, d}, | 250 {"SQRT2", kMathSQRT2, d}, | 
| 248 {"SQRT1_2", kMathSQRT1_2, d}, | 251 {"SQRT1_2", kMathSQRT1_2, d}, | 
| 249 {"imul", kMathImul, ii2s}, | 252 {"imul", kMathImul, ii2s}, | 
| 250 {"abs", kMathAbs, abs}, | 253 {"abs", kMathAbs, abs}, | 
| 254 {"clz32", kMathClz32, i2s}, // NOTE: clz32 should return fixnum. | |
| 
 
bradnelson
2016/08/02 18:06:43
Maybe describe why we're not, for someone missing
 
John
2016/08/02 18:10:54
Done.
 
 | |
| 251 {"ceil", kMathCeil, ceil}, | 255 {"ceil", kMathCeil, ceil}, | 
| 252 {"floor", kMathFloor, floor}, | 256 {"floor", kMathFloor, floor}, | 
| 253 {"fround", kMathFround, fround}, | 257 {"fround", kMathFround, fround}, | 
| 254 {"pow", kMathPow, dqdq2d}, | 258 {"pow", kMathPow, dqdq2d}, | 
| 255 {"exp", kMathExp, dq2d}, | 259 {"exp", kMathExp, dq2d}, | 
| 256 {"log", kMathLog, dq2d}, | 260 {"log", kMathLog, dq2d}, | 
| 257 {"min", kMathMin, minmax}, | 261 {"min", kMathMin, minmax}, | 
| 258 {"max", kMathMax, minmax}, | 262 {"max", kMathMax, minmax}, | 
| 259 {"sqrt", kMathSqrt, sqrt}, | 263 {"sqrt", kMathSqrt, sqrt}, | 
| 260 {"cos", kMathCos, dq2d}, | 264 {"cos", kMathCos, dq2d}, | 
| (...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2737 return true; | 2741 return true; | 
| 2738 } | 2742 } | 
| 2739 | 2743 | 
| 2740 *error_message = typer.error_message(); | 2744 *error_message = typer.error_message(); | 
| 2741 return false; | 2745 return false; | 
| 2742 } | 2746 } | 
| 2743 | 2747 | 
| 2744 } // namespace wasm | 2748 } // namespace wasm | 
| 2745 } // namespace internal | 2749 } // namespace internal | 
| 2746 } // namespace v8 | 2750 } // namespace v8 | 
| OLD | NEW |