LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 23648 - mm3dnow.h misses a number of intrinsics
Summary: mm3dnow.h misses a number of intrinsics
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: Headers (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-25 06:04 PDT by Dimitry Andric
Modified: 2017-03-27 14:11 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric 2015-05-25 06:04:15 PDT
This turned up during certain FreeBSD port builds.  Apparently the mmd3dnow.h header shipped with clang misses the following intrinsics:

__m64 _m_from_float(float);
__m64 _m_from_int(int);
void _m_prefetch(void *);
float _m_to_float(__m64);
int _m_to_int(__m64);

Note that the int variants are also not declared by gcc, e.g. these seem to be only relevant to Microsoft C.  Maybe it is not worth declaring them in mm3dnow.h, since they are already in the Microsoft-specific Intrin.h header.
Comment 1 Simon Pilgrim 2015-06-20 11:08:12 PDT
(In reply to comment #0)
> This turned up during certain FreeBSD port builds.  Apparently the
> mmd3dnow.h header shipped with clang misses the following intrinsics:
>
> __m64 _m_from_int(int);
> int _m_to_int(__m64);
> 

These 2 are MMX intrinsics and are included in mmintrin.h (which mm3dnow.h includes):

/* Aliases for compatibility. */
#define _m_from_int _mm_cvtsi32_si64
#define _m_to_int _mm_cvtsi64_si32
Comment 2 Dimitry Andric 2015-06-21 10:22:32 PDT
(In reply to comment #1)
...
> > __m64 _m_from_int(int);
> > int _m_to_int(__m64);
> > 
> 
> These 2 are MMX intrinsics and are included in mmintrin.h (which mm3dnow.h
> includes):
> 
> /* Aliases for compatibility. */
> #define _m_from_int _mm_cvtsi32_si64
> #define _m_to_int _mm_cvtsi64_si32

Yes, but specifically _m_prefetch() was the intrinsic some ports error'd out on.  Maybe this could also be defined similarly?
Comment 3 Simon Pilgrim 2015-07-19 05:14:08 PDT
Review patch for _m_prefetch()
http://reviews.llvm.org/D11338
Comment 4 Simon Pilgrim 2015-07-28 07:56:34 PDT
(In reply to comment #3)
> Review patch for _m_prefetch()
> http://reviews.llvm.org/D11338

Committed in rL243305 and rL243314
Comment 5 Simon Pilgrim 2015-07-28 08:02:45 PDT
> __m64 _m_from_float(float);
> __m64 _m_from_int(int);
> void _m_prefetch(void *);
> float _m_to_float(__m64);
> int _m_to_int(__m64);
> 

The only missing functions now are _m_from_float and _m_to_float. The other definitions can be safely removed from Intrin.h
Comment 6 Simon Pilgrim 2015-08-23 12:17:22 PDT
D12272 - patch to remove the unnecessary _m_from_int, _m_to_int and _m_prefetch intrinsic definitions
Comment 7 Simon Pilgrim 2015-08-25 16:52:54 PDT
D12340 - final patch to add the missing _m_from_float / _m_to_float implementations.