모두의 코드
VGETEXPPS (Intel x86/64 assembly instruction)

작성일 : 2020-09-01 이 글은 591 번 읽혔습니다.

VGETEXPPS

Convert Exponents of Packed SP FP Values to SP FP Values

참고 사항

아래 표를 해석하는 방법은 x86-64 명령어 레퍼런스 읽는 법 글을 참조하시기 바랍니다.

Opcode/
Instruction

Op/
En

64/32
bit Mode
Support

CPUID
Feature
Flag

Description

EVEX.128.66.0F38.W0 42 /r
VGETEXPPS xmm1 {k1}{z} xmm2/m128/m32bcst

FV

V/V

AVX512VL
AVX512F

Convert the exponent of packed single-precision floating-point values in the source operand to SP FP results representing unbiased integer exponents and stores the results in the destination register.

EVEX.256.66.0F38.W0 42 /r
VGETEXPPS ymm1 {k1}{z} ymm2/m256/m32bcst

FV

V/V

AVX512VL
AVX512F

Convert the exponent of packed single-precision floating-point values in the source operand to SP FP results representing unbiased integer exponents and stores the results in the destination register.

EVEX.512.66.0F38.W0 42 /r
VGETEXPPS zmm1 {k1}{z} zmm2/m512/m32bcst{sae}

FV

V/V

AVX512F

Convert the exponent of packed single-precision floating-point values in the source operand to SP FP results representing unbiased integer exponents and stores the results in the destination register.

Instruction Operand Encoding

Op/En

Operand 1

Operand 2

Operand 3

Operand 4

FV

ModRM:reg (w)

ModRM:r/m (r)

NA

NA

Description

Extracts the biased exponents from the normalized SP FP representation of each dword element of the source operand (the second operand) as unbiased signed integer value, or convert the denormal representation of input data to unbiased negative integer values. Each integer value of the unbiased exponent is converted to single-preci-sion FP value and written to the corresponding dword elements of the destination operand (the first operand) as SP FP numbers.

The destination operand is a ZMM/YMM/XMM register and updated under the writemask. The source operand can be a ZMM/YMM/XMM register, a 512/256/128-bit memory location, or a 512/256/128-bit vector broadcasted from a 32-bit memory location.

EVEX.vvvv is reserved and must be 1111b, otherwise instructions will #UD.

Each GETEXP operation converts the exponent value into a FP number (permitting input value in denormal repre-sentation). Special cases of input values are listed in Table 5-8.

The formula is:

GETEXP(x) = floor(log2(|x|))

Notation floor(x) stands for maximal integer not exceeding real number x.

Software usage of VGETEXPxx and VGETMANTxx instructions generally involve a combination of GETEXP operation and GETMANT operation (see VGETMANTPD). Thus VGETEXPxx instruction do not require software to handle SIMD FP exceptions.

Table 5-8. VGETEXPPS/SS Special Cases

Input Operand

Result

Comments

src1 = NaN

QNaN(src1)

No Exceptions

0 <

src1

< INF

floor(log2(

src1

))

src1

= +INF

+INF

src1

= 0

-INF

Figure 5-14 illustrates the VGETEXPPS functionality on input values with normalized representation.

o t c r F p 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 ^ 2 = ) h S P 2 I _ t v C 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = s - T 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s B a 0 i B - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 0 = 3 , c r S A 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ^ 2 = 0 c r s 0 1 2 3 4 5 7 8 0 1 1 1 1 3 4 1 5 1 6 1 9 0 0 1 2 2 2 3 1 4 2 5 6 2 7 2 8 9 2 0 3 1 0 0 P x 1 m 2 0 0 0 0 0 ( 0 n 1 0 0 0 0 0 1 1 1 2 S 0 1 S 1 i 2 0 0 2 1 1 0 a 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 0 h 1 0 0 7 0 e 9 1 p R 0 1 1 0 0 0 0 a 0 1 6 2 0 0 1 1 3 0 0 8 2 0 1 0 1 i
Figure 5-14. VGETEXPPS Functionality On Normal Input values

Operation

VGETEXPPS (EVEX encoded versions)

(KL, VL) = (4, 128), (8, 256), (16, 512)
FOR j <-  0 TO KL-1
    i <-  j * 32
    IF k1[j] OR *no writemask*
          THEN 
                IF (EVEX.b = 1) AND (SRC *is memory*)
                      THEN
                            DEST[i+31:i] <-
                ConvertExpSPFP(SRC[31:0])
                      ELSE 
                            DEST[i+31:i] <-
                ConvertExpSPFP(SRC[i+31:i])
                FI;
          ELSE 
                IF *merging-masking* ; merging-masking
                      THEN *DEST[i+31:i] remains unchanged*
                      ELSE  ; zeroing-masking
                            DEST[i+31:i] <-  0
                FI
    FI;
ENDFOR
DEST[MAX_VL-1:VL] <-  0

Intel C/C++ Compiler Intrinsic Equivalent

VGETEXPPS __m512 _mm512_getexp_ps(__m512 a);
VGETEXPPS __m512 _mm512_mask_getexp_ps(__m512 s, __mmask16 k, __m512 a);
VGETEXPPS __m512 _mm512_maskz_getexp_ps(__mmask16 k, __m512 a);
VGETEXPPS __m512 _mm512_getexp_round_ps(__m512 a, int sae);
VGETEXPPS __m512 _mm512_mask_getexp_round_ps(__m512 s, __mmask16 k, __m512 a,
                                             int sae);
VGETEXPPS __m512 _mm512_maskz_getexp_round_ps(__mmask16 k, __m512 a, int sae);
VGETEXPPS __m256 _mm256_getexp_ps(__m256 a);
VGETEXPPS __m256 _mm256_mask_getexp_ps(__m256 s, __mmask8 k, __m256 a);
VGETEXPPS __m256 _mm256_maskz_getexp_ps(__mmask8 k, __m256 a);
VGETEXPPS __m128 _mm_getexp_ps(__m128 a);
VGETEXPPS __m128 _mm_mask_getexp_ps(__m128 s, __mmask8 k, __m128 a);
VGETEXPPS __m128 _mm_maskz_getexp_ps(__mmask8 k, __m128 a);

SIMD Floating-Point Exceptions

Invalid, Denormal

Other Exceptions

See Exceptions Type E2.

#UD If EVEX.vvvv != 1111B.

첫 댓글을 달아주세요!
프로필 사진 없음
강좌에 관련 없이 궁금한 내용은 여기를 사용해주세요

    댓글을 불러오는 중입니다..