summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Implement more WebAssembly binary encoding.Dan Gohman2016-10-241-36/+31
| | | | | | | | | | | | This changes locals from being declared by the emitLocal hook in WebAssemblyTargetStreamer, rather than with an instruction. After exploring the infastructure in LLVM more, this seems to make more sense since declaring locals doesn't use an encoded opcode. This also adds more 0xd opcodes, type encodings, and miscellaneous binary encoding bits. llvm-svn: 285040
* [WebAssembly] Add an option to make get_local/set_local explicit.Dan Gohman2016-10-241-1/+20
| | | | | | | | | | This patch adds a pass, controlled by an option and off by default for now, for making implicit get_local/set_local explicit. This simplifies emitting wasm with MC. Differential Revision: https://reviews.llvm.org/D25836 llvm-svn: 285009
* Move the global variables representing each Target behind accessor functionMehdi Amini2016-10-091-2/+2
| | | | | | | | This avoids "static initialization order fiasco" Differential Revision: https://reviews.llvm.org/D25412 llvm-svn: 283702
* [WebAssemby] Implement block signatures.Dan Gohman2016-10-061-2/+19
| | | | | | | | | Per spec changes, this implements block signatures, and adds just enough logic to produce correct block signatures at the ends of functions. Differential Revision: https://reviews.llvm.org/D25144 llvm-svn: 283503
* [WebAssembly] Remove the output operand from stores.Dan Gohman2016-10-061-3/+6
| | | | | | | | | Per spec changes, store instructions in WebAssembly no longer have a return value. Update the instruction descriptions. Differential Revision: https://reviews.llvm.org/D25122 llvm-svn: 283501
* [WebAssembly] Add binary-encoding opcode values to instruction descriptions.Dan Gohman2016-10-051-0/+4
| | | | llvm-svn: 283389
* [WebAssembly] Rename OPERAND_FP32IMM to OPERAND_F32IMM.Dan Gohman2016-10-031-2/+2
| | | | | | | WebAssembly documentation consistently says "f32" rather than "fp32" to describe 32-bit floating-point. llvm-svn: 283146
* [WebAssembly] Support CFI for WebAssembly targetDerek Schuff2016-08-011-1/+3
| | | | | | | | | | | | | | | Summary: This patch implements CFI for WebAssembly. It modifies the LowerTypeTest pass to pre-assign table indexes to functions that are called indirectly, and lowers type checks to test against the appropriate table indexes. It also modifies the WebAssembly backend to support a special ".indidx" assembly directive that propagates the table index assignments out to the linker. Patch by Dominic Chen Differential Revision: https://reviews.llvm.org/D21768 llvm-svn: 277398
* [WebAssembly] Implement support for custom NaN bit patterns.Dan Gohman2016-02-161-2/+4
| | | | llvm-svn: 260968
* [WebAssembly] Fix uses of FrameIndex as store valuesDerek Schuff2016-01-301-0/+2
| | | | | | | | Previously the code assumed all uses of FI on loads and stores were as addresses. This checks whether the use is the address or a value and handles the latter case as it does for non-memory instructions. llvm-svn: 259306
* [WebAssembly] Implement unaligned loads and stores.Dan Gohman2016-01-261-1/+46
| | | | | | Differential Revision: http://reviews.llvm.org/D16534 llvm-svn: 258779
* [WebAssembly] Remove an unused data member. NFC.Dan Gohman2016-01-191-2/+1
| | | | llvm-svn: 258192
* [WebAssembly] Introduce a WebAssemblyTargetStreamer class.Dan Gohman2016-01-121-5/+12
| | | | | | | Refactor .param, .result, .local, and .endfunc, as directives, using the proper MCTargetStreamer mechanism, rather than fake instructions. llvm-svn: 257511
* [WebAssembly] Make CFG stackification independent of basic-block labels.Dan Gohman2016-01-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | This patch changes the way labels are referenced. Instead of referencing the basic-block label name (eg. .LBB0_0), instructions now just have an immediate which indicates the depth in the control-flow stack to find a label to jump to. This makes them much closer to what we expect to have in the binary encoding, and avoids the problem of basic-block label names not being explicit in the binary encoding. Also, it terminates blocks and loops with end_block and end_loop instructions, rather than basic-block label names, for similar reasons. This will also fix problems where two constructs appear to have the same label, because we no longer explicitly use labels, so consumers that need labels will presumably create their own labels, and presumably they won't reuse labels when they do. This patch does make the code a little more awkward to read; as a partial mitigation, this patch also introduces comments showing where the labels are, and comments on each branch showing where it's branching to. llvm-svn: 257505
* [WebAssembly] Define OperandTypes for decoding immediate values.Dan Gohman2016-01-121-11/+21
| | | | llvm-svn: 257438
* [WebAssembly] Use TSFlags instead of keeping a list of special-case opcodes.Dan Gohman2016-01-121-0/+11
| | | | llvm-svn: 257433
* [WebAssembly] Minor code cleanups. NFC.Dan Gohman2016-01-081-6/+0
| | | | llvm-svn: 257128
* [WebAssembly] Remove unused arguments, unused functions. NFC.Dan Gohman2016-01-081-4/+1
| | | | llvm-svn: 257125
* [WebAssembly] Experimental ELF writer supportDan Gohman2015-12-171-0/+3
| | | | | | | | | This creates the initial infrastructure for writing ELF output files. It doesn't yet have any implementation for encoding instructions. Differential Revision: http://reviews.llvm.org/D15555 llvm-svn: 255869
* [WebAssembly] Trim some unneeded #includes.Dan Gohman2015-12-081-1/+0
| | | | llvm-svn: 254994
* [WebAssembly] Emit .param, .result, and .local through MC.Dan Gohman2015-11-231-1/+6
| | | | | | This eliminates one of the main remaining uses of EmitRawText. llvm-svn: 253878
* WebAssembly: basic bitcode → assembly CodeGen testJF Bastien2015-07-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add a basic CodeGen bitcode test which (for now) only prints out the function name and nothing else. The current code merely implements the basic needed for the test run to not crash / assert. Getting to that point required: - Basic InstPrinter. - Basic AsmPrinter. - DiagnosticInfoUnsupported (not strictly required, but nice to have, duplicated from AMDGPU/BPF's ISelLowering). - Some SP and register setup in WebAssemblyTargetLowering. - Basic LowerFormalArguments. - GenInstrInfo. - Placeholder LowerFormalArguments. - Placeholder CanLowerReturn and LowerReturn. - Basic DAGToDAGISel::Select, which requiresGenDAGISel.inc as well as GET_INSTRINFO_ENUM with GenInstrInfo.inc. - Remove WebAssemblyFrameLowering::determineCalleeSaves and rely on default. - Implement WebAssemblyFrameLowering::hasFP, same as AArch64's implementation. Follow-up patches will implement a real AsmPrinter, which will require adding MI opcodes specific to WebAssembly. Reviewers: sunfish Subscribers: aemerson, jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D11369 llvm-svn: 242939
* WebAssembly: basic instructions todo, and basic register info.JF Bastien2015-07-101-0/+3
| | | | | | | | | | | | | | Summary: This code is based on AArch64 for modern backend good practice, and NVPTX for virtual ISA concerns. Reviewers: sunfish Subscribers: aemerson, llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11070 llvm-svn: 241923
* [WebAssembly] Define separate Target instances for 32-bit and 64-bit.Dan Gohman2015-07-011-1/+2
| | | | llvm-svn: 241193
* [WebAssembly] Initial WebAssembly backendDan Gohman2015-06-291-0/+52
This WebAssembly backend is just a skeleton at this time and is not yet functional. llvm-svn: 241022
OpenPOWER on IntegriCloud