Home
last modified time | relevance | path

Searched refs:WebAssembly (Results 1 – 25 of 111) sorted by relevance

12345

/freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/MCTargetDesc/
H A DWebAssemblyMCTargetDesc.h40 namespace WebAssembly {
141 namespace WebAssembly {
151 case WebAssembly::NAME##_A32: \ in GetDefaultP2AlignAny()
152 case WebAssembly::NAME##_A64: \ in GetDefaultP2AlignAny()
153 case WebAssembly::NAME##_A32_S: \ in GetDefaultP2AlignAny()
154 case WebAssembly::NAME##_A64_S: in GetDefaultP2AlignAny()
289 case WebAssembly::CONST_I32: in isConst()
290 case WebAssembly::CONST_I32_S: in isConst()
291 case WebAssembly::CONST_I64: in isConst()
292 case WebAssembly::CONST_I64_S: in isConst()
[all …]
H A DWebAssemblyMCTypeUtilities.cpp20 std::optional<wasm::ValType> WebAssembly::parseType(StringRef Type) { in parseType()
34 WebAssembly::BlockType WebAssembly::parseBlockType(StringRef Type) { in parseBlockType()
36 return StringSwitch<WebAssembly::BlockType>(Type) in parseBlockType()
37 .Case("i32", WebAssembly::BlockType::I32) in parseBlockType()
38 .Case("i64", WebAssembly::BlockType::I64) in parseBlockType()
39 .Case("f32", WebAssembly::BlockType::F32) in parseBlockType()
40 .Case("f64", WebAssembly::BlockType::F64) in parseBlockType()
41 .Case("v128", WebAssembly::BlockType::V128) in parseBlockType()
42 .Case("funcref", WebAssembly::BlockType::Funcref) in parseBlockType()
43 .Case("externref", WebAssembly::BlockType::Externref) in parseBlockType()
[all …]
H A DWebAssemblyMCCodeEmitter.cpp1 //=- WebAssemblyMCCodeEmitter.cpp - Convert WebAssembly code to machine code -//
85 if (MI.getOpcode() == WebAssembly::BR_TABLE_I32_S || in encodeInstruction()
86 MI.getOpcode() == WebAssembly::BR_TABLE_I64_S) in encodeInstruction()
88 if (MI.getOpcode() == WebAssembly::BR_TABLE_I32 || in encodeInstruction()
89 MI.getOpcode() == WebAssembly::BR_TABLE_I64) in encodeInstruction()
104 case WebAssembly::OPERAND_I32IMM: in encodeInstruction()
107 case WebAssembly::OPERAND_OFFSET32: in encodeInstruction()
110 case WebAssembly::OPERAND_I64IMM: in encodeInstruction()
113 case WebAssembly::OPERAND_SIGNATURE: in encodeInstruction()
114 case WebAssembly in encodeInstruction()
[all...]
H A DWebAssemblyInstPrinter.cpp1 //=- WebAssemblyInstPrinter.cpp - WebAssembly assembly instruction printing -=//
17 #include "WebAssembly.h"
43 assert(Reg.id() != WebAssembly::UnusedReg); in printRegName()
53 case WebAssembly::CALL_INDIRECT_S: in printInst()
54 case WebAssembly::RET_CALL_INDIRECT_S: { in printInst()
97 if (MI->getOpcode() == WebAssembly::CALL_INDIRECT && in printInst()
121 case WebAssembly::LOOP: in printInst()
122 case WebAssembly::LOOP_S: in printInst()
127 case WebAssembly::BLOCK: in printInst()
128 case WebAssembly in printInst()
[all...]
/freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/
H A DWebAssemblyExplicitLocals.cpp89 if (RC == &WebAssembly::I32RegClass) in getDropOpcode()
90 return WebAssembly::DROP_I32; in getDropOpcode()
91 if (RC == &WebAssembly::I64RegClass) in getDropOpcode()
92 return WebAssembly::DROP_I64; in getDropOpcode()
93 if (RC == &WebAssembly::F32RegClass) in getDropOpcode()
94 return WebAssembly::DROP_F32; in getDropOpcode()
95 if (RC == &WebAssembly::F64RegClass) in getDropOpcode()
96 return WebAssembly::DROP_F64; in getDropOpcode()
97 if (RC == &WebAssembly::V128RegClass) in getDropOpcode()
98 return WebAssembly::DROP_V128; in getDropOpcode()
[all …]
H A DWebAssemblyUtilities.cpp24 const char *const WebAssembly::CxaBeginCatchFn = "__cxa_begin_catch";
25 const char *const WebAssembly::CxaRethrowFn = "__cxa_rethrow";
26 const char *const WebAssembly::StdTerminateFn = "_ZSt9terminatev";
27 const char *const WebAssembly::PersonalityWrapperFn =
31 bool WebAssembly::isChild(const MachineInstr &MI, in isChild()
42 bool WebAssembly::mayThrow(const MachineInstr &MI) { in mayThrow()
44 case WebAssembly::THROW: in mayThrow()
45 case WebAssembly::THROW_S: in mayThrow()
46 case WebAssembly::RETHROW: in mayThrow()
47 case WebAssembly::RETHROW_S: in mayThrow()
[all …]
H A DWebAssemblyFastISel.cpp391 Reg = createResultReg(Subtarget->hasAddr64() ? &WebAssembly::I64RegClass in materializeLoadStoreOperands()
392 : &WebAssembly::I32RegClass); in materializeLoadStoreOperands()
393 unsigned Opc = Subtarget->hasAddr64() ? WebAssembly::CONST_I64 in materializeLoadStoreOperands()
394 : WebAssembly::CONST_I32; in materializeLoadStoreOperands()
466 Register Imm = createResultReg(&WebAssembly::I32RegClass); in zeroExtendToI32()
468 TII.get(WebAssembly::CONST_I32), Imm) in zeroExtendToI32()
471 Register Result = createResultReg(&WebAssembly::I32RegClass); in zeroExtendToI32()
473 TII.get(WebAssembly::AND_I32), Result) in zeroExtendToI32()
496 Register Imm = createResultReg(&WebAssembly::I32RegClass); in signExtendToI32()
498 TII.get(WebAssembly::CONST_I32), Imm) in signExtendToI32()
[all …]
H A DWebAssemblyInstrInfo.cpp1 //===-- WebAssemblyInstrInfo.cpp - WebAssembly Instruction Information ----===//
10 /// This file contains the WebAssembly implementation of the
17 #include "WebAssembly.h"
32 // defines WebAssembly::getNamedOperandIdx
37 : WebAssemblyGenInstrInfo(WebAssembly::ADJCALLSTACKDOWN, in WebAssemblyInstrInfo()
38 WebAssembly::ADJCALLSTACKUP, in WebAssemblyInstrInfo()
39 WebAssembly::CATCHRET), in WebAssemblyInstrInfo()
45 case WebAssembly::CONST_I32: in isReallyTriviallyReMaterializable()
46 case WebAssembly::CONST_I64: in isReallyTriviallyReMaterializable()
47 case WebAssembly in isReallyTriviallyReMaterializable()
[all...]
H A DWebAssemblyRegStackify.cpp84 if (!MI->definesRegister(WebAssembly::VALUE_STACK, /*TRI=*/nullptr)) in imposeStackOrdering()
85 MI->addOperand(MachineOperand::CreateReg(WebAssembly::VALUE_STACK, in imposeStackOrdering()
90 if (!MI->readsRegister(WebAssembly::VALUE_STACK, /*TRI=*/nullptr)) in imposeStackOrdering()
91 MI->addOperand(MachineOperand::CreateReg(WebAssembly::VALUE_STACK, in imposeStackOrdering()
106 if (RegClass == &WebAssembly::I32RegClass) { in convertImplicitDefToConstZero()
107 MI->setDesc(TII->get(WebAssembly::CONST_I32)); in convertImplicitDefToConstZero()
109 } else if (RegClass == &WebAssembly::I64RegClass) { in convertImplicitDefToConstZero()
110 MI->setDesc(TII->get(WebAssembly::CONST_I64)); in convertImplicitDefToConstZero()
112 } else if (RegClass == &WebAssembly::F32RegClass) { in convertImplicitDefToConstZero()
113 MI->setDesc(TII->get(WebAssembly::CONST_F32)); in convertImplicitDefToConstZero()
[all …]
H A DWebAssemblyCFGStackify.cpp39 using WebAssembly::SortRegionInfo;
304 if (MI.getOpcode() == WebAssembly::LOOP) { in placeBlockMarker()
318 if (MI.getOpcode() == WebAssembly::BLOCK || in placeBlockMarker()
319 MI.getOpcode() == WebAssembly::TRY) { in placeBlockMarker()
330 if (MI.getOpcode() == WebAssembly::END_BLOCK || in placeBlockMarker()
331 MI.getOpcode() == WebAssembly::END_LOOP || in placeBlockMarker()
332 MI.getOpcode() == WebAssembly::END_TRY) in placeBlockMarker()
346 if (WebAssembly::isChild(*std::prev(I), MFI)) in placeBlockMarker()
353 WebAssembly::BlockType ReturnType = WebAssembly::BlockType::Void; in placeBlockMarker()
357 TII.get(WebAssembly::BLOCK)) in placeBlockMarker()
[all …]
H A DWebAssemblyRegisterInfo.cpp47 for (auto Reg : {WebAssembly::SP32, WebAssembly::SP64, WebAssembly::FP32, in getReservedRegs()
48 WebAssembly::FP64}) in getReservedRegs()
73 unsigned AddrOperandNum = WebAssembly::getNamedOperandIdx( in eliminateFrameIndex()
74 MI.getOpcode(), WebAssembly::OpName::addr); in eliminateFrameIndex()
76 unsigned OffsetOperandNum = WebAssembly::getNamedOperandIdx( in eliminateFrameIndex()
77 MI.getOpcode(), WebAssembly::OpName::off); in eliminateFrameIndex()
147 /* !hasFP */ {WebAssembly::SP32, WebAssembly::SP64}, in getFrameRegister()
148 /* hasFP */ {WebAssembly::FP32, WebAssembly::FP64}}; in getFrameRegister()
158 return &WebAssembly::I64RegClass; in getPointerRegClass()
159 return &WebAssembly::I32RegClass; in getPointerRegClass()
H A DWebAssemblyFrameLowering.cpp1 //===-- WebAssemblyFrameLowering.cpp - WebAssembly Frame Lowering ----------==//
10 /// This file contains the WebAssembly implementation of
13 /// On WebAssembly, there aren't a lot of things to do here. There are no
23 #include "WebAssembly.h"
65 if (!AI || !WebAssembly::isWasmVarAddressSpace(AI->getAddressSpace())) in getLocalForStackObject()
79 // Allocate WebAssembly locals for each non-aggregate component of the in getLocalForStackObject()
83 // Abuse object size to record number of WebAssembly locals allocated to in getLocalForStackObject()
183 ? WebAssembly::SP64 in getFPReg()
184 : WebAssembly::SP32;
189 ? WebAssembly in getOpcConst()
[all...]
H A DWebAssemblyAsmPrinter.cpp80 assert(WAReg != WebAssembly::UnusedReg); in regToString()
167 WebAssembly::signatureToString(Sig); in getMCSymbolForFunction()
179 if (!WebAssembly::isWasmVarAddressSpace(GV->getAddressSpace())) { in emitGlobalVariable()
201 WebAssembly::wasmSymbolSetType(Sym, GlobalVT, VTs); in emitGlobalVariable()
270 WebAssembly::getLibcallSignature(Subtarget, Name, Returns, Params); in getOrCreateWasmSymbol()
347 &F, WebAssembly::WasmEnableEmEH || WebAssembly::WasmEnableEmSjLj, in emitDecls()
405 WebAssembly::getOrCreateFunctionTableSymbol(OutContext, Subtarget); in emitEndOfAsmFile()
413 !WebAssembly::isWasmVarAddressSpace(G.getAddressSpace()) && in emitEndOfAsmFile()
648 case WebAssembly::ARGUMENT_i32: in emitInstruction()
649 case WebAssembly::ARGUMENT_i32_S: in emitInstruction()
[all …]
H A DWebAssemblyMCInstLower.cpp53 if (WebAssembly::isWasmVarAddressSpace(Global->getAddressSpace()) && in GetGlobalAddressSymbol()
62 WebAssembly::wasmSymbolSetType(WasmSym, GlobalVT, VTs); in GetGlobalAddressSymbol()
80 F, WebAssembly::WasmEnableEmEH || WebAssembly::WasmEnableEmSjLj, in GetGlobalAddressSymbol()
197 if (Info.OperandType == WebAssembly::OPERAND_TYPEINDEX) { in lower()
204 Returns.push_back(WebAssembly::regClassToValType( in lower()
208 Params.push_back(WebAssembly::regClassToValType( in lower()
213 if (WebAssembly::isCallIndirect(MI->getOpcode())) in lower()
218 if (MI->getOpcode() == WebAssembly::RET_CALL_INDIRECT) in lower()
223 } else if (Info.OperandType == WebAssembly::OPERAND_SIGNATURE) { in lower()
224 auto BT = static_cast<WebAssembly::BlockType>(MO.getImm()); in lower()
[all …]
H A DWebAssemblyLateEHPrepare.cpp158 if (TI->getOpcode() == WebAssembly::CATCHRET) in recordCatchRetBBs()
180 if (WebAssembly::isCatch(MI.getOpcode())) in hoistCatches()
215 !WebAssembly::isCatch(InsertPos->getOpcode())) { in addCatchAlls()
219 TII.get(WebAssembly::CATCH_ALL)); in addCatchAlls()
238 case WebAssembly::CATCHRET: { in replaceFuncletReturns()
242 BuildMI(MBB, TI, TI->getDebugLoc(), TII.get(WebAssembly::BR)) in replaceFuncletReturns()
248 case WebAssembly::RETHROW: in replaceFuncletReturns()
271 case WebAssembly::CLEANUPRET: { in replaceFuncletReturns()
279 BuildMI(MBB, TI, TI->getDebugLoc(), TII.get(WebAssembly::RETHROW)) in replaceFuncletReturns()
296 if (MI.getOpcode() != WebAssembly::THROW && in removeUnnecessaryUnreachables()
[all …]
H A DWebAssemblyISelDAGToDAG.cpp112 assert(Tag == WebAssembly::CPP_EXCEPTION || WebAssembly::C_LONGJMP); in getTagSymNode()
116 const char *SymName = Tag == WebAssembly::CPP_EXCEPTION in getTagSymNode()
131 auto GlobalGetIns = PtrVT == MVT::i64 ? WebAssembly::GLOBAL_GET_I64 in Select()
132 : WebAssembly::GLOBAL_GET_I32; in Select()
149 Fence = CurDAG->getMachineNode(WebAssembly::COMPILER_FENCE, in Select()
159 WebAssembly::ATOMIC_FENCE, in Select()
215 CurDAG->getMachineNode(WebAssembly::CATCH, DL, in Select()
238 CurDAG->getMachineNode(WebAssembly::THROW, DL, in Select()
252 WebAssembly::RETHROW, DL, in Select()
296 CurDAG->getMachineNode(WebAssembly::CALL_PARAMS, DL, MVT::Glue, Ops); in Select()
[all …]
H A DREADME.txt1 //===-- README.txt - Notes for WebAssembly code gen -----------------------===//
3 The object format emitted by the WebAssembly backed is documented in:
5 * https://github.com/WebAssembly/tool-conventions/blob/main/Linking.md
9 * https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md
11 For more information on WebAssembly itself, see the home page:
16 includes standard libraries, tools, and packaging for producing WebAssembly
20 on musl, for producing WebAssembly applications that use the WASI ABI.
22 Rust provides WebAssembly support integrated into Cargo. There are two
33 encoding of WebAssembly itself:
34 * https://github.com/WebAssembly/design/blob/main/Semantics.md
[all …]
H A DWebAssemblyReplacePhysRegs.cpp76 for (unsigned PReg = WebAssembly::NoRegister + 1; in runOnMachineFunction()
77 PReg < WebAssembly::NUM_TARGET_REGS; ++PReg) { in runOnMachineFunction()
79 if (PReg == WebAssembly::VALUE_STACK || PReg == WebAssembly::ARGUMENTS) in runOnMachineFunction()
84 unsigned VReg = WebAssembly::NoRegister; in runOnMachineFunction()
88 if (VReg == WebAssembly::NoRegister) { in runOnMachineFunction()
H A DWebAssemblyISelLowering.cpp59 Subtarget->hasAddr64() ? WebAssembly::SP64 : WebAssembly::SP32); in WebAssemblyTargetLowering()
61 addRegisterClass(MVT::i32, &WebAssembly::I32RegClass); in WebAssemblyTargetLowering()
62 addRegisterClass(MVT::i64, &WebAssembly::I64RegClass); in WebAssemblyTargetLowering()
63 addRegisterClass(MVT::f32, &WebAssembly::F32RegClass); in WebAssemblyTargetLowering()
64 addRegisterClass(MVT::f64, &WebAssembly::F64RegClass); in WebAssemblyTargetLowering()
66 addRegisterClass(MVT::v16i8, &WebAssembly::V128RegClass); in WebAssemblyTargetLowering()
67 addRegisterClass(MVT::v8i16, &WebAssembly::V128RegClass); in WebAssemblyTargetLowering()
68 addRegisterClass(MVT::v4i32, &WebAssembly::V128RegClass); in WebAssemblyTargetLowering()
69 addRegisterClass(MVT::v4f32, &WebAssembly::V128RegClass); in WebAssemblyTargetLowering()
70 addRegisterClass(MVT::v2i64, &WebAssembly::V128RegClass); in WebAssemblyTargetLowering()
[all …]
H A DWebAssemblyFixBrTableDefaults.cpp58 assert(MI.getDesc().getOpcode() == WebAssembly::BR_TABLE_I64 && in fixBrTableIndex()
63 if (ExtMI->getOpcode() == WebAssembly::I64_EXTEND_U_I32) { in fixBrTableIndex()
75 MF.getRegInfo().createVirtualRegister(&WebAssembly::I32RegClass); in fixBrTableIndex()
77 WST.getInstrInfo()->get(WebAssembly::I32_WRAP_I64), Reg32) in fixBrTableIndex()
84 MI.setDesc(WST.getInstrInfo()->get(WebAssembly::BR_TABLE_I32)); in fixBrTableIndex()
130 if (RangeCheck->getOpcode() != WebAssembly::GT_U_I32) in fixBrTableDefault()
172 if (WebAssembly::isBrTable(MI.getOpcode())) { in runOnMachineFunction()
H A DWebAssemblySetP2AlignOperands.cpp63 (UINT64_C(1) << WebAssembly::GetDefaultP2Align(MI.getOpcode())) && in rewriteP2Align()
66 WebAssembly::OPERAND_P2ALIGN && in rewriteP2Align()
72 uint64_t(WebAssembly::GetDefaultP2Align(MI.getOpcode()))); in rewriteP2Align()
87 int16_t P2AlignOpNum = WebAssembly::getNamedOperandIdx( in runOnMachineFunction()
88 MI.getOpcode(), WebAssembly::OpName::p2align); in runOnMachineFunction()
/freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/Utils/
H A DWebAssemblyUtilities.cpp
H A DWebAssemblyTypeUtilities.cpp23 MVT WebAssembly::parseMVT(StringRef Type) { in parseMVT()
40 wasm::ValType WebAssembly::toValType(MVT Type) { in toValType()
69 void WebAssembly::wasmSymbolSetType(MCSymbolWasm *Sym, const Type *GlobalVT, in wasmSymbolSetType()
78 if (WebAssembly::isWebAssemblyTableType(GlobalVT)) { in wasmSymbolSetType()
81 if (WebAssembly::isWebAssemblyExternrefType(ElTy)) in wasmSymbolSetType()
83 else if (WebAssembly::isWebAssemblyFuncrefType(ElTy)) in wasmSymbolSetType()
88 ValTy = WebAssembly::toValType(VTs[0]); in wasmSymbolSetType()
/freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/Disassembler/
H A DWebAssemblyDisassembler.cpp153 outs() << WebAssembly::anyTypeToString(Type); in onSymbolStart()
200 case WebAssembly::OPERAND_BASIC_BLOCK: in getInstruction()
201 case WebAssembly::OPERAND_LOCAL: in getInstruction()
202 case WebAssembly::OPERAND_GLOBAL: in getInstruction()
203 case WebAssembly::OPERAND_FUNCTION32: in getInstruction()
204 case WebAssembly::OPERAND_TABLE: in getInstruction()
205 case WebAssembly::OPERAND_OFFSET32: in getInstruction()
206 case WebAssembly::OPERAND_OFFSET64: in getInstruction()
207 case WebAssembly::OPERAND_P2ALIGN: in getInstruction()
208 case WebAssembly::OPERAND_TYPEINDEX: in getInstruction()
[all …]
/freebsd/contrib/llvm-project/clang/lib/Driver/ToolChains/
H A DWebAssembly.cpp31 std::string WebAssembly::getMultiarchTriple(const Driver &D, in getMultiarchTriple()
214 WebAssembly::WebAssembly(const Driver &D, const llvm::Triple &Triple, in WebAssembly() function in WebAssembly
243 const char *WebAssembly::getDefaultLinker() const { in getDefaultLinker()
249 bool WebAssembly::IsMathErrnoDefault() const { return false; } in IsMathErrnoDefault()
251 bool WebAssembly::IsObjCNonFragileABIDefault() const { return true; } in IsObjCNonFragileABIDefault()
253 bool WebAssembly::UseObjCMixedDispatch() const { return true; } in UseObjCMixedDispatch()
255 bool WebAssembly::isPICDefault() const { return false; } in isPICDefault()
257 bool WebAssembly::isPIEDefault(const llvm::opt::ArgList &Args) const { in isPIEDefault()
261 bool WebAssembly::isPICDefaultForced() const { return false; } in isPICDefaultForced()
263 bool WebAssembly::hasBlocksRuntime() const { return false; } in hasBlocksRuntime()
[all …]

12345