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

[x86] _mm_frcz_ss and _mm_frcz_sd should take two parameters #48017

Open
llvmbot opened this issue Jan 5, 2021 · 4 comments
Open

[x86] _mm_frcz_ss and _mm_frcz_sd should take two parameters #48017

llvmbot opened this issue Jan 5, 2021 · 4 comments
Labels
backend:X86 bugzilla Issues migrated from bugzilla clang:headers Headers provided by Clang, e.g. for intrinsics

Comments

@llvmbot
Copy link
Member

llvmbot commented Jan 5, 2021

Bugzilla Link 48673
Version 11.0
OS All
Reporter LLVM Bugzilla Contributor
CC @topperc,@RKSimon,@zygoloid

Extended Description

The _mm_frcz_ss and _mm_frcz_sd functions in clang take only a single parameter, whereas in GCC and MSVC they take two.

Clang:

static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_frcz_ss(__m128 __A)
{
return (__m128)__builtin_ia32_vfrczss((__v4sf)__A);
}
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_frcz_sd(__m128d __A)
{
return (__m128d)__builtin_ia32_vfrczsd((__v2df)__A);
}

GCC: https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/xopintrin.h#L753-L767

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@mr-c
Copy link

mr-c commented May 21, 2023

I can confirm that this bug is still present in the trunk as of 2023-05-21 (today):

https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/xopintrin.h#L731-L741

@llvmbot
Copy link
Member Author

llvmbot commented May 21, 2023

@llvm/issue-subscribers-backend-x86

@RKSimon RKSimon self-assigned this May 21, 2023
@RKSimon
Copy link
Collaborator

RKSimon commented Jun 7, 2023

MSDN: https://learn.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list?view=msvc-170

_mm_frcz_sd | XOP | ammintrin.h | __m128d _mm_frcz_sd(__m128d, __m128d);
_mm_frcz_ss | XOP | ammintrin.h | __m128 _mm_frcz_ss(__m128, __m128);

@RKSimon
Copy link
Collaborator

RKSimon commented Jun 7, 2023

VFRCZSD/VFRCZSS are rather unusual scalar instructions that zero the upper bits of the xmm result register instead of passing on the upper bits from the source operand. Interestingly GCC/MSDN both attempted to use the standard SSE pattern for binary intrinsics, even though this is a unary intrinsic.

@RKSimon RKSimon removed their assignment Mar 5, 2024
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