Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mm3dnow.h misses a number of intrinsics #24022

Closed
DimitryAndric opened this issue May 25, 2015 · 10 comments
Closed

mm3dnow.h misses a number of intrinsics #24022

DimitryAndric opened this issue May 25, 2015 · 10 comments
Labels
backend:X86 bugzilla Issues migrated from bugzilla clang:headers Headers provided by Clang, e.g. for intrinsics

Comments

@DimitryAndric
Copy link
Collaborator

Bugzilla Link 23648
Version trunk
OS All
CC @RKSimon

Extended Description

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.

@RKSimon
Copy link
Collaborator

RKSimon commented Jun 20, 2015

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

@DimitryAndric
Copy link
Collaborator Author

...

__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?

@RKSimon
Copy link
Collaborator

RKSimon commented Jul 19, 2015

Review patch for _m_prefetch()
http://reviews.llvm.org/D11338

@RKSimon
Copy link
Collaborator

RKSimon commented Jul 28, 2015

Review patch for _m_prefetch()
http://reviews.llvm.org/D11338

Committed in rL243305 and rL243314

@RKSimon
Copy link
Collaborator

RKSimon commented Jul 28, 2015

__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

@RKSimon
Copy link
Collaborator

RKSimon commented Aug 23, 2015

D12272 - patch to remove the unnecessary _m_from_int, _m_to_int and _m_prefetch intrinsic definitions

@RKSimon
Copy link
Collaborator

RKSimon commented Aug 25, 2015

D12340 - final patch to add the missing _m_from_float / _m_to_float implementations.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@RKSimon
Copy link
Collaborator

RKSimon commented Mar 9, 2022

D12340 - final patch to add the missing _m_from_float / _m_to_float implementations.

This was abandoned as we don't have any way to insert emms/femms ops to separate x87/mmx ops.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 9, 2022

@llvm/issue-subscribers-backend-x86

@RKSimon
Copy link
Collaborator

RKSimon commented Mar 9, 2022

Resolving - the 3dnow coverage is as good as its ever going to get.

@RKSimon RKSimon closed this as completed Mar 9, 2022
netgate-git-updates pushed a commit to pfsense/FreeBSD-ports that referenced this issue Apr 15, 2024
Required support aws merged with LLVM in 2015:
llvm/llvm-project#24022

The port builds fine, including with CPUTYPE=athlon64-sse3

PR:		194861, 278353 [1]
Submitted by:	diizzy [1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 bugzilla Issues migrated from bugzilla clang:headers Headers provided by Clang, e.g. for intrinsics
Projects
None yet
Development

No branches or pull requests

3 participants