OLD | NEW |
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 #ifndef V8_WASM_MACRO_GEN_H_ | 5 #ifndef V8_WASM_MACRO_GEN_H_ |
6 #define V8_WASM_MACRO_GEN_H_ | 6 #define V8_WASM_MACRO_GEN_H_ |
7 | 7 |
8 #include "src/wasm/wasm-opcodes.h" | 8 #include "src/wasm/wasm-opcodes.h" |
9 | 9 |
10 #include "src/zone/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 static_cast<byte>(((static_cast<int64_t>(val) >> 49) & MASK_7) | 0x80), \ | 365 static_cast<byte>(((static_cast<int64_t>(val) >> 49) & MASK_7) | 0x80), \ |
366 static_cast<byte>(((static_cast<int64_t>(val) >> 56) & MASK_7) | 0x80), \ | 366 static_cast<byte>(((static_cast<int64_t>(val) >> 56) & MASK_7) | 0x80), \ |
367 static_cast<byte>((static_cast<int64_t>(val) >> 63) & MASK_7) | 367 static_cast<byte>((static_cast<int64_t>(val) >> 63) & MASK_7) |
368 | 368 |
369 #define WASM_F32(val) \ | 369 #define WASM_F32(val) \ |
370 kExprF32Const, \ | 370 kExprF32Const, \ |
371 static_cast<byte>(bit_cast<int32_t>(static_cast<float>(val))), \ | 371 static_cast<byte>(bit_cast<int32_t>(static_cast<float>(val))), \ |
372 static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 8), \ | 372 static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 8), \ |
373 static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 16), \ | 373 static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 16), \ |
374 static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 24) | 374 static_cast<byte>(bit_cast<uint32_t>(static_cast<float>(val)) >> 24) |
375 #define WASM_F64(val) \ | 375 #define WASM_F64(val) \ |
376 kExprF64Const, static_cast<byte>(bit_cast<uint64_t>(val)), \ | 376 kExprF64Const, \ |
377 static_cast<byte>(bit_cast<uint64_t>(val) >> 8), \ | 377 static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val))), \ |
378 static_cast<byte>(bit_cast<uint64_t>(val) >> 16), \ | 378 static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 8), \ |
379 static_cast<byte>(bit_cast<uint64_t>(val) >> 24), \ | 379 static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 16), \ |
380 static_cast<byte>(bit_cast<uint64_t>(val) >> 32), \ | 380 static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 24), \ |
381 static_cast<byte>(bit_cast<uint64_t>(val) >> 40), \ | 381 static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 32), \ |
382 static_cast<byte>(bit_cast<uint64_t>(val) >> 48), \ | 382 static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 40), \ |
383 static_cast<byte>(bit_cast<uint64_t>(val) >> 56) | 383 static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 48), \ |
| 384 static_cast<byte>(bit_cast<uint64_t>(static_cast<double>(val)) >> 56) |
384 #define WASM_GET_LOCAL(index) kExprGetLocal, static_cast<byte>(index) | 385 #define WASM_GET_LOCAL(index) kExprGetLocal, static_cast<byte>(index) |
385 #define WASM_SET_LOCAL(index, val) val, kExprSetLocal, static_cast<byte>(index) | 386 #define WASM_SET_LOCAL(index, val) val, kExprSetLocal, static_cast<byte>(index) |
386 #define WASM_TEE_LOCAL(index, val) val, kExprTeeLocal, static_cast<byte>(index) | 387 #define WASM_TEE_LOCAL(index, val) val, kExprTeeLocal, static_cast<byte>(index) |
387 #define WASM_DROP kExprDrop | 388 #define WASM_DROP kExprDrop |
388 #define WASM_GET_GLOBAL(index) kExprGetGlobal, static_cast<byte>(index) | 389 #define WASM_GET_GLOBAL(index) kExprGetGlobal, static_cast<byte>(index) |
389 #define WASM_SET_GLOBAL(index, val) \ | 390 #define WASM_SET_GLOBAL(index, val) \ |
390 val, kExprSetGlobal, static_cast<byte>(index) | 391 val, kExprSetGlobal, static_cast<byte>(index) |
391 #define WASM_LOAD_MEM(type, index) \ | 392 #define WASM_LOAD_MEM(type, index) \ |
392 index, static_cast<byte>( \ | 393 index, static_cast<byte>( \ |
393 v8::internal::wasm::WasmOpcodes::LoadStoreOpcodeOf(type, false)), \ | 394 v8::internal::wasm::WasmOpcodes::LoadStoreOpcodeOf(type, false)), \ |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) | 671 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) |
671 #define WASM_BRV_IF(depth, val, cond) \ | 672 #define WASM_BRV_IF(depth, val, cond) \ |
672 val, cond, kExprBrIf, static_cast<byte>(depth) | 673 val, cond, kExprBrIf, static_cast<byte>(depth) |
673 #define WASM_BRV_IFD(depth, val, cond) \ | 674 #define WASM_BRV_IFD(depth, val, cond) \ |
674 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop | 675 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop |
675 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd | 676 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd |
676 #define WASM_BR_TABLEV(val, key, count, ...) \ | 677 #define WASM_BR_TABLEV(val, key, count, ...) \ |
677 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ | 678 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ |
678 | 679 |
679 #endif // V8_WASM_MACRO_GEN_H_ | 680 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |