-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasmfunc3.asm
More file actions
56 lines (43 loc) · 840 Bytes
/
Copy pathasmfunc3.asm
File metadata and controls
56 lines (43 loc) · 840 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
;SIMD YMM
section .text
bits 64
default rel
global vec_SIMDY
vec_SIMDY:
;to access d from shadow space
mov r10, [rsp+40]
mov rax, rcx
shr rcx, 3
and rax, 7
cmp rcx, 0
je done_L1
L1:
vmovdqu ymm1, [r8]
vmovdqu ymm2, [r9]
vmovdqu ymm3, [r10]
vmulps ymm4, ymm2, ymm3
vaddps ymm0, ymm4, ymm1
vmovdqu [rdx], ymm0
add r8, 32
add r9, 32
add r10, 32
add rdx, 32
loop L1
done_L1:
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