1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-12-04 13:24:04 +00:00
pqcrypto/crypto_kem/kyber512-90s/avx2/fq.inc

30 lines
663 B
PHP
Raw Normal View History

.macro red16 r,x=12
2019-09-17 13:02:01 +01:00
vpmulhw %ymm1,%ymm\r,%ymm\x
vpsraw $10,%ymm\x,%ymm\x
vpmullw %ymm0,%ymm\x,%ymm\x
vpsubw %ymm\x,%ymm\r,%ymm\r
.endm
.macro csubq r,x=12
2019-09-17 13:02:01 +01:00
vpsubw %ymm0,%ymm\r,%ymm\r
vpsraw $15,%ymm\r,%ymm\x
vpand %ymm0,%ymm\x,%ymm\x
vpaddw %ymm\x,%ymm\r,%ymm\r
#vpcmpgtw %ymm0,%ymm\r,%ymm\x
#vpand %ymm0,%ymm\x,%ymm\x
#vpsubw %ymm\x,%ymm\r,%ymm\r
2019-09-17 13:02:01 +01:00
.endm
.macro caddq r,x=12
2019-09-17 13:02:01 +01:00
vpsraw $15,%ymm\r,%ymm\x
vpand %ymm0,%ymm\x,%ymm\x
vpaddw %ymm\x,%ymm\r,%ymm\r
.endm
.macro fqmulprecomp al,ah,b,x=12
2019-09-17 13:02:01 +01:00
vpmullw %ymm\al,%ymm\b,%ymm\x
vpmulhw %ymm\ah,%ymm\b,%ymm\b
vpmulhw %ymm0,%ymm\x,%ymm\x
vpsubw %ymm\x,%ymm\b,%ymm\b
.endm