mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
5f06cbb29f
It uses the MC framework and the tablegen matcher to do the heavy lifting. Can handle both explicit and implicit locals (-disable-wasm-explicit-locals). Comes with a small regression test. This is a first basic implementation that can parse most llvm .s output and round-trips most instructions succesfully, but in order to keep the commit small, does not address all issues. There are a fair number of mismatches between what MC / assembly matcher think a "CPU" should look like and what WASM provides, some already have workarounds in this commit (e.g. the way it deals with register operands) and some that require further work. Some of that further work may involve changing what the Disassembler outputs (and what s2wasm parses), so are probably best left to followups. Some known things missing: - Many directives are ignored and not emitted. - Vararg calls are parsed but extra args not emitted. - Loop signatures are likely incorrect. - $drop= is not emitted. - Disassembler does not output SIMD types correctly, so assembler can't test them. Patch by Wouter van Oortmerssen Differential Revision: https://reviews.llvm.org/D44329 llvm-svn: 328028
60 lines
1.9 KiB
CMake
60 lines
1.9 KiB
CMake
set(LLVM_TARGET_DEFINITIONS WebAssembly.td)
|
|
|
|
tablegen(LLVM WebAssemblyGenAsmWriter.inc -gen-asm-writer)
|
|
tablegen(LLVM WebAssemblyGenDAGISel.inc -gen-dag-isel)
|
|
tablegen(LLVM WebAssemblyGenFastISel.inc -gen-fast-isel)
|
|
tablegen(LLVM WebAssemblyGenInstrInfo.inc -gen-instr-info)
|
|
tablegen(LLVM WebAssemblyGenMCCodeEmitter.inc -gen-emitter)
|
|
tablegen(LLVM WebAssemblyGenRegisterInfo.inc -gen-register-info)
|
|
tablegen(LLVM WebAssemblyGenSubtargetInfo.inc -gen-subtarget)
|
|
tablegen(LLVM WebAssemblyGenAsmMatcher.inc -gen-asm-matcher)
|
|
add_public_tablegen_target(WebAssemblyCommonTableGen)
|
|
|
|
add_llvm_target(WebAssemblyCodeGen
|
|
WebAssemblyArgumentMove.cpp
|
|
WebAssemblyAsmPrinter.cpp
|
|
WebAssemblyCallIndirectFixup.cpp
|
|
WebAssemblyCFGStackify.cpp
|
|
WebAssemblyCFGSort.cpp
|
|
WebAssemblyExplicitLocals.cpp
|
|
WebAssemblyFastISel.cpp
|
|
WebAssemblyFixIrreducibleControlFlow.cpp
|
|
WebAssemblyFixFunctionBitcasts.cpp
|
|
WebAssemblyFrameLowering.cpp
|
|
WebAssemblyISelDAGToDAG.cpp
|
|
WebAssemblyISelLowering.cpp
|
|
WebAssemblyInstrInfo.cpp
|
|
WebAssemblyLowerBrUnless.cpp
|
|
WebAssemblyLowerEmscriptenEHSjLj.cpp
|
|
WebAssemblyLowerGlobalDtors.cpp
|
|
WebAssemblyMachineFunctionInfo.cpp
|
|
WebAssemblyMCInstLower.cpp
|
|
WebAssemblyOptimizeLiveIntervals.cpp
|
|
WebAssemblyOptimizeReturned.cpp
|
|
WebAssemblyPeephole.cpp
|
|
WebAssemblyPrepareForLiveIntervals.cpp
|
|
WebAssemblyRegisterInfo.cpp
|
|
WebAssemblyRegColoring.cpp
|
|
WebAssemblyRegNumbering.cpp
|
|
WebAssemblyRegStackify.cpp
|
|
WebAssemblyReplacePhysRegs.cpp
|
|
WebAssemblyRuntimeLibcallSignatures.cpp
|
|
WebAssemblySelectionDAGInfo.cpp
|
|
WebAssemblySetP2AlignOperands.cpp
|
|
WebAssemblyStoreResults.cpp
|
|
WebAssemblySubtarget.cpp
|
|
WebAssemblyTargetMachine.cpp
|
|
WebAssemblyTargetObjectFile.cpp
|
|
WebAssemblyTargetTransformInfo.cpp
|
|
WebAssemblyUtilities.cpp
|
|
|
|
DEPENDS
|
|
intrinsics_gen
|
|
)
|
|
|
|
add_subdirectory(AsmParser)
|
|
add_subdirectory(Disassembler)
|
|
add_subdirectory(InstPrinter)
|
|
add_subdirectory(MCTargetDesc)
|
|
add_subdirectory(TargetInfo)
|