WebAssembly: implement getScalarShiftAmountTy so we can shift by amount, with type
authorJF Bastien <jfb@google.com>
Mon, 3 Aug 2015 00:00:11 +0000 (00:00 +0000)
committerJF Bastien <jfb@google.com>
Mon, 3 Aug 2015 00:00:11 +0000 (00:00 +0000)
commitfda53373f2360494d38bf705f776d32d1153be69
tree6bc234f95bacb463d1041cdbe2992601c695aca9
parent1cd693c9e976b60ee8a2114e4644d4e83478ae77
WebAssembly: implement getScalarShiftAmountTy so we can shift by amount, 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
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
llvm/test/CodeGen/WebAssembly/integer64.ll