;
; Исходный код среды исполнения ПВТ-ОО.
;
; Этот исходный код является частью проекта ПВТ-ОО.
;
; Copyright © 2021 Малик Разработчик
;
; Это свободная программа: вы можете перераспространять её и/или
; изменять её на условиях Меньшей Стандартной общественной лицензии GNU в том виде,
; в каком она была опубликована Фондом свободного программного обеспечения;
; либо версии 3 лицензии, либо (по вашему выбору) любой более поздней версии.
;
; Эта программа распространяется в надежде, что она может быть полезна,
; но БЕЗО ВСЯКИХ ГАРАНТИЙ; даже без неявной гарантии ТОВАРНОГО ВИДА
; или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЁННЫХ ЦЕЛЕЙ. Подробнее см. в Меньшей Стандартной
; общественной лицензии GNU.
;
; Вы должны были получить копию Меньшей Стандартной общественной лицензии GNU
; вместе с этой программой. Если это не так, см.
; <http://www.gnu.org/licenses/>.
;
; <fold push/pop/peek>
if(used inst$f4push) ; <fold >
inst f4push ; (value in xmm0)
push1
vmovdqa xword[rsp], xmm0
set TAG_FLOAT4
end_inst
end if ; </fold>
if(used inst$f4pop) ; <fold >
inst f4pop ; (): value in xmm0
overify TAG_FLOAT4
vmovdqa xmm0, [rsp]
pop1set
end_inst
end if ; </fold>
; </fold>
; <fold conversion>
if(used inst$f4toi4) ; <fold >
inst f4toi4
overify TAG_FLOAT4
vmovdqa xmm0, [rsp]
vcvttps2dq xmm1, xmm0
vmovdqa xmm2, [f8.00]
vcmpps xmm2, xmm2, xmm0, $02
vcmpps xmm3, xmm0, xmm0, $07
vpaddd xmm0, xmm1, xmm2
vpand xmm0, xmm0, xmm3
vmovdqa xword[rsp], xmm0
set TAG_INT4
end_inst
end if ; </fold>
if(used inst$f4tol4) ; <fold >
inst f4tol4
overify TAG_FLOAT4
push1
vcvtps2pd ymm0, [rsp+$10]
vcvttpd2qq ymm1, ymm0
vmovdqa ymm2, [d8.01]
vcmppd ymm2, ymm2, ymm0, $02
vcmppd ymm3, ymm0, ymm0, $07
vpaddq ymm0, ymm1, ymm2
vpand ymm0, ymm0, ymm3
vmovdqu yword[rsp], ymm0
set TAG_LONG4
end_inst
end if ; </fold>
if(used inst$f4tof) ; <fold >
inst f4tof
overify TAG_FLOAT4
vmovd xmm0, [rsp]
vmovdqa xword[rsp], xmm0
set TAG_FLOAT
end_inst
end if ; </fold>
if(used inst$f4tof2) ; <fold >
inst f4tof2
overify TAG_FLOAT4
vmovq xmm0, [rsp]
vmovdqa xword[rsp], xmm0
set TAG_FLOAT2
end_inst
end if ; </fold>
if(used inst$f4tof8) ; <fold >
inst f4tof8
overify TAG_FLOAT4
push1
vmovdqa xmm0, [rsp+$10]
vmovdqu yword[rsp], ymm0
set TAG_FLOAT8
end_inst
end if ; </fold>
if(used inst$f4tod4) ; <fold >
inst f4tod4
overify TAG_FLOAT4
push1
vcvtps2pd ymm0, [rsp+$10]
vmovdqu yword[rsp], ymm0
set TAG_DOUBLE4
end_inst
end if ; </fold>
; </fold>
; <fold relation>
if(used inst$f4se) ; <fold >
inst f4se
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vcmpps xmm0, xmm0, [rsp], $00
vmovmskps eax, xmm0
cmp eax, $0f
sete al
movsx eax, al
vmovd xmm0, eax
vmovdqa xword[rsp+$10], xmm0
pop1set TAG_INT
end_inst
end if ; </fold>
if(used inst$f4sne) ; <fold >
inst f4sne
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vcmpps xmm0, xmm0, [rsp], $00
vmovmskps eax, xmm0
cmp eax, $0f
setne al
movsx eax, al
vmovd xmm0, eax
vmovdqa xword[rsp+$10], xmm0
pop1set TAG_INT
end_inst
end if ; </fold>
; </fold>
; <fold scalar>
if(used inst$f4sneg | used inst$f4vneg) ; <fold >
inst f4sneg, f4vneg
overify TAG_FLOAT4
vpxor xmm0, xmm0, xmm0
vsubps xmm0, xmm0, [rsp]
vmovdqa xword[rsp], xmm0
end_inst
end if ; </fold>
if(used inst$f4smul) ; <fold >
inst f4smul
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmovdqa xmm1, [rsp+$00]
vshufps xmm4, xmm1, xmm1, $e4
vshufps xmm5, xmm4, xmm4, $b1
vshufps xmm6, xmm4, xmm4, $4e
vshufps xmm7, xmm4, xmm4, $1b
vmulps xmm4, xmm4, [f4.q0]
vmulps xmm5, xmm5, [f4.q1]
vmulps xmm6, xmm6, [f4.q2]
vmulps xmm7, xmm7, [f4.q3]
vmulps xmm3, xmm0, xmm7
vmulps xmm2, xmm0, xmm6
vmulps xmm1, xmm0, xmm5
vmulps xmm0, xmm0, xmm4
vhaddps xmm0, xmm0, xmm1
vhaddps xmm1, xmm2, xmm3
vhaddps xmm0, xmm0, xmm1
vmovdqa xword[rsp+$10], xmm0
pop1set
end_inst
end if ; </fold>
if(used inst$f4sdiv) ; <fold >
inst f4sdiv
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmovdqa xmm1, [rsp+$00]
vmulps xmm1, xmm1, [f4.q0]
vmulps xmm2, xmm1, xmm1
vhaddps xmm2, xmm2, xmm2
vhaddps xmm2, xmm2, xmm2
vdivps xmm1, xmm1, xmm2
vshufps xmm4, xmm1, xmm1, $e4
vshufps xmm5, xmm4, xmm4, $b1
vshufps xmm6, xmm4, xmm4, $4e
vshufps xmm7, xmm4, xmm4, $1b
vmulps xmm4, xmm4, [f4.q0]
vmulps xmm5, xmm5, [f4.q1]
vmulps xmm6, xmm6, [f4.q2]
vmulps xmm7, xmm7, [f4.q3]
vmulps xmm3, xmm0, xmm7
vmulps xmm2, xmm0, xmm6
vmulps xmm1, xmm0, xmm5
vmulps xmm0, xmm0, xmm4
vhaddps xmm0, xmm0, xmm1
vhaddps xmm1, xmm2, xmm3
vhaddps xmm0, xmm0, xmm1
vmovdqa xword[rsp+$10], xmm0
pop1set
end_inst
end if ; </fold>
if(used inst$f4sdivu) ; <fold >
inst f4sdivu
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$00]
vmovdqa xmm1, [rsp+$10]
vmulps xmm0, xmm0, [f4.q0]
vmulps xmm2, xmm0, xmm0
vhaddps xmm2, xmm2, xmm2
vhaddps xmm2, xmm2, xmm2
vdivps xmm0, xmm0, xmm2
vshufps xmm4, xmm1, xmm1, $e4
vshufps xmm5, xmm4, xmm4, $b1
vshufps xmm6, xmm4, xmm4, $4e
vshufps xmm7, xmm4, xmm4, $1b
vmulps xmm4, xmm4, [f4.q0]
vmulps xmm5, xmm5, [f4.q1]
vmulps xmm6, xmm6, [f4.q2]
vmulps xmm7, xmm7, [f4.q3]
vmulps xmm3, xmm0, xmm7
vmulps xmm2, xmm0, xmm6
vmulps xmm1, xmm0, xmm5
vmulps xmm0, xmm0, xmm4
vhaddps xmm0, xmm0, xmm1
vhaddps xmm1, xmm2, xmm3
vhaddps xmm0, xmm0, xmm1
vmovdqa xword[rsp+$10], xmm0
pop1set
end_inst
end if ; </fold>
if(used inst$f4sadd | used inst$f4vadd) ; <fold >
inst f4sadd, f4vadd
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vaddps xmm0, xmm0, [rsp]
vmovdqa xword[rsp+$10], xmm0
pop1set
end_inst
end if ; </fold>
if(used inst$f4ssub | used inst$f4vsub) ; <fold >
inst f4ssub, f4vsub
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vsubps xmm0, xmm0, [rsp]
vmovdqa xword[rsp+$10], xmm0
pop1set
end_inst
end if ; </fold>
; </fold>
; <fold vector>
if(used inst$f4vmul) ; <fold >
inst f4vmul
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmulps xmm0, xmm0, [rsp]
vmovdqa xword[rsp+$10], xmm0
pop1set
end_inst
end if ; </fold>
if(used inst$f4vdiv) ; <fold >
inst f4vdiv
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vdivps xmm0, xmm0, [rsp]
vmovdqa xword[rsp+$10], xmm0
pop1set
end_inst
end if ; </fold>
if(used inst$f4vg) ; <fold >
inst f4vg
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmovdqa xmm1, [rsp+$00]
vcmpps xmm0, xmm1, xmm0, $01
vmovdqa xword[rsp+$10], xmm0
pop1set TAG_INT4
end_inst
end if ; </fold>
if(used inst$f4vge) ; <fold >
inst f4vge
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmovdqa xmm1, [rsp+$00]
vcmpps xmm0, xmm1, xmm0, $02
vmovdqa xword[rsp+$10], xmm0
pop1set TAG_INT4
end_inst
end if ; </fold>
if(used inst$f4vl) ; <fold >
inst f4vl
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmovdqa xmm1, [rsp+$00]
vcmpps xmm0, xmm0, xmm1, $01
vmovdqa xword[rsp+$10], xmm0
pop1set TAG_INT4
end_inst
end if ; </fold>
if(used inst$f4vle) ; <fold >
inst f4vle
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmovdqa xmm1, [rsp+$00]
vcmpps xmm0, xmm0, xmm1, $02
vmovdqa xword[rsp+$10], xmm0
pop1set TAG_INT4
end_inst
end if ; </fold>
if(used inst$f4ve) ; <fold >
inst f4ve
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmovdqa xmm1, [rsp+$00]
vcmpps xmm0, xmm0, xmm1, $00
vmovdqa xword[rsp+$10], xmm0
pop1set TAG_INT4
end_inst
end if ; </fold>
if(used inst$f4vne) ; <fold >
inst f4vne
overify TAG_FLOAT4, TAG_FLOAT4
vmovdqa xmm0, [rsp+$10]
vmovdqa xmm1, [rsp+$00]
vcmpps xmm0, xmm0, xmm1, $04
vmovdqa xword[rsp+$10], xmm0
pop1set TAG_INT4
end_inst
end if ; </fold>
; </fold>