mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-10-04 20:45:54 +00:00
Revert "temporarily disable asm code"
This reverts commit 6e28b4f91d31faa89c4f96c575a83d42c34c3937.
This commit is contained in:
parent
354ef3c27d
commit
e0a2247a07
@ -1,3 +1,5 @@
|
|||||||
|
// +build !amd64
|
||||||
|
|
||||||
package kcp
|
package kcp
|
||||||
|
|
||||||
// xorfwd performs XOR forwards in words, x[i] ^= x[i-4], i from 0 to len
|
// xorfwd performs XOR forwards in words, x[i] ^= x[i-4], i from 0 to len
|
||||||
|
4
transport/internet/kcp/xor_amd64.go
Normal file
4
transport/internet/kcp/xor_amd64.go
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
package kcp
|
||||||
|
|
||||||
|
func xorfwd(x []byte)
|
||||||
|
func xorbkd(x []byte)
|
47
transport/internet/kcp/xor_amd64.s
Normal file
47
transport/internet/kcp/xor_amd64.s
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
// func xorfwd(x []byte)
|
||||||
|
TEXT ·xorfwd(SB),NOSPLIT,$0
|
||||||
|
MOVQ x+0(FP), SI // x[i]
|
||||||
|
MOVQ x_len+8(FP), CX // x.len
|
||||||
|
MOVQ x+0(FP), DI
|
||||||
|
ADDQ $4, DI // x[i+4]
|
||||||
|
SUBQ $4, CX
|
||||||
|
xorfwdloop:
|
||||||
|
MOVL (SI), AX
|
||||||
|
XORL AX, (DI)
|
||||||
|
ADDQ $4, SI
|
||||||
|
ADDQ $4, DI
|
||||||
|
SUBQ $4, CX
|
||||||
|
|
||||||
|
CMPL CX, $0
|
||||||
|
JE xorfwddone
|
||||||
|
|
||||||
|
JMP xorfwdloop
|
||||||
|
xorfwddone:
|
||||||
|
RET
|
||||||
|
|
||||||
|
// func xorbkd(x []byte)
|
||||||
|
TEXT ·xorbkd(SB),NOSPLIT,$0
|
||||||
|
MOVQ x+0(FP), SI
|
||||||
|
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
|
||||||
|
xorbkdloop:
|
||||||
|
MOVL (SI), AX
|
||||||
|
XORL AX, (DI)
|
||||||
|
SUBQ $4, SI
|
||||||
|
SUBQ $4, DI
|
||||||
|
SUBQ $4, CX
|
||||||
|
|
||||||
|
CMPL CX, $0
|
||||||
|
JE xorbkddone
|
||||||
|
|
||||||
|
JMP xorbkdloop
|
||||||
|
|
||||||
|
xorbkddone:
|
||||||
|
RET
|
Loading…
x
Reference in New Issue
Block a user