14#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYMCTARGETDESC_H
15#define LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYMCTARGETDESC_H
29class MCObjectTargetWriter;
37std::unique_ptr<MCObjectTargetWriter>
40namespace WebAssembly {
93namespace WebAssemblyII {
131#define GET_REGINFO_ENUM
132#include "WebAssemblyGenRegisterInfo.inc"
136#define GET_INSTRINFO_ENUM
137#define GET_INSTRINFO_MC_HELPER_DECLS
138#include "WebAssemblyGenInstrInfo.inc"
141namespace WebAssembly {
144static const unsigned Nop = 0x01;
145static const unsigned End = 0x0b;
150#define WASM_LOAD_STORE(NAME) \
151 case WebAssembly::NAME##_A32: \
152 case WebAssembly::NAME##_A64: \
153 case WebAssembly::NAME##_A32_S: \
154 case WebAssembly::NAME##_A64_S:
276#undef WASM_LOAD_STORE
289 case WebAssembly::CONST_I32:
290 case WebAssembly::CONST_I32_S:
291 case WebAssembly::CONST_I64:
292 case WebAssembly::CONST_I64_S:
293 case WebAssembly::CONST_F32:
294 case WebAssembly::CONST_F32_S:
295 case WebAssembly::CONST_F64:
296 case WebAssembly::CONST_F64_S:
297 case WebAssembly::CONST_V128_I8x16:
298 case WebAssembly::CONST_V128_I8x16_S:
299 case WebAssembly::CONST_V128_I16x8:
300 case WebAssembly::CONST_V128_I16x8_S:
301 case WebAssembly::CONST_V128_I32x4:
302 case WebAssembly::CONST_V128_I32x4_S:
303 case WebAssembly::CONST_V128_I64x2:
304 case WebAssembly::CONST_V128_I64x2_S:
305 case WebAssembly::CONST_V128_F32x4:
306 case WebAssembly::CONST_V128_F32x4_S:
307 case WebAssembly::CONST_V128_F64x2:
308 case WebAssembly::CONST_V128_F64x2_S:
317 case WebAssembly::CONST_I32:
318 case WebAssembly::CONST_I32_S:
319 case WebAssembly::CONST_I64:
320 case WebAssembly::CONST_I64_S:
321 case WebAssembly::CONST_F32:
322 case WebAssembly::CONST_F32_S:
323 case WebAssembly::CONST_F64:
324 case WebAssembly::CONST_F64_S:
333 case WebAssembly::ARGUMENT_i32:
334 case WebAssembly::ARGUMENT_i32_S:
335 case WebAssembly::ARGUMENT_i64:
336 case WebAssembly::ARGUMENT_i64_S:
337 case WebAssembly::ARGUMENT_f32:
338 case WebAssembly::ARGUMENT_f32_S:
339 case WebAssembly::ARGUMENT_f64:
340 case WebAssembly::ARGUMENT_f64_S:
341 case WebAssembly::ARGUMENT_v16i8:
342 case WebAssembly::ARGUMENT_v16i8_S:
343 case WebAssembly::ARGUMENT_v8i16:
344 case WebAssembly::ARGUMENT_v8i16_S:
345 case WebAssembly::ARGUMENT_v4i32:
346 case WebAssembly::ARGUMENT_v4i32_S:
347 case WebAssembly::ARGUMENT_v2i64:
348 case WebAssembly::ARGUMENT_v2i64_S:
349 case WebAssembly::ARGUMENT_v8f16:
350 case WebAssembly::ARGUMENT_v8f16_S:
351 case WebAssembly::ARGUMENT_v4f32:
352 case WebAssembly::ARGUMENT_v4f32_S:
353 case WebAssembly::ARGUMENT_v2f64:
354 case WebAssembly::ARGUMENT_v2f64_S:
355 case WebAssembly::ARGUMENT_funcref:
356 case WebAssembly::ARGUMENT_funcref_S:
357 case WebAssembly::ARGUMENT_externref:
358 case WebAssembly::ARGUMENT_externref_S:
359 case WebAssembly::ARGUMENT_exnref:
360 case WebAssembly::ARGUMENT_exnref_S:
369 case WebAssembly::COPY_I32:
370 case WebAssembly::COPY_I32_S:
371 case WebAssembly::COPY_I64:
372 case WebAssembly::COPY_I64_S:
373 case WebAssembly::COPY_F32:
374 case WebAssembly::COPY_F32_S:
375 case WebAssembly::COPY_F64:
376 case WebAssembly::COPY_F64_S:
377 case WebAssembly::COPY_V128:
378 case WebAssembly::COPY_V128_S:
379 case WebAssembly::COPY_FUNCREF:
380 case WebAssembly::COPY_FUNCREF_S:
381 case WebAssembly::COPY_EXTERNREF:
382 case WebAssembly::COPY_EXTERNREF_S:
383 case WebAssembly::COPY_EXNREF:
384 case WebAssembly::COPY_EXNREF_S:
393 case WebAssembly::TEE_I32:
394 case WebAssembly::TEE_I32_S:
395 case WebAssembly::TEE_I64:
396 case WebAssembly::TEE_I64_S:
397 case WebAssembly::TEE_F32:
398 case WebAssembly::TEE_F32_S:
399 case WebAssembly::TEE_F64:
400 case WebAssembly::TEE_F64_S:
401 case WebAssembly::TEE_V128:
402 case WebAssembly::TEE_V128_S:
403 case WebAssembly::TEE_FUNCREF:
404 case WebAssembly::TEE_FUNCREF_S:
405 case WebAssembly::TEE_EXTERNREF:
406 case WebAssembly::TEE_EXTERNREF_S:
407 case WebAssembly::TEE_EXNREF:
408 case WebAssembly::TEE_EXNREF_S:
417 case WebAssembly::CALL:
418 case WebAssembly::CALL_S:
419 case WebAssembly::RET_CALL:
420 case WebAssembly::RET_CALL_S:
429 case WebAssembly::CALL_INDIRECT:
430 case WebAssembly::CALL_INDIRECT_S:
431 case WebAssembly::RET_CALL_INDIRECT:
432 case WebAssembly::RET_CALL_INDIRECT_S:
441 case WebAssembly::BR_TABLE_I32:
442 case WebAssembly::BR_TABLE_I32_S:
443 case WebAssembly::BR_TABLE_I64:
444 case WebAssembly::BR_TABLE_I64_S:
453 case WebAssembly::BLOCK:
454 case WebAssembly::BLOCK_S:
455 case WebAssembly::END_BLOCK:
456 case WebAssembly::END_BLOCK_S:
457 case WebAssembly::LOOP:
458 case WebAssembly::LOOP_S:
459 case WebAssembly::END_LOOP:
460 case WebAssembly::END_LOOP_S:
461 case WebAssembly::TRY:
462 case WebAssembly::TRY_S:
463 case WebAssembly::END_TRY:
464 case WebAssembly::END_TRY_S:
473 case WebAssembly::CATCH:
474 case WebAssembly::CATCH_S:
475 case WebAssembly::CATCH_ALL:
476 case WebAssembly::CATCH_ALL_S:
485 case WebAssembly::LOCAL_GET_I32:
486 case WebAssembly::LOCAL_GET_I32_S:
487 case WebAssembly::LOCAL_GET_I64:
488 case WebAssembly::LOCAL_GET_I64_S:
489 case WebAssembly::LOCAL_GET_F32:
490 case WebAssembly::LOCAL_GET_F32_S:
491 case WebAssembly::LOCAL_GET_F64:
492 case WebAssembly::LOCAL_GET_F64_S:
493 case WebAssembly::LOCAL_GET_V128:
494 case WebAssembly::LOCAL_GET_V128_S:
495 case WebAssembly::LOCAL_GET_FUNCREF:
496 case WebAssembly::LOCAL_GET_FUNCREF_S:
497 case WebAssembly::LOCAL_GET_EXTERNREF:
498 case WebAssembly::LOCAL_GET_EXTERNREF_S:
499 case WebAssembly::LOCAL_GET_EXNREF:
500 case WebAssembly::LOCAL_GET_EXNREF_S:
509 case WebAssembly::LOCAL_SET_I32:
510 case WebAssembly::LOCAL_SET_I32_S:
511 case WebAssembly::LOCAL_SET_I64:
512 case WebAssembly::LOCAL_SET_I64_S:
513 case WebAssembly::LOCAL_SET_F32:
514 case WebAssembly::LOCAL_SET_F32_S:
515 case WebAssembly::LOCAL_SET_F64:
516 case WebAssembly::LOCAL_SET_F64_S:
517 case WebAssembly::LOCAL_SET_V128:
518 case WebAssembly::LOCAL_SET_V128_S:
519 case WebAssembly::LOCAL_SET_FUNCREF:
520 case WebAssembly::LOCAL_SET_FUNCREF_S:
521 case WebAssembly::LOCAL_SET_EXTERNREF:
522 case WebAssembly::LOCAL_SET_EXTERNREF_S:
523 case WebAssembly::LOCAL_SET_EXNREF:
524 case WebAssembly::LOCAL_SET_EXNREF_S:
533 case WebAssembly::LOCAL_TEE_I32:
534 case WebAssembly::LOCAL_TEE_I32_S:
535 case WebAssembly::LOCAL_TEE_I64:
536 case WebAssembly::LOCAL_TEE_I64_S:
537 case WebAssembly::LOCAL_TEE_F32:
538 case WebAssembly::LOCAL_TEE_F32_S:
539 case WebAssembly::LOCAL_TEE_F64:
540 case WebAssembly::LOCAL_TEE_F64_S:
541 case WebAssembly::LOCAL_TEE_V128:
542 case WebAssembly::LOCAL_TEE_V128_S:
543 case WebAssembly::LOCAL_TEE_FUNCREF:
544 case WebAssembly::LOCAL_TEE_FUNCREF_S:
545 case WebAssembly::LOCAL_TEE_EXTERNREF:
546 case WebAssembly::LOCAL_TEE_EXTERNREF_S:
547 case WebAssembly::LOCAL_TEE_EXNREF:
548 case WebAssembly::LOCAL_TEE_EXNREF_S:
560 return Reg & INT32_MAX;
566#define GET_SUBTARGETINFO_ENUM
567#include "WebAssemblyGenSubtargetInfo.inc"
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
#define WASM_LOAD_STORE(NAME)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
TOF
Target Operand Flag enum.
bool isLocalTee(unsigned Opc)
bool isArgument(unsigned Opc)
bool isCallIndirect(unsigned Opc)
unsigned GetDefaultP2Align(unsigned Opc)
bool isMarker(unsigned Opc)
bool isBrTable(unsigned Opc)
bool isCatch(unsigned Opc)
static const unsigned UnusedReg
static const unsigned Nop
Instruction opcodes emitted via means other than CodeGen.
cl::opt< bool > WasmEnableEH
bool isCopy(unsigned Opc)
cl::opt< bool > WasmEnableSjLj
static const unsigned End
bool isConst(unsigned Opc)
cl::opt< bool > WasmEnableExnref
cl::opt< bool > WasmEnableEmEH
@ OPERAND_GLOBAL
Global index.
@ OPERAND_OFFSET64
64-bit unsigned memory offsets.
@ OPERAND_I32IMM
32-bit integer immediates.
@ OPERAND_P2ALIGN
p2align immediate for load and store address alignment.
@ OPERAND_TABLE
32-bit unsigned table number.
@ OPERAND_LOCAL
Local index.
@ OPERAND_VEC_I64IMM
64-bit vector lane immediate
@ OPERAND_VEC_I16IMM
16-bit vector lane immediate
@ OPERAND_TYPEINDEX
type signature immediate for call_indirect.
@ OPERAND_FUNCTION32
32-bit unsigned function indices.
@ OPERAND_F32IMM
32-bit floating-point immediates.
@ OPERAND_BASIC_BLOCK
Basic block label in a branch construct.
@ OPERAND_VEC_I32IMM
32-bit vector lane immediate
@ OPERAND_BRLIST
A list of branch targets for br_list.
@ OPERAND_F64IMM
64-bit floating-point immediates.
@ OPERAND_VEC_I8IMM
8-bit vector lane immediate
@ OPERAND_SIGNATURE
signature immediate for block/loop.
@ OPERAND_I64IMM
64-bit integer immediates.
@ OPERAND_OFFSET32
32-bit unsigned memory offsets.
unsigned GetDefaultP2AlignAny(unsigned Opc)
Return the default p2align value for a load or store with the given opcode.
cl::opt< bool > WasmEnableEmSjLj
bool isCallDirect(unsigned Opc)
bool isScalarConst(unsigned Opc)
unsigned getWARegStackId(unsigned Reg)
bool isLocalSet(unsigned Opc)
bool isLocalGet(unsigned Opc)
This is an optimization pass for GlobalISel generic memory operations.
MCCodeEmitter * createWebAssemblyMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)
MCAsmBackend * createWebAssemblyAsmBackend(const Triple &TT)
std::unique_ptr< MCObjectTargetWriter > createWebAssemblyWasmObjectWriter(bool Is64Bit, bool IsEmscripten)
This struct is a compact representation of a valid (non-zero power of two) alignment.