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

Side by Side Diff: src/wasm/asm-wasm-builder.cc

Issue 1804243003: Fix conversion to float32, typing issue, split apart asm-wasm tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/typing-asm.cc ('k') | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/v8.h" 5 #include "src/v8.h"
6 6
7 // Required to get M_E etc. in MSVC. 7 // Required to get M_E etc. in MSVC.
8 #if defined(_WIN32) 8 #if defined(_WIN32)
9 #define _USE_MATH_DEFINES 9 #define _USE_MATH_DEFINES
10 #endif 10 #endif
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 DCHECK(args->length() == 1); 990 DCHECK(args->length() == 1);
991 Literal* literal = args->at(0)->AsLiteral(); 991 Literal* literal = args->at(0)->AsLiteral();
992 if (literal != nullptr) { 992 if (literal != nullptr) {
993 if (literal->raw_value()->IsNumber()) { 993 if (literal->raw_value()->IsNumber()) {
994 float val = static_cast<float>(literal->raw_value()->AsNumber()); 994 float val = static_cast<float>(literal->raw_value()->AsNumber());
995 byte code[] = {WASM_F32(val)}; 995 byte code[] = {WASM_F32(val)};
996 current_function_builder_->EmitCode(code, sizeof(code)); 996 current_function_builder_->EmitCode(code, sizeof(code));
997 return true; 997 return true;
998 } 998 }
999 } 999 }
1000 switch (TypeIndexOf(args->at(0))) {
1001 case kInt32:
1002 case kFixnum:
1003 current_function_builder_->Emit(kExprF32SConvertI32);
1004 break;
1005 case kUint32:
1006 current_function_builder_->Emit(kExprF32UConvertI32);
1007 break;
1008 case kFloat32:
1009 break;
1010 case kFloat64:
1011 current_function_builder_->Emit(kExprF32ConvertF64);
1012 break;
1013 default:
1014 UNREACHABLE();
1015 }
1000 break; 1016 break;
1001 } 1017 }
1002 default: { 1018 default: {
1003 UNREACHABLE(); 1019 UNREACHABLE();
1004 break; 1020 break;
1005 } 1021 }
1006 } 1022 }
1007 VisitCallArgs(call); 1023 VisitCallArgs(call);
1008 return true; 1024 return true;
1009 } 1025 }
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 // that zone in constructor may be thrown away once wasm module is written. 1534 // that zone in constructor may be thrown away once wasm module is written.
1519 WasmModuleIndex* AsmWasmBuilder::Run() { 1535 WasmModuleIndex* AsmWasmBuilder::Run() {
1520 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_); 1536 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_);
1521 impl.Compile(); 1537 impl.Compile();
1522 WasmModuleWriter* writer = impl.builder_->Build(zone_); 1538 WasmModuleWriter* writer = impl.builder_->Build(zone_);
1523 return writer->WriteTo(zone_); 1539 return writer->WriteTo(zone_);
1524 } 1540 }
1525 } // namespace wasm 1541 } // namespace wasm
1526 } // namespace internal 1542 } // namespace internal
1527 } // namespace v8 1543 } // namespace v8
OLDNEW
« no previous file with comments | « src/typing-asm.cc ('k') | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698