.macro red32c r x=12
#vpcmpeqd	%ymm3,%ymm3,%ymm3
#vpslld		$26,%ymm3,%ymm3
vpmuldq		%ymm2,%ymm\r,%ymm\x
vpsrlq		$32,%ymm\x,%ymm\x
vpsubd		%ymm3,%ymm\x,%ymm\x
vpsrad		$27,%ymm\x,%ymm\x
vpmuldq		%ymm1,%ymm\x,%ymm\x
vpsubd		%ymm\x,%ymm\r,%ymm\r
.endm

.macro red32p r x=12
vpmuldq		%ymm2,%ymm\r,%ymm\x
vpsrlq		$32,%ymm\x,%ymm\x
vpsrad		$27,%ymm\x,%ymm\x
vpmuldq		%ymm1,%ymm\x,%ymm\x
vpsubd		%ymm\x,%ymm\r,%ymm\r
.endm

.macro red32n r x=12
#vpxor		%ymm3,%ymm3,%ymm3
vpmuldq		%ymm2,%ymm\r,%ymm\x
vpsrlq		$32,%ymm\x,%ymm\x
vpsubd		%ymm\x,%ymm3,%ymm\x
vpsrad		$27,%ymm\x,%ymm\x
vpmuldq		%ymm1,%ymm\x,%ymm\x
vpaddd		%ymm\x,%ymm\r,%ymm\r
.endm
