1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 02:46:33 -05:00
v2fly/transport/internet/kcp/xor_amd64.s

48 lines
752 B
ArmAsm
Raw Normal View History

#include "textflag.h"
// func xorfwd(x []byte)
TEXT ·xorfwd(SB),NOSPLIT,$0
MOVQ x+0(FP), SI // x[i]
2017-08-29 08:50:53 -04:00
MOVQ x_len+8(FP), CX // x.len
MOVQ x+0(FP), DI
ADDQ $4, DI // x[i+4]
SUBQ $4, CX
2016-12-01 18:09:57 -05:00
xorfwdloop:
MOVL (SI), AX
XORL AX, (DI)
ADDQ $4, SI
ADDQ $4, DI
SUBQ $4, CX
CMPL CX, $0
2016-12-01 18:09:57 -05:00
JE xorfwddone
2016-12-01 18:09:57 -05:00
JMP xorfwdloop
xorfwddone:
RET
// func xorbkd(x []byte)
TEXT ·xorbkd(SB),NOSPLIT,$0
MOVQ x+0(FP), SI
2017-08-29 08:50:53 -04:00
MOVQ x_len+8(FP), CX // x.len
MOVQ x+0(FP), DI
ADDQ CX, SI // x[-8]
SUBQ $8, SI
ADDQ CX, DI // x[-4]
SUBQ $4, DI
SUBQ $4, CX
2016-12-01 18:09:57 -05:00
xorbkdloop:
MOVL (SI), AX
XORL AX, (DI)
SUBQ $4, SI
SUBQ $4, DI
SUBQ $4, CX
CMPL CX, $0
2016-12-01 18:09:57 -05:00
JE xorbkddone
2016-12-01 18:09:57 -05:00
JMP xorbkdloop
2016-12-01 18:09:57 -05:00
xorbkddone:
RET