lab.nexedi.com will be down from Thursday, 20 March 2025, 07:30:00 UTC for a duration of approximately 2 hours

Commit f78b09e6 authored by Robert Griesemer's avatar Robert Griesemer

big: assembly routines for 386 long shifts

R=rsc
CC=golang-dev
https://golang.org/cl/974043
parent 2b0a30c4
......@@ -100,17 +100,52 @@ E4: CMPL BX, BP // i < n
// func shlVW(z, x *Word, s Word, n int) (c Word)
// TODO(gri) implement this routine
TEXT ·shlVW(SB),7,$0
NOP // work around bug in linker
JMP ·shlVW_g(SB)
MOVL z+0(FP), DI
MOVL x+4(FP), SI
MOVL s+8(FP), CX
MOVL n+12(FP), BP
MOVL $0, AX // c = 0
MOVL $0, BX // i = 0
JMP E8
L8: MOVL (SI)(BX*8), DX
SHLL CX, DX:AX
MOVL DX, (DI)(BX*8)
MOVL (SI)(BX*8), AX // reload (not enough regs to save original DX)
ADDL $1, BX // i++
E8: CMPL BX, BP // i < n
JL L8
MOVL $0, DX
SHLL CX, DX:AX
MOVL DX, c+16(FP)
RET
// func shrVW(z, x *Word, s Word, n int) (c Word)
// TODO(gri) implement this routine
TEXT ·shrVW(SB),7,$0
NOP // work around bug in linker
JMP ·shrVW_g(SB)
MOVL z+0(FP), DI
MOVL x+4(FP), SI
MOVL s+8(FP), CX
MOVL n+12(FP), BX // i = n
MOVL $0, AX // c = 0
JMP E9
L9: MOVL (SI)(BX*8), DX
MOVL DX, BP
SHRL CX, DX:AX
MOVL DX, (DI)(BX*8)
MOVL BP, AX
E9: SUBL $1, BX // i--
JGE L9
MOVL $0, DX
SHRL CX, DX:AX
MOVL DX, c+16(FP)
RET
// func mulAddVWW(z, x *Word, y, r Word, n int) (c Word)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment