Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
161b44c7
Commit
161b44c7
authored
Apr 30, 2010
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
big/arith: assembly routines for 386 long shifts (2nd round)
R=rsc CC=golang-dev
https://golang.org/cl/986044
parent
c66b4984
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
arith_386.s
src/pkg/big/arith_386.s
+16
-19
No files found.
src/pkg/big/arith_386.s
View file @
161b44c7
...
@@ -101,24 +101,24 @@ E4: CMPL BX, BP // i < n
...
@@ -101,24 +101,24 @@ E4: CMPL BX, BP // i < n
// func shlVW(z, x *Word, s Word, n int) (c Word)
// func shlVW(z, x *Word, s Word, n int) (c Word)
TEXT ·shlVW(SB),7,$0
TEXT ·shlVW(SB),7,$0
NOP
JMP ·shlVW_g(SB) // TODO(gri) remove once code below works
MOVL z+0(FP), DI
MOVL z+0(FP), DI
MOVL x+4(FP), SI
MOVL x+4(FP), SI
MOVL s+8(FP), CX
MOVL s+8(FP), CX
MOVL n+12(FP), BP
MOVL n+12(FP), BX
LEAL (DI)(BX*4), DI
LEAL (SI)(BX*4), SI
NEGL BX // i = -n
MOVL $0, AX // c = 0
MOVL $0, AX // c = 0
MOVL $0, BX // i = 0
JMP E8
JMP E8
L8: MOVL (SI)(BX*8), DX
L8: MOVL (SI)(BX*4), DX
MOVL DX, BP
SHLL CX, DX:AX
SHLL CX, DX:AX
MOVL DX, (DI)(BX*
8
)
MOVL DX, (DI)(BX*
4
)
MOVL
(SI)(BX*8), AX // reload (not enough regs to save original DX)
MOVL
BP, AX
ADDL $1, BX // i++
ADDL $1, BX // i++
E8: CMPL BX,
BP // i < n
E8: CMPL BX,
$0 // i < 0
JL L8
JL L8
MOVL $0, DX
MOVL $0, DX
...
@@ -129,9 +129,6 @@ E8: CMPL BX, BP // i < n
...
@@ -129,9 +129,6 @@ E8: CMPL BX, BP // i < n
// func shrVW(z, x *Word, s Word, n int) (c Word)
// func shrVW(z, x *Word, s Word, n int) (c Word)
TEXT ·shrVW(SB),7,$0
TEXT ·shrVW(SB),7,$0
NOP
JMP ·shrVW_g(SB) // TODO(gri) remove once code below works
MOVL z+0(FP), DI
MOVL z+0(FP), DI
MOVL x+4(FP), SI
MOVL x+4(FP), SI
MOVL s+8(FP), CX
MOVL s+8(FP), CX
...
@@ -139,10 +136,10 @@ TEXT ·shrVW(SB),7,$0
...
@@ -139,10 +136,10 @@ TEXT ·shrVW(SB),7,$0
MOVL $0, AX // c = 0
MOVL $0, AX // c = 0
JMP E9
JMP E9
L9: MOVL (SI)(BX*
8
), DX
L9: MOVL (SI)(BX*
4
), DX
MOVL DX, BP
MOVL DX, BP
SHRL CX, DX:AX
SHRL CX, DX:AX
MOVL DX, (DI)(BX*
8
)
MOVL DX, (DI)(BX*
4
)
MOVL BP, AX
MOVL BP, AX
E9: SUBL $1, BX // i--
E9: SUBL $1, BX // i--
...
@@ -161,9 +158,9 @@ TEXT ·mulAddVWW(SB),7,$0
...
@@ -161,9 +158,9 @@ TEXT ·mulAddVWW(SB),7,$0
MOVL y+8(FP), BP
MOVL y+8(FP), BP
MOVL r+12(FP), CX // c = r
MOVL r+12(FP), CX // c = r
MOVL n+16(FP), BX
MOVL n+16(FP), BX
LEAL
(SI)(BX*4), S
I
LEAL
(DI)(BX*4), D
I
LEAL
(DI)(BX*4), D
I
LEAL
(SI)(BX*4), S
I
NEGL BX
// i = -n
NEGL BX
// i = -n
JMP E5
JMP E5
L5: MOVL (SI)(BX*4), AX
L5: MOVL (SI)(BX*4), AX
...
@@ -187,8 +184,8 @@ TEXT ·addMulVVW(SB),7,$0
...
@@ -187,8 +184,8 @@ TEXT ·addMulVVW(SB),7,$0
MOVL x+4(FP), SI
MOVL x+4(FP), SI
MOVL y+8(FP), BP
MOVL y+8(FP), BP
MOVL n+12(FP), BX
MOVL n+12(FP), BX
LEAL
(SI)(BX*4), S
I
LEAL
(DI)(BX*4), D
I
LEAL
(DI)(BX*4), D
I
LEAL
(SI)(BX*4), S
I
NEGL BX // i = -n
NEGL BX // i = -n
MOVL $0, CX // c = 0
MOVL $0, CX // c = 0
JMP E6
JMP E6
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment