-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasmfunc2.asm
More file actions
57 lines (44 loc) · 854 Bytes
/
Copy pathasmfunc2.asm
File metadata and controls
57 lines (44 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
;SIMD XMM
section .text
bits 64
default rel
global vec_SIMDX
vec_SIMDX:
;to access d from shadow space
mov r10, [rsp+40]
mov rax, rcx
shr rcx, 2
and rax, 3
cmp rcx, 0
je done_L1
L1:
vmovdqu xmm1, [r8]
vmovdqu xmm2, [r9]
vmovdqu xmm3, [r10]
vmulps xmm4, xmm2, xmm3
vaddps xmm0, xmm4, xmm1
vmovdqu [rdx], xmm0
add r8, 16
add r9, 16
add r10, 16
add rdx, 16
loop L1
done_L1:
; remainder loop
cmp rax, 0
je tapos
mov rcx, rax
remainder:
vmovss xmm1, [r8]
vmovss xmm2, [r9]
vmovss xmm3, [r10]
vmulss xmm4, xmm2, xmm3
vaddss xmm0, xmm4, xmm1
vmovss [rdx], xmm0
add r8, 4
add r9, 4
add r10, 4
add rdx, 4
loop remainder
tapos:
ret