| 1 |
// |
| 2 |
// arch/x86_64/rsp/gcc/vlt.s |
| 3 |
// |
| 4 |
// CEN64: Cycle-Accurate Nintendo 64 Emulator. |
| 5 |
// Copyright (C) 2015, Tyler J. Stachecki. |
| 6 |
// |
| 7 |
// This file is subject to the terms and conditions defined in |
| 8 |
// 'LICENSE', which is part of this source code package. |
| 9 |
// |
| 10 |
|
| 11 |
.include "rsp/gcc/defs.h" |
| 12 |
|
| 13 |
.text |
| 14 |
|
| 15 |
.ifdef __MINGW__ |
| 16 |
.globl RSP_VLT |
| 17 |
.def RSP_VLT; .scl 2; .type 32; .endef |
| 18 |
.seh_proc RSP_VLT |
| 19 |
.ifndef __VECTORCALL__ |
| 20 |
RSP_VLT: |
| 21 |
movdqa (%r8), %xmm0 |
| 22 |
movdqa (%r9), %xmm1 |
| 23 |
#pxor %xmm2, %xmm2 |
| 24 |
.endif |
| 25 |
.else |
| 26 |
.global RSP_VLT |
| 27 |
.type RSP_VLT, @function |
| 28 |
RSP_VLT: |
| 29 |
.endif |
| 30 |
|
| 31 |
.ifdef __AVX__ |
| 32 |
vpcmpeqw %xmm1, %xmm0, %xmm3 |
| 33 |
vpcmpgtw %xmm1, %xmm0, %xmm4 |
| 34 |
pxor vcc_hi, vcc_hi |
| 35 |
// vpandn %xmm3, vco_hi, %xmm3 |
| 36 |
vpand %xmm3, vco_hi, %xmm3 |
| 37 |
pxor vco_hi, vco_hi |
| 38 |
pand vco_lo, %xmm3 |
| 39 |
vpor %xmm3, %xmm4, vcc_lo |
| 40 |
pxor vco_lo, vco_lo |
| 41 |
vpblendvb vcc_lo, %xmm1, %xmm0, %xmm0 |
| 42 |
movdqa %xmm0, acc_lo |
| 43 |
retq |
| 44 |
|
| 45 |
.else |
| 46 |
movdqa %xmm1, %xmm3 |
| 47 |
movdqa %xmm0, vcc_lo |
| 48 |
pcmpeqw %xmm0, %xmm3 |
| 49 |
pcmpgtw %xmm1, vcc_lo |
| 50 |
// pandn vco_lo, vco_hi |
| 51 |
pand vco_lo, vco_hi |
| 52 |
pminsw %xmm1, %xmm0 |
| 53 |
pand %xmm3, vco_hi |
| 54 |
pxor vcc_hi, vcc_hi |
| 55 |
movdqa %xmm0, acc_lo |
| 56 |
por vco_hi, vcc_lo |
| 57 |
pxor vco_lo, vco_lo |
| 58 |
pxor vco_hi, vco_hi |
| 59 |
retq |
| 60 |
.endif |
| 61 |
|
| 62 |
.ifdef __MINGW__ |
| 63 |
.seh_endproc |
| 64 |
.else |
| 65 |
.size RSP_VLT,.-RSP_VLT |
| 66 |
.endif |
| 67 |
|