Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[X86] Implement MMX intrinsics with SSE equivalents #41291

Open Quuxplusone opened 5 years ago

Quuxplusone commented 5 years ago
Bugzilla Link PR42320
Status NEW
Importance P enhancement
Reported by Simon Pilgrim (llvm-dev@redking.me.uk)
Reported on 2019-06-19 03:52:12 -0700
Last modified on 2021-01-09 11:04:41 -0800
Version trunk
Hardware PC Windows NT
CC craig.topper@gmail.com, efriedma@quicinc.com, jyknight@google.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

Similar to what's been proposed recently for gcc, we should investigate promoting MMX intrinsics to SSE equivalents:

https://gcc.gnu.org/ml/gcc-patches/2019-02/msg00061.html

This probably would be best handled in CGBuiltin.cpp - replacing the MMX builtins with SSE equivalents, although some can probably done in headers as well behind a suitable define.

NOTE: This will cause a high number of subvector insertions/extractions, we might need some mechanism to reduce this even without optimizations.

Quuxplusone commented 5 years ago
(In reply to Simon Pilgrim from comment #0)
> NOTE: This will cause a high number of subvector insertions/extractions, we
> might need some mechanism to reduce this even without optimizations.

If we switch to widening 64-bit vectors by default, instead of promoting them,
the conversions would be free, so it wouldn't really matter.  Otherwise, yes,
this could get messy; we might need special "fake-MMX" intrinsics.
Quuxplusone commented 3 years ago
Being implemented with:
- https://reviews.llvm.org/D86855:
  Convert __m64 intrinsics to unconditionally use SSE2 instead of MMX instructions
- https://reviews.llvm.org/D94213:
  Clang: Remove support for 3DNow!, both intrinsics and builtins.
- https://reviews.llvm.org/D94252:
  Delete (most) of the MMX builtin functions from Clang.