github.com/emmansun/gmsm@v0.29.1/sm4/xts_macros_arm64.s (about)

     1  #define mul2Inline        \
     2  	VMOV	TW.D[1], I;                     \
     3  	ASR	$63, I;                             \
     4  	VMOV	I, K0.D2;                       \
     5  	VAND	POLY.B16, K0.B16, K0.B16;       \
     6  	\
     7  	VUSHR	$63, TW.D2, K1.D2;              \
     8  	VEXT	$8, K1.B16, ZERO.B16, K1.B16;   \
     9  	VSLI	$1, TW.D2, K1.D2;               \
    10  	VEOR	K0.B16, K1.B16, TW.B16
    11  
    12  #define mul2GBInline        \
    13  	VREV64 TW.B16, TW.B16;                  \
    14  	VEXT	$8, TW.B16, TW.B16, TW.B16;     \
    15  	\
    16  	VMOV	TW.D[0], I;                     \
    17  	LSL $63, I;                             \
    18  	ASR $63, I;                             \
    19  	VMOV	I, K0.D2;                       \
    20  	VAND	POLY.B16, K0.B16, K0.B16;       \
    21  	\
    22  	VSHL $63, TW.D2, K1.D2;                 \
    23  	VEXT	$8, ZERO.B16, K1.B16, K1.B16;   \
    24  	VSRI	$1, TW.D2, K1.D2;               \
    25  	VEOR	K0.B16, K1.B16, TW.B16;         \
    26  	\
    27  	VEXT	$8, TW.B16, TW.B16, TW.B16;     \
    28  	VREV64 TW.B16, TW.B16
    29  
    30  #define prepare4Tweaks \
    31  	VMOV TW.B16, T0.B16;   \
    32  	mul2Inline;            \
    33  	VMOV TW.B16, T1.B16;   \
    34  	mul2Inline;            \
    35  	VMOV TW.B16, T2.B16;   \
    36  	mul2Inline;            \
    37  	VMOV TW.B16, T3.B16;   \
    38  	mul2Inline
    39  
    40  #define prepare8Tweaks \
    41  	prepare4Tweaks;        \
    42  	VMOV TW.B16, T4.B16;   \
    43  	mul2Inline;            \
    44  	VMOV TW.B16, T5.B16;   \
    45  	mul2Inline;            \
    46  	VMOV TW.B16, T6.B16;   \
    47  	mul2Inline;            \
    48  	VMOV TW.B16, T7.B16;   \
    49  	mul2Inline
    50  
    51  #define prepareGB4Tweaks \
    52  	VMOV TW.B16, T0.B16;     \
    53  	mul2GBInline;            \
    54  	VMOV TW.B16, T1.B16;     \
    55  	mul2GBInline;            \
    56  	VMOV TW.B16, T2.B16;     \
    57  	mul2GBInline;            \
    58  	VMOV TW.B16, T3.B16;     \
    59  	mul2GBInline
    60  
    61  #define prepareGB8Tweaks \
    62  	prepareGB4Tweaks;        \
    63  	VMOV TW.B16, T4.B16;     \
    64  	mul2GBInline;            \
    65  	VMOV TW.B16, T5.B16;     \
    66  	mul2GBInline;            \
    67  	VMOV TW.B16, T6.B16;     \
    68  	mul2GBInline;            \
    69  	VMOV TW.B16, T7.B16;     \
    70  	mul2GBInline