This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] __builtin_wasm_replace_lane_* builtins
ClosedPublic

Authored by tlively on Oct 3 2018, 6:01 PM.

Diff Detail

Event Timeline

tlively created this revision.Oct 3 2018, 6:01 PM
craig.topper added inline comments.
include/clang/Basic/BuiltinsWebAssembly.def
55

I think maybe you want LL instead of W, but I'm not sure.

aheejin added inline comments.Oct 3 2018, 6:22 PM
include/clang/Basic/BuiltinsWebAssembly.def
55

Not sure what the differences are either. I've used LL for other builtins in this file though.

tlively updated this revision to Diff 168223.Oct 3 2018, 8:47 PM
  • Force constant folding for lane
craig.topper added inline comments.Oct 4 2018, 11:05 AM
include/clang/Basic/BuiltinsWebAssembly.def
55

W changes based on what's returned from getInt64Type() for the target. I think it will be either L or LL. It looks to be almost exclusively used by MSVC compatibility intrinsics except for two builtins in NVPTX.

tlively added inline comments.Oct 4 2018, 2:32 PM
include/clang/Basic/BuiltinsWebAssembly.def
55

Ok, I'll switch to using LL.

tlively updated this revision to Diff 168387.Oct 4 2018, 2:54 PM
  • Replace Wi with LLi and remove V:128:

W is int64_t (which is long long for wasm32 and would probably be long for wasm64 since that would probably LP64 (like Linux) rather than LLP64 (Like Win64). So if we want it to be the same for both wasm32 and wasm64, I guess we want LL.

W is int64_t (which is long long for wasm32 and would probably be long for wasm64 since that would probably LP64 (like Linux) rather than LLP64 (Like Win64). So if we want it to be the same for both wasm32 and wasm64, I guess we want LL.

Ideally I would be able to exactly specify int8_t, int32_t, etc, but c/s/i/LLi works too.

aheejin accepted this revision.Oct 4 2018, 5:39 PM
This revision is now accepted and ready to land.Oct 4 2018, 5:39 PM
This revision was automatically updated to reflect the committed changes.