This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Fix types in wasm_simd128.h and add tests
ClosedPublic

Authored by tlively on Aug 5 2020, 12:34 PM.

Details

Summary

47f7174ffa changed the types used in the Wasm SIMD builtin functions,
but not all of their uses in wasm_simd128.h were updated. This commit
fixes wasm_simd128.h and adds tests to make sure similar problems do
not pass uncaught in the future.

Diff Detail

Event Timeline

tlively created this revision.Aug 5 2020, 12:34 PM
tlively requested review of this revision.Aug 5 2020, 12:34 PM
sunfish accepted this revision.Aug 5 2020, 12:54 PM

Ah, it seems the reason I didn't see this is that I wasn't using -flax-vector-conversions=none. Thanks for fixing this!

clang/test/Headers/wasm.cpp
2

This test currently passes on trunk without the bug fix here. Could you add a -flax-vector-conversions=none line, similar to the C test, which is the case that the patch here fixes?

This revision is now accepted and ready to land.Aug 5 2020, 12:54 PM
tlively updated this revision to Diff 283373.Aug 5 2020, 1:31 PM
  • Fix and test macros as well
tlively added inline comments.Aug 5 2020, 1:37 PM
clang/test/Headers/wasm.cpp
2

I think it's ok that this doesn't test with -flax-vector-conversions=none, since that's already tested in the .c file. This pattern of testing is copied from x86intrin.{c,cpp} and that's how this works in those files as well. This .cpp file only exists to additionally test the header contents with extern "C++" around them AFAICT.

This revision was landed with ongoing or failed builds.Aug 5 2020, 2:00 PM
This revision was automatically updated to reflect the committed changes.