-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshrink_amd64.s
215 lines (185 loc) · 6.89 KB
/
shrink_amd64.s
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
//+build !noasm !appengine
// AUTO-GENERATED BY C2GOASM -- DO NOT EDIT
TEXT ·_packed_mask_avx(SB), $0-24
MOVQ in+0(FP), DI
MOVQ out+8(FP), SI
MOVQ size+16(FP), DX
WORD $0xfa83; BYTE $0x08 // cmp edx, 8
LONG $0x0008b941; WORD $0x0000 // mov r9d, 8
LONG $0xca420f44 // cmovb r9d, edx
LONG $0x20eac148 // shr rdx, 32
WORD $0xfa83; BYTE $0x01 // cmp edx, 1
JNE LBB0_11
WORD $0x8944; BYTE $0xca // mov edx, r9d
WORD $0xeac1; BYTE $0x02 // shr edx, 2
WORD $0xfa83; BYTE $0x02 // cmp edx, 2
JE LBB0_18
WORD $0x8945; BYTE $0xc8 // mov r8d, r9d
LONG $0x03e08341 // and r8d, 3
WORD $0xfa83; BYTE $0x01 // cmp edx, 1
JNE LBB0_4
LONG $0x076ffec5 // vmovdqu ymm0, yword [rdi]
LONG $0xc8d7fdc5 // vpmovmskb ecx, ymm0
WORD $0x8948; BYTE $0x0e // mov qword [rsi], rcx
LBB0_4:
WORD $0x8545; BYTE $0xc0 // test r8d, r8d
JE LBB0_20
LONG $0x05e2c148 // shl rdx, 5
LONG $0x0c6ffec5; BYTE $0x17 // vmovdqu ymm1, yword [rdi + rdx]
LONG $0x046ffac5; BYTE $0x17 // vmovdqu xmm0, oword [rdi + rdx]
LONG $0x02f88341 // cmp r8d, 2
JNE LBB0_6
LONG $0x01f88341 // cmp r8d, 1
JE LBB0_8
LBB0_9:
LONG $0xc8d7fdc5 // vpmovmskb ecx, ymm0
LONG $0x04f98341 // cmp r9d, 4
JAE LBB0_10
JMP LBB0_19
LBB0_11:
LONG $0x0006c748; WORD $0x0000; BYTE $0x00 // mov qword [rsi], 0
WORD $0x8545; BYTE $0xc9 // test r9d, r9d
JE LBB0_20
LONG $0x03e1c141 // shl r9d, 3
WORD $0xc931 // xor ecx, ecx
WORD $0xd231 // xor edx, edx
JMP LBB0_13
LBB0_17:
LONG $0x02c28348 // add rdx, 2
WORD $0x3949; BYTE $0xd1 // cmp r9, rdx
JE LBB0_20
LBB0_13:
LONG $0x00173c80 // cmp byte [rdi + rdx], 0
JS LBB0_14
LONG $0x01177c80; BYTE $0x00 // cmp byte [rdi + rdx + 1], 0
JNS LBB0_17
JMP LBB0_16
LBB0_14:
LONG $0xd1ab0f48 // bts rcx, rdx
WORD $0x8948; BYTE $0x0e // mov qword [rsi], rcx
LONG $0x01177c80; BYTE $0x00 // cmp byte [rdi + rdx + 1], 0
JNS LBB0_17
LBB0_16:
LONG $0x01428d48 // lea rax, [rdx + 1]
LONG $0xc1ab0f48 // bts rcx, rax
WORD $0x8948; BYTE $0x0e // mov qword [rsi], rcx
JMP LBB0_17
LBB0_18:
LONG $0x076ffec5 // vmovdqu ymm0, yword [rdi]
LONG $0xc0d7fdc5 // vpmovmskb eax, ymm0
WORD $0x8948; BYTE $0x06 // mov qword [rsi], rax
LONG $0x476ffec5; BYTE $0x20 // vmovdqu ymm0, yword [rdi + 32]
LONG $0xc8d7fdc5 // vpmovmskb ecx, ymm0
LONG $0x20e1c148 // shl rcx, 32
WORD $0x0948; BYTE $0xc1 // or rcx, rax
JMP LBB0_19
LBB0_6:
LONG $0x027de3c4; WORD $0x30c1 // vpblendd ymm0, ymm0, ymm1, 48
LONG $0x01f88341 // cmp r8d, 1
JNE LBB0_9
LBB0_8:
LONG $0xc17efac5 // vmovq xmm0, xmm1
LONG $0xc8d7fdc5 // vpmovmskb ecx, ymm0
LONG $0x04f98341 // cmp r9d, 4
JB LBB0_19
LBB0_10:
LONG $0x20e1c148 // shl rcx, 32
WORD $0x0b48; BYTE $0x0e // or rcx, qword [rsi]
LBB0_19:
WORD $0x8948; BYTE $0x0e // mov qword [rsi], rcx
LBB0_20:
VZEROUPPER
RET
TEXT ·_packed_mask2_avx(SB), $0-32
MOVQ in+0(FP), DI
MOVQ out+8(FP), SI
MOVQ value+16(FP), DX
MOVQ size+24(FP), CX
WORD $0xf983; BYTE $0x08 // cmp ecx, 8
LONG $0x0008b841; WORD $0x0000 // mov r8d, 8
LONG $0xc1420f44 // cmovb r8d, ecx
LONG $0x20e9c148 // shr rcx, 32
WORD $0xf983; BYTE $0x01 // cmp ecx, 1
JNE LBB1_11
WORD $0x8944; BYTE $0xc1 // mov ecx, r8d
WORD $0xe9c1; BYTE $0x02 // shr ecx, 2
WORD $0xf983; BYTE $0x02 // cmp ecx, 2
JE LBB1_18
WORD $0x8945; BYTE $0xc1 // mov r9d, r8d
LONG $0x03e18341 // and r9d, 3
WORD $0xf983; BYTE $0x01 // cmp ecx, 1
JNE LBB1_4
LONG $0xc26ef9c5 // vmovd xmm0, edx
LONG $0x787de2c4; BYTE $0xc0 // vpbroadcastb ymm0, xmm0
LONG $0x0774fdc5 // vpcmpeqb ymm0, ymm0, yword [rdi]
LONG $0xc0d7fdc5 // vpmovmskb eax, ymm0
WORD $0x8948; BYTE $0x06 // mov qword [rsi], rax
LBB1_4:
WORD $0x8545; BYTE $0xc9 // test r9d, r9d
JE LBB1_20
LONG $0x05e1c148 // shl rcx, 5
LONG $0x0c6ffec5; BYTE $0x0f // vmovdqu ymm1, yword [rdi + rcx]
LONG $0x046ffac5; BYTE $0x0f // vmovdqu xmm0, oword [rdi + rcx]
LONG $0x02f98341 // cmp r9d, 2
JE LBB1_7
LONG $0x027de3c4; WORD $0x30c1 // vpblendd ymm0, ymm0, ymm1, 48
LBB1_7:
LONG $0x01f98341 // cmp r9d, 1
JNE LBB1_9
LONG $0xc17efac5 // vmovq xmm0, xmm1
LBB1_9:
LONG $0xca6ef9c5 // vmovd xmm1, edx
LONG $0x787de2c4; BYTE $0xc9 // vpbroadcastb ymm1, xmm1
LONG $0xc074f5c5 // vpcmpeqb ymm0, ymm1, ymm0
LONG $0xc0d7fdc5 // vpmovmskb eax, ymm0
LONG $0x04f88341 // cmp r8d, 4
JB LBB1_19
LONG $0x20e0c148 // shl rax, 32
WORD $0x0b48; BYTE $0x06 // or rax, qword [rsi]
JMP LBB1_19
LBB1_11:
LONG $0x0006c748; WORD $0x0000; BYTE $0x00 // mov qword [rsi], 0
WORD $0x8545; BYTE $0xc0 // test r8d, r8d
JE LBB1_20
LONG $0x03e0c141 // shl r8d, 3
WORD $0x3145; BYTE $0xc9 // xor r9d, r9d
WORD $0xc031 // xor eax, eax
JMP LBB1_13
LBB1_17:
LONG $0x02c08348 // add rax, 2
WORD $0x3949; BYTE $0xc0 // cmp r8, rax
JE LBB1_20
LBB1_13:
LONG $0x070cb60f // movzx ecx, byte [rdi + rax]
WORD $0x3948; BYTE $0xd1 // cmp rcx, rdx
JE LBB1_14
LONG $0x074cb60f; BYTE $0x01 // movzx ecx, byte [rdi + rax + 1]
WORD $0x3948; BYTE $0xd1 // cmp rcx, rdx
JNE LBB1_17
JMP LBB1_16
LBB1_14:
LONG $0xc1ab0f49 // bts r9, rax
WORD $0x894c; BYTE $0x0e // mov qword [rsi], r9
LONG $0x074cb60f; BYTE $0x01 // movzx ecx, byte [rdi + rax + 1]
WORD $0x3948; BYTE $0xd1 // cmp rcx, rdx
JNE LBB1_17
LBB1_16:
LONG $0x01488d48 // lea rcx, [rax + 1]
LONG $0xc9ab0f49 // bts r9, rcx
WORD $0x894c; BYTE $0x0e // mov qword [rsi], r9
JMP LBB1_17
LBB1_18:
LONG $0xc26ef9c5 // vmovd xmm0, edx
LONG $0x787de2c4; BYTE $0xc0 // vpbroadcastb ymm0, xmm0
LONG $0x0f74fdc5 // vpcmpeqb ymm1, ymm0, yword [rdi]
LONG $0xc9d7fdc5 // vpmovmskb ecx, ymm1
WORD $0x8948; BYTE $0x0e // mov qword [rsi], rcx
LONG $0x4774fdc5; BYTE $0x20 // vpcmpeqb ymm0, ymm0, yword [rdi + 32]
LONG $0xc0d7fdc5 // vpmovmskb eax, ymm0
LONG $0x20e0c148 // shl rax, 32
WORD $0x0948; BYTE $0xc8 // or rax, rcx
LBB1_19:
WORD $0x8948; BYTE $0x06 // mov qword [rsi], rax
LBB1_20:
VZEROUPPER
RET