[X86] Emit native IR for pmuldq/pmuludq builtins.
authorCraig Topper <craig.topper@intel.com>
Mon, 9 Apr 2018 19:17:54 +0000 (19:17 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 9 Apr 2018 19:17:54 +0000 (19:17 +0000)
commit304edc1e75f7c1342853e4f974534573edf6da01
tree9d5fa98379b4f82a588a3de7110d8129baa52f9d
parent3a0cab73ebb331240fde36370da7f30e9b42dc5f
[X86] Emit native IR for pmuldq/pmuludq builtins.

I believe all the pieces are now in place in the backend to make this work correctly. We can either mask the input to 32 bits for pmuludg or shl/ashr for pmuldq and use a regular mul instruction. The backend should combine this to PMULUDQ/PMULDQ and then SimplifyDemandedBits will remove the and/shifts.

Differential Revision: https://reviews.llvm.org/D45421

llvm-svn: 329605
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/avx2-builtins.c
clang/test/CodeGen/avx512f-builtins.c
clang/test/CodeGen/avx512vl-builtins.c
clang/test/CodeGen/sse2-builtins.c
clang/test/CodeGen/sse41-builtins.c