This is an archive of the discontinued LLVM Phabricator instance.

WebAssembly: implement getScalarShiftAmountTy so we can shift by amount, with type
ClosedPublic

Authored by jfb on Aug 2 2015, 5:00 PM.

Details

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!).

Diff Detail

Event Timeline

jfb updated this revision to Diff 31211.Aug 2 2015, 5:00 PM
jfb retitled this revision from to WebAssembly: implement getScalarShiftAmountTy so we can shift by amount, with type.
jfb updated this object.
jfb added subscribers: sunfish, llvm-commits.
This revision was automatically updated to reflect the committed changes.