Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f013ad57
Commit
f013ad57
authored
Oct 31, 2002
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
30 % faster longlong10_to_str function
parent
ba5feac4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
6 deletions
+89
-6
strings/longlong2str-x86.s
strings/longlong2str-x86.s
+89
-6
No files found.
strings/longlong2str-x86.s
View file @
f013ad57
...
@@ -64,7 +64,7 @@ longlong2str:
...
@@ -64,7 +64,7 @@ longlong2str:
jne
.
L150
jne
.
L150
movb
$
48
,(%
edi
)
movb
$
48
,(%
edi
)
incl
%
edi
incl
%
edi
jmp
.
L1
64
jmp
.
L1
0_end
.
align
4
.
align
4
.
L150
:
.
L150
:
...
@@ -81,9 +81,9 @@ longlong2str:
...
@@ -81,9 +81,9 @@ longlong2str:
movl
%
eax
,%
ebp
movl
%
eax
,%
ebp
movl
%
esi
,%
eax
movl
%
esi
,%
eax
divl
%
ebx
divl
%
ebx
decl
%
ecx
movl
%
eax
,%
esi
#
quotent
in
ebp
:
esi
movl
%
eax
,%
esi
#
quotent
in
ebp
:
esi
movb
_dig_vec
(%
edx
),%
al
#
al
is
faster
than
dl
movb
_dig_vec
(%
edx
),%
al
#
al
is
faster
than
dl
decl
%
ecx
movb
%
al
,(%
ecx
)
#
store
value
in
buff
movb
%
al
,(%
ecx
)
#
store
value
in
buff
.
align
4
.
align
4
.
L155
:
.
L155
:
...
@@ -91,7 +91,7 @@ longlong2str:
...
@@ -91,7 +91,7 @@ longlong2str:
ja
.
L153
ja
.
L153
testl
%
esi
,%
esi
#
rest
value
testl
%
esi
,%
esi
#
rest
value
jl
.
L153
jl
.
L153
je
.
L1
60
#
Ready
je
.
L1
0_mov
#
Ready
movl
%
esi
,%
eax
movl
%
esi
,%
eax
movl
$
_dig_vec
,%
ebp
movl
$
_dig_vec
,%
ebp
.
align
4
.
align
4
...
@@ -105,14 +105,14 @@ longlong2str:
...
@@ -105,14 +105,14 @@ longlong2str:
movb
%
dl
,(%
ecx
)
movb
%
dl
,(%
ecx
)
jne
.
L154
jne
.
L154
.
L1
60
:
.
L1
0_mov
:
movl
%
ecx
,%
esi
movl
%
ecx
,%
esi
leal
92
(%
esp
),%
ecx
#
End
of
buffer
leal
92
(%
esp
),%
ecx
#
End
of
buffer
subl
%
esi
,%
ecx
subl
%
esi
,%
ecx
rep
rep
movsb
movsb
.
L1
64
:
.
L1
0_end
:
movl
%
edi
,%
eax
#
Pointer
to
end
null
movl
%
edi
,%
eax
#
Pointer
to
end
null
movb
$
0
,(%
edi
)
#
Store
the
end
null
movb
$
0
,(%
edi
)
#
Store
the
end
null
...
@@ -131,10 +131,93 @@ longlong2str:
...
@@ -131,10 +131,93 @@ longlong2str:
.
Lfe3
:
.
Lfe3
:
.
size
longlong2str
,
.
Lfe3
-
longlong2str
.
size
longlong2str
,
.
Lfe3
-
longlong2str
#
#
This
is
almost
equal
to
the
above
,
except
that
we
can
do
the
final
#
loop
much
more
efficient
#
.
align
4
.
Ltmp
:
.
long
0xcccccccd
.
align
4
.
globl
longlong10_to_str
.
globl
longlong10_to_str
.
type
longlong10_str
,
@
function
.
type
longlong10_str
,
@
function
longlong10_to_str
:
longlong10_to_str
:
jmp
longlong2str
subl
$
80
,%
esp
pushl
%
ebp
pushl
%
esi
pushl
%
edi
pushl
%
ebx
movl
100
(%
esp
),%
esi
#
Lower
part
of
val
movl
104
(%
esp
),%
ebp
#
Higher
part
of
val
movl
108
(%
esp
),%
edi
#
get
dst
movl
112
(%
esp
),%
ebx
#
Radix
(
10
or
-
10
)
testl
%
ebx
,%
ebx
jge
.
L10_10
#
Positive
radix
negl
%
ebx
#
Change
radix
to
positive
(=
10
)
testl
%
ebp
,%
ebp
#
Test
if
negative
value
jge
.
L10_10
movb
$
45
,(%
edi
)
#
Add
sign
incl
%
edi
negl
%
esi
#
Change
sign
of
val
(
ebp
:
esi
)
adcl
$
0
,%
ebp
negl
%
ebp
.
align
4
.
L10_10
:
leal
92
(%
esp
),%
ecx
#
End
of
buffer
movl
%
esi
,%
eax
#
Test
if
zero
(
for
easy
loop
)
orl
%
ebp
,%
eax
jne
.
L10_30
#
Not
zero
#
Here
when
value
is
zero
movb
$
48
,(%
edi
)
incl
%
edi
jmp
.
L10_end
.
align
4
.
L10_20
:
#
val
is
stored
in
in
ebp
:
esi
movl
%
ebp
,%
eax
#
High
part
of
value
xorl
%
edx
,%
edx
divl
%
ebx
#
Divide
by
10
movl
%
eax
,%
ebp
movl
%
esi
,%
eax
divl
%
ebx
#
Divide
by
10
decl
%
ecx
movl
%
eax
,%
esi
#
quotent
in
ebp
:
esi
addl
$
48
,%
edx
#
Convert
to
ascii
movb
%
dl
,(%
ecx
)
#
store
value
in
buff
.
L10_30
:
testl
%
ebp
,%
ebp
ja
.
L10_20
testl
%
esi
,%
esi
#
rest
value
jl
.
L10_20
#
Unsigned
,
do
ulonglong
div
once
more
je
.
L10_mov
#
Ready
movl
%
esi
,%
ebx
#
Move
val
to
%
ebx
#
The
following
code
uses
some
tricks
to
change
division
by
10
to
#
multiplication
and
shifts
movl
.
Ltmp
,%
esi
#
set
%
esi
to
0xcccccccd
.
L10_40
:
movl
%
ebx
,%
eax
mull
%
esi
decl
%
ecx
shrl
$
3
,%
edx
leal
(%
edx
,%
edx
,
4
),%
eax
addl
%
eax
,%
eax
subb
%
al
,%
bl
#
%
bl
now
contains
val
%
10
addb
$
48
,%
bl
movb
%
bl
,(%
ecx
)
movl
%
edx
,%
ebx
testl
%
ebx
,%
ebx
jne
.
L10_40
jmp
.
L10_mov
#
Shared
end
with
longlong10_to_str
.
L10end
:
.
L10end
:
.
size
longlong10_to_str
,
.
L10end
-
longlong10_to_str
.
size
longlong10_to_str
,
.
L10end
-
longlong10_to_str
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