clang 20.0.0git
Macros | Functions
f16cintrin.h File Reference

Go to the source code of this file.

Macros

#define __DEFAULT_FN_ATTRS128    __attribute__((__always_inline__, __nodebug__, __target__("f16c"), __min_vector_width__(128)))
 
#define __DEFAULT_FN_ATTRS256    __attribute__((__always_inline__, __nodebug__, __target__("f16c"), __min_vector_width__(256)))
 
#define _cvtss_sh(a, imm)
 Converts a 32-bit single-precision float value to a 16-bit half-precision float value.
 
#define _mm_cvtps_ph(a, imm)    ((__m128i)__builtin_ia32_vcvtps2ph((__v4sf)(__m128)(a), (imm)))
 Converts a 128-bit vector containing 32-bit float values into a 128-bit vector containing 16-bit half-precision float values.
 
#define _mm256_cvtps_ph(a, imm)    ((__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm)))
 Converts a 256-bit vector of [8 x float] into a 128-bit vector containing 16-bit half-precision float values.
 

Functions

static __inline float __DEFAULT_FN_ATTRS128 _cvtsh_ss (unsigned short __a)
 Converts a 16-bit half-precision float value into a 32-bit float value.
 
static __inline __m128 __DEFAULT_FN_ATTRS128 _mm_cvtph_ps (__m128i __a)
 Converts a 128-bit vector containing 16-bit half-precision float values into a 128-bit vector containing 32-bit float values.
 
static __inline __m256 __DEFAULT_FN_ATTRS256 _mm256_cvtph_ps (__m128i __a)
 Converts a 128-bit vector containing 16-bit half-precision float values into a 256-bit vector of [8 x float].
 

Macro Definition Documentation

◆ __DEFAULT_FN_ATTRS128

#define __DEFAULT_FN_ATTRS128    __attribute__((__always_inline__, __nodebug__, __target__("f16c"), __min_vector_width__(128)))

Definition at line 18 of file f16cintrin.h.

◆ __DEFAULT_FN_ATTRS256

#define __DEFAULT_FN_ATTRS256    __attribute__((__always_inline__, __nodebug__, __target__("f16c"), __min_vector_width__(256)))

Definition at line 20 of file f16cintrin.h.

◆ _cvtss_sh

#define _cvtss_sh (   a,
  imm 
)
Value:
__extension__ ({ \
(unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
(imm)))[0]); })

Converts a 32-bit single-precision float value to a 16-bit half-precision float value.

unsigned short _cvtss_sh(float a, const int imm);
#define _cvtss_sh(a, imm)
Converts a 32-bit single-precision float value to a 16-bit half-precision float value.
Definition: f16cintrin.h:68

This intrinsic corresponds to the VCVTPS2PH instruction.

Parameters
aA 32-bit single-precision float value to be converted to a 16-bit half-precision float value.
immAn immediate value controlling rounding using bits [2:0]:
000: Nearest
001: Down
010: Up
011: Truncate
1XX: Use MXCSR.RC for rounding
Returns
The converted 16-bit half-precision float value.

Definition at line 68 of file f16cintrin.h.

◆ _mm256_cvtps_ph

#define _mm256_cvtps_ph (   a,
  imm 
)     ((__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm)))

Converts a 256-bit vector of [8 x float] into a 128-bit vector containing 16-bit half-precision float values.

__m128i _mm256_cvtps_ph(__m256 a, const int imm);
#define _mm256_cvtps_ph(a, imm)
Converts a 256-bit vector of [8 x float] into a 128-bit vector containing 16-bit half-precision float...
Definition: f16cintrin.h:138

This intrinsic corresponds to the VCVTPS2PH instruction.

Parameters
aA 256-bit vector containing 32-bit single-precision float values to be converted to 16-bit half-precision float values.
immAn immediate value controlling rounding using bits [2:0]:
000: Nearest
001: Down
010: Up
011: Truncate
1XX: Use MXCSR.RC for rounding
Returns
A 128-bit vector containing the converted 16-bit half-precision float values.

Definition at line 138 of file f16cintrin.h.

◆ _mm_cvtps_ph

#define _mm_cvtps_ph (   a,
  imm 
)     ((__m128i)__builtin_ia32_vcvtps2ph((__v4sf)(__m128)(a), (imm)))

Converts a 128-bit vector containing 32-bit float values into a 128-bit vector containing 16-bit half-precision float values.

__m128i _mm_cvtps_ph(__m128 a, const int imm);
#define _mm_cvtps_ph(a, imm)
Converts a 128-bit vector containing 32-bit float values into a 128-bit vector containing 16-bit half...
Definition: f16cintrin.h:95

This intrinsic corresponds to the VCVTPS2PH instruction.

Parameters
aA 128-bit vector containing 32-bit float values.
immAn immediate value controlling rounding using bits [2:0]:
000: Nearest
001: Down
010: Up
011: Truncate
1XX: Use MXCSR.RC for rounding
Returns
A 128-bit vector containing converted 16-bit half-precision float values. The lower 64 bits are used to store the converted 16-bit half-precision floating-point values.

Definition at line 95 of file f16cintrin.h.

Function Documentation

◆ _cvtsh_ss()

static __inline float __DEFAULT_FN_ATTRS128 _cvtsh_ss ( unsigned short  __a)
static

Converts a 16-bit half-precision float value into a 32-bit float value.

This intrinsic corresponds to the VCVTPH2PS instruction.

Parameters
__aA 16-bit half-precision float value.
Returns
The converted 32-bit float value.

Definition at line 39 of file f16cintrin.h.

References __a, and __v.

◆ _mm256_cvtph_ps()

static __inline __m256 __DEFAULT_FN_ATTRS256 _mm256_cvtph_ps ( __m128i  __a)
static

Converts a 128-bit vector containing 16-bit half-precision float values into a 256-bit vector of [8 x float].

This intrinsic corresponds to the VCVTPH2PS instruction.

Parameters
__aA 128-bit vector containing 16-bit half-precision float values to be converted to 32-bit single-precision float values.
Returns
A vector of [8 x float] containing the converted 32-bit single-precision float values.

Definition at line 154 of file f16cintrin.h.

References __a.

◆ _mm_cvtph_ps()

static __inline __m128 __DEFAULT_FN_ATTRS128 _mm_cvtph_ps ( __m128i  __a)
static

Converts a 128-bit vector containing 16-bit half-precision float values into a 128-bit vector containing 32-bit float values.

This intrinsic corresponds to the VCVTPH2PS instruction.

Parameters
__aA 128-bit vector containing 16-bit half-precision float values. The lower 64 bits are used in the conversion.
Returns
A 128-bit vector of [4 x float] containing converted float values.

Definition at line 110 of file f16cintrin.h.

References __a.