summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
diff options
context:
space:
mode:
authorJF Bastien <jfb@google.com>2015-08-01 04:48:44 +0000
committerJF Bastien <jfb@google.com>2015-08-01 04:48:44 +0000
commit8f9aea08d4c6c4b702bb57227ab00191c02b2847 (patch)
treeb67d315477b1068506189ce81ec20d7fb13d6d17 /llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
parentde4e539aba1ffc00c930a9de6a12a2658df9a1d7 (diff)
downloadbcm5719-llvm-8f9aea08d4c6c4b702bb57227ab00191c02b2847.tar.gz
bcm5719-llvm-8f9aea08d4c6c4b702bb57227ab00191c02b2847.zip
WebAssembly: handle more than int32 argument/return
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
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
index e0e9a3b14bc..a3157f40a66 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
@@ -92,10 +92,23 @@ void WebAssemblyAsmPrinter::EmitInstruction(const MachineInstr *MI) {
bool PrintOperands = true;
switch (MI->getOpcode()) {
- case WebAssembly::ARGUMENT:
+ case WebAssembly::ARGUMENT_Int32:
+ case WebAssembly::ARGUMENT_Int64:
+ case WebAssembly::ARGUMENT_Float32:
+ case WebAssembly::ARGUMENT_Float64:
OS << "argument " << MI->getOperand(1).getImm();
PrintOperands = false;
break;
+ case WebAssembly::RETURN_Int32:
+ case WebAssembly::RETURN_Int64:
+ case WebAssembly::RETURN_Float32:
+ case WebAssembly::RETURN_Float64:
+ case WebAssembly::RETURN_VOID:
+ // FIXME This is here only so "return" prints nicely, instead of printing
+ // the isel name. Other operations have the same problem, fix this in
+ // a generic way instead.
+ OS << "return";
+ break;
default:
OS << TII->getName(MI->getOpcode());
break;
OpenPOWER on IntegriCloud