summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Rename test files to match platform naming conventions.Dan Gohman2015-09-294-0/+0
| | | | llvm-svn: 248783
* [WebAssembly] Support for direct call and call_indirect.Dan Gohman2015-09-282-32/+45
| | | | llvm-svn: 248716
* [WebAssembly] Rename several functions and types according to the new spec.Dan Gohman2015-09-264-34/+34
| | | | llvm-svn: 248644
* [WebAssembly] Check in an initial CFG Stackifier passDan Gohman2015-09-163-4/+448
| | | | | | | | | | | | This pass implements a simple algorithm for conversion from CFG to wasm's structured control flow. It doesn't yet handle multiple-entry loops; that will be added in a future patch. It also adds initial support for switch statements. Differential Revision: http://reviews.llvm.org/D12735 llvm-svn: 247818
* [WebAssembly] Implement int64-to-int32 conversion.Dan Gohman2015-09-151-0/+16
| | | | llvm-svn: 247649
* [WebAssembly] Update target datalayout strings.Dan Gohman2015-09-0910-10/+10
| | | | llvm-svn: 247187
* [WebAssembly] Implement calls with void return types.Dan Gohman2015-09-091-0/+10
| | | | llvm-svn: 247158
* [WebAssembly] Fix lowering of calls with more than one argument.Dan Gohman2015-09-091-0/+13
| | | | llvm-svn: 247118
* [WebAssembly] Implement WebAssemblyInstrInfo::copyPhysRegDan Gohman2015-09-091-0/+26
| | | | llvm-svn: 247110
* WebAssembly: NFC rename shr/sarJF Bastien2015-09-083-6/+6
| | | | | | Renamed from: https://github.com/WebAssembly/design/pull/332 llvm-svn: 247028
* [WebAssembly] Temporarily disable this test, as it depends on additional ↵Dan Gohman2015-09-081-0/+3
| | | | | | patches that aren't yet checked in. llvm-svn: 247011
* [WebAssembly] Enable SSA lowering and other pre-regalloc passesDan Gohman2015-09-081-0/+22
| | | | llvm-svn: 247008
* WebAssembly: generate load/storeJF Bastien2015-08-315-0/+296
| | | | | | | | | Summary: This handles all load/store operations that WebAssembly defines, and handles those necessary for C++ such as i1. I left a FIXME for outstanding features which aren't required for now. Reviewers: sunfish Subscribers: jfb, llvm-commits, dschuff llvm-svn: 246500
* WebAssembly: handle private/internal globals.JF Bastien2015-08-261-0/+37
| | | | | | | | | | | | Things of note: - Other linkage types aren't handled yet. We'll figure it out with dynamic linking. - Special LLVM globals are either ignored, or error out for now. - TLS isn't supported yet (WebAssembly will have threads later). - There currently isn't a syntax for alignment, I left it in a comment so it's easy to hook up. - Undef is convereted to whatever the type's appropriate null value is. - assert versus report_fatal_error: follow what other AsmPrinters do, and assert only on what should have been caught elsewhere. llvm-svn: 246092
* WebAssembly: emit `(func (param t) (result t))` s-expressionsJF Bastien2015-08-2517-148/+268
| | | | | | | | | | | | Summary: Match spec format: https://github.com/WebAssembly/spec/blob/master/ml-proto/test/fac.wasm Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D12307 llvm-svn: 245986
* WebAssembly: comment out .globl when printing textual assemblyJF Bastien2015-08-251-0/+14
| | | | | | Do the same for .weak (not implemented for now, but may as well to it). Update comment string to two semicolons. llvm-svn: 245982
* WebAssembly: Implement callJF Bastien2015-08-241-12/+55
| | | | | | | | | | | | Summary: Support function calls. Reviewers: sunfish, sunfishcode Subscribers: sunfishcode, jfb, llvm-commits Differential revision: http://reviews.llvm.org/D12219 llvm-svn: 245887
* Revert two bad commits.JF Bastien2015-08-241-5/+4
| | | | | | | | | | Summary: I forgot to squash git commits before doing an svn dcommit of D12219. Reverting, and re-submitting. Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D12298 llvm-svn: 245886
* Missing print.JF Bastien2015-08-241-4/+5
| | | | llvm-svn: 245883
* callJF Bastien2015-08-241-0/+22
| | | | llvm-svn: 245882
* [WebAssembly] CodeGen support for __builtin_wasm_page_size()Dan Gohman2015-08-242-0/+32
| | | | llvm-svn: 245872
* [WebAssembly] Skeleton FastISel supportDan Gohman2015-08-241-0/+20
| | | | llvm-svn: 245860
* [WebAssembly] Implement floating point rounding operators.Dan Gohman2015-08-242-0/+80
| | | | llvm-svn: 245859
* [WebAssembly] Implement the is_zero_undef forms of cttz and ctlzDan Gohman2015-08-242-0/+36
| | | | llvm-svn: 245851
* [WebAssembly] Use the default alignment for SIMD types.Dan Gohman2015-08-1911-11/+11
| | | | | | | | | Previously WebAssembly's datalayout string had -v128:8:128. This had been an attempt to declare a certain level of support for unaligned SIMD accesses. However, clang makes its own determinations for SIMD alignment that are independent of the datalayout string, so this wasn't actually meaningful. llvm-svn: 245494
* WebAssembly: floating-point comparisonsJF Bastien2015-08-124-18/+166
| | | | | | | | | | | | | | | | | | Summary: D11924 implemented part of the floating-point comparisons, this patch implements the rest: * Tell ISelLowering that all booleans are either 0 or 1. * Expand the eq/ne/lt/le/gt/ge floating-point comparisons to the canonical ones (similar to what Mips32r6InstrInfo.td does). * Add tests for ord/uno. * Add tests for ueq/one/ult/ule/ugt/uge. * Fix existing comparison tests to remove the (res & 1) code, which setBooleanContents stops from generating. Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11970 llvm-svn: 244779
* WebAssembly: implement comparison.JF Bastien2015-08-114-0/+312
| | | | | | | | | | | | Some of the FP comparisons (ueq, one, ult, ule, ugt, uge) are currently broken, I'll fix them in a follow-up. Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11924 llvm-svn: 244665
* WebAssembly: add basic floating-point testsJF Bastien2015-08-112-0/+138
| | | | | | | | | | Summary: I somehow forgot to add these when I added the basic floating-point opcodes. Also remove ceil/floor/trunc/nearestint for now, and add them only when properly tested. Subscribers: llvm-commits, sunfish, jfb Differential Revision: http://reviews.llvm.org/D11927 llvm-svn: 244562
* WebAssembly: simply assert on SNaN and NaNs with payloadsJF Bastien2015-08-111-2/+2
| | | | | | | | | | Summary: convertToHexString doesn't represent them correctly at this point in time. This is a follow-up to sunfish's suggestion in D11914. Subscribers: llvm-commits, sunfish, jfb Differential Revision: http://reviews.llvm.org/D11925 llvm-svn: 244551
* WebAssembly: print immediatesJF Bastien2015-08-101-0/+174
| | | | | | | | | | | | | | | Summary: For now output using C99's hexadecimal floating-point representation. This patch also cleans up how machine operands are printed: instead of special-casing per type of machine instruction, the code now handles operands generically. Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11914 llvm-svn: 244520
* WebAssembly: textual emission uses expected opcode namesJF Bastien2015-08-072-32/+32
| | | | | | | | | | | | Summary: WebAssembly's tablegen instructions have the names WebAssembly expects, but by LLVM convention they're uppercase and suffixed with their type after an underscore. Leave the C++ code that way, but print outt he names WebAssembly expects (lowercase, no type). We could teach tablegen to do this later, maybe by using `!cast<string>(node)` in the .td files. Reviewers: sunfish Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D11776 llvm-svn: 244305
* WebAssembly: implement getScalarShiftAmountTy so we can shift by amount, ↵JF Bastien2015-08-031-33/+29
| | | | | | | | | | | | with type Summary: This currently sets the shift amount RHS to the same type as the LHS, and assumes that the LHS is a simple type. This isn't currently the case e.g. with weird integers sizes, but will eventually be true and will assert if not. That's what you get for having an experimental backend: break it and you get to keep both pieces. Most backends either set the RHS to MVT::i32 or MVT::i64, but WebAssembly is a virtual ISA and tries to have regular-looking binary operations where both operands are the same type (even if a 64-bit RHS shifter is slightly silly, hey it's free!). Subscribers: llvm-commits, sunfish, jfb Differential Revision: http://reviews.llvm.org/D11715 llvm-svn: 243860
* WebAssembly: handle more than int32 argument/returnJF Bastien2015-08-014-19/+192
| | | | | | | | | | | | Summary: Also test 64-bit integers, except shifts for now which are broken because isel dislikes the 32-bit truncate that precedes them. Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11699 llvm-svn: 243822
* WebAssembly: handle `ret void`.JF Bastien2015-07-311-0/+10
| | | | | | | | | | | | | | | Summary: Use -1 as numoperands for the return SDTypeProfile, denoting that return is variadic. Note that the patterns in InstrControl.td still need to match the inputs, so this ins't an "anything goes" variadic on ret! The next step will be to handle other local types (not just int32). Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11692 llvm-svn: 243783
* WebAssembly: handle unused function arguments.JF Bastien2015-07-311-0/+20
| | | | | | | | Subscribers: llvm-commits, sunfish, jfb Differential Revision: http://reviews.llvm.org/D11684 llvm-svn: 243770
* WebAssembly: print basic integer assembly.JF Bastien2015-07-312-2/+157
| | | | | | | | | | | | | | | | | | | Summary: This prints assembly for int32 integer operations defined in WebAssemblyInstrInteger.td only, with major caveats: - The operation names are currently incorrect. - Other integer and floating-point types will be added later. - The printer isn't factored out to handle recursive AST code yet, since it can't even handle control flow anyways. - The assembly format isn't full s-expressions yet either, this will be added later. - This currently disables PrologEpilogCodeInserter as well as MachineCopyPropagation becasue they don't like virtual registers, which WebAssembly likes quite a bit. This will be fixed by factoring out NVPTX's change (currently a fork of PrologEpilogCodeInserter). Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11671 llvm-svn: 243763
* WebAssembly: add a generic CPUJF Bastien2015-07-271-0/+2
| | | | | | | | | | Summary: WebAssemblySubtarget.cpp expects a default 'generic' CPU to exist, and this seems to be prevalent with other targets. It makes sense to have something between MVP and bleeding-edge, even though for now it's the same as MVP. This removes a warning that's currently generated. Subscribers: jfb, llvm-commits, sunfish Differential Revision: http://reviews.llvm.org/D11546 llvm-svn: 243345
* WebAssembly: test that valid -mcpu flags are accepted.JF Bastien2015-07-231-0/+15
| | | | | | | | | | Summary: AArch64 has a similar test. Subscribers: sunfish, aemerson, llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11479 llvm-svn: 243058
* WebAssembly: basic bitcode → assembly CodeGen testJF Bastien2015-07-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Create a CodeGen unittest directory.Dan Gohman2015-07-061-0/+2
llvm-svn: 241520
OpenPOWER on IntegriCloud