Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
aa2192f8
Commit
aa2192f8
authored
Jan 31, 2006
by
Nathan Sidwell
Committed by
Nathan Sidwell
Jan 31, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc/config/m68k/lb1sf68.asm: Use moveq to load small constants.
From-SVN: r110440
parent
ee963181
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
44 deletions
+48
-44
gcc/ChangeLog
+4
-0
gcc/config/m68k/lb1sf68.asm
+44
-44
No files found.
gcc/ChangeLog
View file @
aa2192f8
2006-01-31 Nathan Sidwell <nathan@codesourcery.com>
* gcc/config/m68k/lb1sf68.asm: Use moveq to load small constants.
2006-01-31 Richard Guenther <rguenther@suse.de>
* doc/invoke.texi (-msselibm): Document.
...
...
gcc/config/m68k/lb1sf68.asm
View file @
aa2192f8
...
...
@@ -1124,7 +1124,7 @@ Ladddf$5:
swap
d0
|
bra
Ladddf
$
ret
1
:
move
w
IMM
(
ADD
),
d5
move
q
IMM
(
ADD
),
d5
bra
Ld
$
overflow
Lsubdf
$
0
:
...
...
@@ -1296,7 +1296,7 @@ Ladddf$a:
movel
a6
@
(
8
),
d0
movel
a6
@
(
12
),
d1
1
:
move
w
IMM
(
ADD
),
d5
move
q
IMM
(
ADD
),
d5
|
Check
for
NaN
and
+/-
INFINITY
.
movel
d0
,
d7
|
andl
IMM
(
0x80000000
),
d7
|
...
...
@@ -1352,7 +1352,7 @@ Ladddf$ret$den:
bra
Ladddf
$
ret
Ladddf
$
nf
:
move
w
IMM
(
ADD
),
d5
move
q
IMM
(
ADD
),
d5
|
This
could
be
faster
but
it
is
not
worth
the
effort
,
since
it
is
not
|
executed
very
often
.
We
sacrifice
speed
for
clarity
here
.
movel
a6
@
(
8
),
d0
|
get
the
numbers
back
(
remember
that
we
...
...
@@ -1628,7 +1628,7 @@ Lmuldf$2: |
|
Now
round
,
check
for
over
-
and
underflow
,
and
exit
.
movel
a0
,
d7
|
get
sign
bit
back
into
d7
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
btst
IMM
(
DBL_MANT_DIG
+
1
-
32
),
d0
beq
Lround
$
exit
...
...
@@ -1647,18 +1647,18 @@ Lmuldf$2: |
bra
Lround
$
exit
Lmuldf
$
inop
:
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
bra
Ld
$
inop
Lmuldf
$
b
$
nf
:
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
movel
a0
,
d7
|
get
sign
bit
back
into
d7
tstl
d3
|
we
know
d2
==
0x7ff00000
,
so
check
d3
bne
Ld
$
inop
|
if
d3
<>
0
b
is
NaN
bra
Ld
$
overflow
|
else
we
have
overflow
(
since
a
is
finite
)
Lmuldf
$
a
$
nf
:
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
movel
a0
,
d7
|
get
sign
bit
back
into
d7
tstl
d1
|
we
know
d0
==
0x7ff00000
,
so
check
d1
bne
Ld
$
inop
|
if
d1
<>
0
a
is
NaN
...
...
@@ -1667,7 +1667,7 @@ Lmuldf$a$nf:
|
If
either
number
is
zero
return
zero
,
unless
the
other
is
+/-
INFINITY
or
|
NaN
,
in
which
case
we
return
NaN
.
Lmuldf
$
b
$
0
:
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
#
ifndef
__mcoldfire__
exg
d2
,
d0
|
put
b
(
==
0
)
into
d0
-
d1
exg
d3
,
d1
|
and
a
(
with
sign
bit
cleared
)
into
d2
-
d3
...
...
@@ -1948,18 +1948,18 @@ Ldivdf$2: |
1
:
|
Now
round
,
check
for
over
-
and
underflow
,
and
exit
.
movel
a0
,
d7
|
restore
sign
bit
to
d7
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
bra
Lround
$
exit
Ldivdf
$
inop
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
bra
Ld
$
inop
Ldivdf
$
a
$
0
:
|
If
a
is
zero
check
to
see
whether
b
is
zero
also
.
In
that
case
return
|
NaN
; then check if b is NaN, and return NaN also in that case. Else
|
return
zero
.
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
bclr
IMM
(
31
),
d2
|
movel
d2
,
d4
|
orl
d3
,
d4
|
...
...
@@ -1984,7 +1984,7 @@ Ldivdf$a$0:
rts
|
Ldivdf
$
b
$
0
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
|
If
we
got
here
a
is
not
zero
.
Check
if
a
is
NaN
; in that case return NaN,
|
else
return
+/-
INFINITY
.
Remember
that
a
is
in
d0
with
the
sign
bit
|
cleared
already
.
...
...
@@ -1996,14 +1996,14 @@ Ldivdf$b$0:
bra
Ld
$
div
$
0
|
else
signal
DIVIDE_BY_ZERO
Ldivdf
$
b
$
nf
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
|
If
d2
==
0x7ff00000
we
have
to
check
d3
.
tstl
d3
|
bne
Ld
$
inop
|
if
d3
<>
0
,
b
is
NaN
bra
Ld
$
underflow
|
else
b
is
+/-
INFINITY
,
so
signal
underflow
Ldivdf
$
a
$
nf
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
|
If
d0
==
0x7ff00000
we
have
to
check
d1
.
tstl
d1
|
bne
Ld
$
inop
|
if
d1
<>
0
,
a
is
NaN
...
...
@@ -2185,7 +2185,7 @@ SYM (__negdf2):
link
a6
,
IMM
(
-
24
)
moveml
d2
-
d7
,
sp
@
#
endif
move
w
IMM
(
NEGATE
),
d5
move
q
IMM
(
NEGATE
),
d5
movel
a6
@
(
8
),
d0
|
get
number
to
negate
in
d0
-
d1
movel
a6
@
(
12
),
d1
|
bchg
IMM
(
31
),
d0
|
negate
...
...
@@ -2233,7 +2233,7 @@ SYM (__cmpdf2_internal):
link
a6
,
IMM
(
-
24
)
moveml
d2
-
d7
,
sp
@
#
endif
move
w
IMM
(
COMPARE
),
d5
move
q
IMM
(
COMPARE
),
d5
movel
a6
@
(
8
),
d0
|
get
first
operand
movel
a6
@
(
12
),
d1
|
movel
a6
@
(
16
),
d2
|
get
second
operand
...
...
@@ -2344,7 +2344,7 @@ Lcmpdf$b$nf:
Lcmpd
$
inop
:
movl
a6
@
(
24
),
d0
move
w
IMM
(
INEXACT_RESULT
+
INVALID_OPERATION
),
d7
move
q
IMM
(
INEXACT_RESULT
+
INVALID_OPERATION
),
d7
moveq
IMM
(
DOUBLE_FLOAT
),
d6
PICJUMP
$
_exception_handler
...
...
@@ -2517,7 +2517,7 @@ ROUND_TO_MINUS = 3 | round result towards minus infinity
Lf
$
den
:
|
Return
and
signal
a
denormalized
number
orl
d7
,
d0
move
w
IMM
(
INEXACT_RESULT
+
UNDERFLOW
),
d7
move
q
IMM
(
INEXACT_RESULT
+
UNDERFLOW
),
d7
moveq
IMM
(
SINGLE_FLOAT
),
d6
PICJUMP
$
_exception_handler
...
...
@@ -2526,21 +2526,21 @@ Lf$overflow:
|
Return
a
properly
signed
INFINITY
and
set
the
exception
flags
movel
IMM
(
INFINITY
),
d0
orl
d7
,
d0
move
w
IMM
(
INEXACT_RESULT
+
OVERFLOW
),
d7
move
q
IMM
(
INEXACT_RESULT
+
OVERFLOW
),
d7
moveq
IMM
(
SINGLE_FLOAT
),
d6
PICJUMP
$
_exception_handler
Lf
$
underflow
:
|
Return
0
and
set
the
exception
flags
move
l
IMM
(
0
),
d0
move
w
IMM
(
INEXACT_RESULT
+
UNDERFLOW
),
d7
move
q
IMM
(
0
),
d0
move
q
IMM
(
INEXACT_RESULT
+
UNDERFLOW
),
d7
moveq
IMM
(
SINGLE_FLOAT
),
d6
PICJUMP
$
_exception_handler
Lf
$
inop
:
|
Return
a
quiet
NaN
and
set
the
exception
flags
movel
IMM
(
QUIET_NaN
),
d0
move
w
IMM
(
INEXACT_RESULT
+
INVALID_OPERATION
),
d7
move
q
IMM
(
INEXACT_RESULT
+
INVALID_OPERATION
),
d7
moveq
IMM
(
SINGLE_FLOAT
),
d6
PICJUMP
$
_exception_handler
...
...
@@ -2548,7 +2548,7 @@ Lf$div$0:
|
Return
a
properly
signed
INFINITY
and
set
the
exception
flags
movel
IMM
(
INFINITY
),
d0
orl
d7
,
d0
move
w
IMM
(
INEXACT_RESULT
+
DIVIDE_BY_ZERO
),
d7
move
q
IMM
(
INEXACT_RESULT
+
DIVIDE_BY_ZERO
),
d7
moveq
IMM
(
SINGLE_FLOAT
),
d6
PICJUMP
$
_exception_handler
...
...
@@ -2862,7 +2862,7 @@ Laddsf$4:
orl
d2
,
d0
bra
Laddsf
$
ret
1
:
move
w
IMM
(
ADD
),
d5
move
q
IMM
(
ADD
),
d5
bra
Lf
$
overflow
Lsubsf
$
0
:
...
...
@@ -2982,7 +2982,7 @@ Laddsf$a:
|
Return
a
(
if
b
is
zero
).
movel
a6
@
(
8
),
d0
1
:
move
w
IMM
(
ADD
),
d5
move
q
IMM
(
ADD
),
d5
|
We
have
to
check
for
NaN
and
+/-
infty
.
movel
d0
,
d7
andl
IMM
(
0x80000000
),
d7
|
put
sign
in
d7
...
...
@@ -3028,7 +3028,7 @@ Laddsf$ret$den:
|
NaN
,
but
if
it
is
finite
we
return
INFINITY
with
the
corresponding
sign
.
Laddsf
$
nf
:
move
w
IMM
(
ADD
),
d5
move
q
IMM
(
ADD
),
d5
|
This
could
be
faster
but
it
is
not
worth
the
effort
,
since
it
is
not
|
executed
very
often
.
We
sacrifice
speed
for
clarity
here
.
movel
a6
@
(
8
),
d0
|
get
the
numbers
back
(
remember
that
we
...
...
@@ -3149,7 +3149,7 @@ Lmulsf$2: |
lsll
IMM
(
31
-
FLT_MANT_DIG
+
1
),
d6
|
Start
the
loop
(
we
loop
#
FLT_MANT_DIG
times
)
:
move
w
IMM
(
FLT_MANT_DIG
-
1
),
d3
move
q
IMM
(
FLT_MANT_DIG
-
1
),
d3
1
:
addl
d1
,
d1
|
shift
sum
addxl
d0
,
d0
lsll
IMM
(
1
),
d6
|
get
bit
bn
...
...
@@ -3192,7 +3192,7 @@ Lmulsf$2: |
orl
d3
,
d0
#
endif
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
btst
IMM
(
FLT_MANT_DIG
+
1
),
d0
beq
Lround
$
exit
...
...
@@ -3211,15 +3211,15 @@ Lmulsf$2: |
bra
Lround
$
exit
Lmulsf
$
inop
:
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
bra
Lf
$
inop
Lmulsf
$
overflow
:
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
bra
Lf
$
overflow
Lmulsf
$
inf
:
move
w
IMM
(
MULTIPLY
),
d5
move
q
IMM
(
MULTIPLY
),
d5
|
If
either
is
NaN
return
NaN
; else both are (maybe infinite) numbers, so
|
return
INFINITY
with
the
correct
sign
(
which
is
in
d7
).
cmpl
d6
,
d1
|
is
b
NaN
?
...
...
@@ -3274,7 +3274,7 @@ Lmulsf$b$den:
#
ifndef
__mcoldfire__
subw
IMM
(
1
),
d3
|
and
adjust
exponent
#
else
subl
IMM
(
1
),
d3
|
and
adjust
exponent
sub
q
l
IMM
(
1
),
d3
|
and
adjust
exponent
#
endif
btst
IMM
(
FLT_MANT_DIG
-
1
),
d1
bne
Lmulsf
$
2
|
...
...
@@ -3360,7 +3360,7 @@ Ldivsf$2: |
movel
IMM
(
0
),
d6
|
movel
d6
,
d7
move
w
IMM
(
FLT_MANT_DIG
+
1
),
d3
move
q
IMM
(
FLT_MANT_DIG
+
1
),
d3
1
:
cmpl
d0
,
d1
|
is
a
<
b
?
bhi
2
f
|
bset
d3
,
d6
|
set
a
bit
in
d6
...
...
@@ -3375,7 +3375,7 @@ Ldivsf$2: |
#
endif
|
Now
we
keep
going
to
set
the
sticky
bit
...
move
w
IMM
(
FLT_MANT_DIG
),
d3
move
q
IMM
(
FLT_MANT_DIG
),
d3
1
:
cmpl
d0
,
d1
ble
2
f
addl
d0
,
d0
...
...
@@ -3413,23 +3413,23 @@ Ldivsf$2: |
#
endif
1
:
|
Now
round
,
check
for
over
-
and
underflow
,
and
exit
.
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
bra
Lround
$
exit
Ldivsf
$
inop
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
bra
Lf
$
inop
Ldivsf
$
overflow
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
bra
Lf
$
overflow
Ldivsf
$
underflow
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
bra
Lf
$
underflow
Ldivsf
$
a
$
0
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
|
If
a
is
zero
check
to
see
whether
b
is
zero
also
.
In
that
case
return
|
NaN
; then check if b is NaN, and return NaN also in that case. Else
|
return
zero
.
...
...
@@ -3451,7 +3451,7 @@ Ldivsf$a$0:
rts
|
Ldivsf
$
b
$
0
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
|
If
we
got
here
a
is
not
zero
.
Check
if
a
is
NaN
; in that case return NaN,
|
else
return
+/-
INFINITY
.
Remember
that
a
is
in
d0
with
the
sign
bit
|
cleared
already
.
...
...
@@ -3460,7 +3460,7 @@ Ldivsf$b$0:
bra
Lf
$
div
$
0
|
else
signal
DIVIDE_BY_ZERO
Ldivsf
$
inf
:
move
w
IMM
(
DIVIDE
),
d5
move
q
IMM
(
DIVIDE
),
d5
|
If
a
is
INFINITY
we
have
to
check
b
cmpl
IMM
(
INFINITY
),
d1
|
compare
b
with
INFINITY
bge
Lf
$
inop
|
if
b
is
NaN
or
INFINITY
return
NaN
...
...
@@ -3618,7 +3618,7 @@ SYM (__negsf2):
link
a6
,
IMM
(
-
24
)
moveml
d2
-
d7
,
sp
@
#
endif
move
w
IMM
(
NEGATE
),
d5
move
q
IMM
(
NEGATE
),
d5
movel
a6
@
(
8
),
d0
|
get
number
to
negate
in
d0
bchg
IMM
(
31
),
d0
|
negate
movel
d0
,
d1
|
make
a
positive
copy
...
...
@@ -3662,7 +3662,7 @@ SYM (__cmpsf2_internal):
link
a6
,
IMM
(
-
24
)
moveml
d2
-
d7
,
sp
@
#
endif
move
w
IMM
(
COMPARE
),
d5
move
q
IMM
(
COMPARE
),
d5
movel
a6
@
(
8
),
d0
|
get
first
operand
movel
a6
@
(
12
),
d1
|
get
second
operand
|
Check
if
either
is
NaN
,
and
in
that
case
return
garbage
and
signal
...
...
@@ -3746,7 +3746,7 @@ Lcmpsf$b$0:
Lcmpf
$
inop
:
movl
a6
@
(
16
),
d0
move
w
IMM
(
INEXACT_RESULT
+
INVALID_OPERATION
),
d7
move
q
IMM
(
INEXACT_RESULT
+
INVALID_OPERATION
),
d7
moveq
IMM
(
SINGLE_FLOAT
),
d6
PICJUMP
$
_exception_handler
...
...
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