Commit aa2192f8 by Nathan Sidwell Committed by Nathan Sidwell

* gcc/config/m68k/lb1sf68.asm: Use moveq to load small constants.

From-SVN: r110440
parent ee963181
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> 2006-01-31 Richard Guenther <rguenther@suse.de>
* doc/invoke.texi (-msselibm): Document. * doc/invoke.texi (-msselibm): Document.
......
...@@ -1124,7 +1124,7 @@ Ladddf$5: ...@@ -1124,7 +1124,7 @@ Ladddf$5:
swap d0 | swap d0 |
bra Ladddf$ret bra Ladddf$ret
1: 1:
movew IMM (ADD),d5 moveq IMM (ADD),d5
bra Ld$overflow bra Ld$overflow
Lsubdf$0: Lsubdf$0:
...@@ -1296,7 +1296,7 @@ Ladddf$a: ...@@ -1296,7 +1296,7 @@ Ladddf$a:
movel a6@(8),d0 movel a6@(8),d0
movel a6@(12),d1 movel a6@(12),d1
1: 1:
movew IMM (ADD),d5 moveq IMM (ADD),d5
| Check for NaN and +/-INFINITY. | Check for NaN and +/-INFINITY.
movel d0,d7 | movel d0,d7 |
andl IMM (0x80000000),d7 | andl IMM (0x80000000),d7 |
...@@ -1352,7 +1352,7 @@ Ladddf$ret$den: ...@@ -1352,7 +1352,7 @@ Ladddf$ret$den:
bra Ladddf$ret bra Ladddf$ret
Ladddf$nf: Ladddf$nf:
movew IMM (ADD),d5 moveq IMM (ADD),d5
| This could be faster but it is not worth the effort, since it is not | This could be faster but it is not worth the effort, since it is not
| executed very often. We sacrifice speed for clarity here. | executed very often. We sacrifice speed for clarity here.
movel a6@(8),d0 | get the numbers back (remember that we movel a6@(8),d0 | get the numbers back (remember that we
...@@ -1628,7 +1628,7 @@ Lmuldf$2: | ...@@ -1628,7 +1628,7 @@ Lmuldf$2: |
| Now round, check for over- and underflow, and exit. | Now round, check for over- and underflow, and exit.
movel a0,d7 | get sign bit back into d7 movel a0,d7 | get sign bit back into d7
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
btst IMM (DBL_MANT_DIG+1-32),d0 btst IMM (DBL_MANT_DIG+1-32),d0
beq Lround$exit beq Lround$exit
...@@ -1647,18 +1647,18 @@ Lmuldf$2: | ...@@ -1647,18 +1647,18 @@ Lmuldf$2: |
bra Lround$exit bra Lround$exit
Lmuldf$inop: Lmuldf$inop:
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
bra Ld$inop bra Ld$inop
Lmuldf$b$nf: Lmuldf$b$nf:
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
movel a0,d7 | get sign bit back into d7 movel a0,d7 | get sign bit back into d7
tstl d3 | we know d2 == 0x7ff00000, so check d3 tstl d3 | we know d2 == 0x7ff00000, so check d3
bne Ld$inop | if d3 <> 0 b is NaN bne Ld$inop | if d3 <> 0 b is NaN
bra Ld$overflow | else we have overflow (since a is finite) bra Ld$overflow | else we have overflow (since a is finite)
Lmuldf$a$nf: Lmuldf$a$nf:
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
movel a0,d7 | get sign bit back into d7 movel a0,d7 | get sign bit back into d7
tstl d1 | we know d0 == 0x7ff00000, so check d1 tstl d1 | we know d0 == 0x7ff00000, so check d1
bne Ld$inop | if d1 <> 0 a is NaN bne Ld$inop | if d1 <> 0 a is NaN
...@@ -1667,7 +1667,7 @@ Lmuldf$a$nf: ...@@ -1667,7 +1667,7 @@ Lmuldf$a$nf:
| If either number is zero return zero, unless the other is +/-INFINITY or | If either number is zero return zero, unless the other is +/-INFINITY or
| NaN, in which case we return NaN. | NaN, in which case we return NaN.
Lmuldf$b$0: Lmuldf$b$0:
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
#ifndef __mcoldfire__ #ifndef __mcoldfire__
exg d2,d0 | put b (==0) into d0-d1 exg d2,d0 | put b (==0) into d0-d1
exg d3,d1 | and a (with sign bit cleared) into d2-d3 exg d3,d1 | and a (with sign bit cleared) into d2-d3
...@@ -1948,18 +1948,18 @@ Ldivdf$2: | ...@@ -1948,18 +1948,18 @@ Ldivdf$2: |
1: 1:
| Now round, check for over- and underflow, and exit. | Now round, check for over- and underflow, and exit.
movel a0,d7 | restore sign bit to d7 movel a0,d7 | restore sign bit to d7
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
bra Lround$exit bra Lround$exit
Ldivdf$inop: Ldivdf$inop:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
bra Ld$inop bra Ld$inop
Ldivdf$a$0: Ldivdf$a$0:
| If a is zero check to see whether b is zero also. In that case return | 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 | NaN; then check if b is NaN, and return NaN also in that case. Else
| return zero. | return zero.
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
bclr IMM (31),d2 | bclr IMM (31),d2 |
movel d2,d4 | movel d2,d4 |
orl d3,d4 | orl d3,d4 |
...@@ -1984,7 +1984,7 @@ Ldivdf$a$0: ...@@ -1984,7 +1984,7 @@ Ldivdf$a$0:
rts | rts |
Ldivdf$b$0: Ldivdf$b$0:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
| If we got here a is not zero. Check if a is NaN; in that case return NaN, | 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 | else return +/-INFINITY. Remember that a is in d0 with the sign bit
| cleared already. | cleared already.
...@@ -1996,14 +1996,14 @@ Ldivdf$b$0: ...@@ -1996,14 +1996,14 @@ Ldivdf$b$0:
bra Ld$div$0 | else signal DIVIDE_BY_ZERO bra Ld$div$0 | else signal DIVIDE_BY_ZERO
Ldivdf$b$nf: Ldivdf$b$nf:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
| If d2 == 0x7ff00000 we have to check d3. | If d2 == 0x7ff00000 we have to check d3.
tstl d3 | tstl d3 |
bne Ld$inop | if d3 <> 0, b is NaN bne Ld$inop | if d3 <> 0, b is NaN
bra Ld$underflow | else b is +/-INFINITY, so signal underflow bra Ld$underflow | else b is +/-INFINITY, so signal underflow
Ldivdf$a$nf: Ldivdf$a$nf:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
| If d0 == 0x7ff00000 we have to check d1. | If d0 == 0x7ff00000 we have to check d1.
tstl d1 | tstl d1 |
bne Ld$inop | if d1 <> 0, a is NaN bne Ld$inop | if d1 <> 0, a is NaN
...@@ -2185,7 +2185,7 @@ SYM (__negdf2): ...@@ -2185,7 +2185,7 @@ SYM (__negdf2):
link a6,IMM (-24) link a6,IMM (-24)
moveml d2-d7,sp@ moveml d2-d7,sp@
#endif #endif
movew IMM (NEGATE),d5 moveq IMM (NEGATE),d5
movel a6@(8),d0 | get number to negate in d0-d1 movel a6@(8),d0 | get number to negate in d0-d1
movel a6@(12),d1 | movel a6@(12),d1 |
bchg IMM (31),d0 | negate bchg IMM (31),d0 | negate
...@@ -2233,7 +2233,7 @@ SYM (__cmpdf2_internal): ...@@ -2233,7 +2233,7 @@ SYM (__cmpdf2_internal):
link a6,IMM (-24) link a6,IMM (-24)
moveml d2-d7,sp@ moveml d2-d7,sp@
#endif #endif
movew IMM (COMPARE),d5 moveq IMM (COMPARE),d5
movel a6@(8),d0 | get first operand movel a6@(8),d0 | get first operand
movel a6@(12),d1 | movel a6@(12),d1 |
movel a6@(16),d2 | get second operand movel a6@(16),d2 | get second operand
...@@ -2344,7 +2344,7 @@ Lcmpdf$b$nf: ...@@ -2344,7 +2344,7 @@ Lcmpdf$b$nf:
Lcmpd$inop: Lcmpd$inop:
movl a6@(24),d0 movl a6@(24),d0
movew IMM (INEXACT_RESULT+INVALID_OPERATION),d7 moveq IMM (INEXACT_RESULT+INVALID_OPERATION),d7
moveq IMM (DOUBLE_FLOAT),d6 moveq IMM (DOUBLE_FLOAT),d6
PICJUMP $_exception_handler PICJUMP $_exception_handler
...@@ -2517,7 +2517,7 @@ ROUND_TO_MINUS = 3 | round result towards minus infinity ...@@ -2517,7 +2517,7 @@ ROUND_TO_MINUS = 3 | round result towards minus infinity
Lf$den: Lf$den:
| Return and signal a denormalized number | Return and signal a denormalized number
orl d7,d0 orl d7,d0
movew IMM (INEXACT_RESULT+UNDERFLOW),d7 moveq IMM (INEXACT_RESULT+UNDERFLOW),d7
moveq IMM (SINGLE_FLOAT),d6 moveq IMM (SINGLE_FLOAT),d6
PICJUMP $_exception_handler PICJUMP $_exception_handler
...@@ -2526,21 +2526,21 @@ Lf$overflow: ...@@ -2526,21 +2526,21 @@ Lf$overflow:
| Return a properly signed INFINITY and set the exception flags | Return a properly signed INFINITY and set the exception flags
movel IMM (INFINITY),d0 movel IMM (INFINITY),d0
orl d7,d0 orl d7,d0
movew IMM (INEXACT_RESULT+OVERFLOW),d7 moveq IMM (INEXACT_RESULT+OVERFLOW),d7
moveq IMM (SINGLE_FLOAT),d6 moveq IMM (SINGLE_FLOAT),d6
PICJUMP $_exception_handler PICJUMP $_exception_handler
Lf$underflow: Lf$underflow:
| Return 0 and set the exception flags | Return 0 and set the exception flags
movel IMM (0),d0 moveq IMM (0),d0
movew IMM (INEXACT_RESULT+UNDERFLOW),d7 moveq IMM (INEXACT_RESULT+UNDERFLOW),d7
moveq IMM (SINGLE_FLOAT),d6 moveq IMM (SINGLE_FLOAT),d6
PICJUMP $_exception_handler PICJUMP $_exception_handler
Lf$inop: Lf$inop:
| Return a quiet NaN and set the exception flags | Return a quiet NaN and set the exception flags
movel IMM (QUIET_NaN),d0 movel IMM (QUIET_NaN),d0
movew IMM (INEXACT_RESULT+INVALID_OPERATION),d7 moveq IMM (INEXACT_RESULT+INVALID_OPERATION),d7
moveq IMM (SINGLE_FLOAT),d6 moveq IMM (SINGLE_FLOAT),d6
PICJUMP $_exception_handler PICJUMP $_exception_handler
...@@ -2548,7 +2548,7 @@ Lf$div$0: ...@@ -2548,7 +2548,7 @@ Lf$div$0:
| Return a properly signed INFINITY and set the exception flags | Return a properly signed INFINITY and set the exception flags
movel IMM (INFINITY),d0 movel IMM (INFINITY),d0
orl d7,d0 orl d7,d0
movew IMM (INEXACT_RESULT+DIVIDE_BY_ZERO),d7 moveq IMM (INEXACT_RESULT+DIVIDE_BY_ZERO),d7
moveq IMM (SINGLE_FLOAT),d6 moveq IMM (SINGLE_FLOAT),d6
PICJUMP $_exception_handler PICJUMP $_exception_handler
...@@ -2862,7 +2862,7 @@ Laddsf$4: ...@@ -2862,7 +2862,7 @@ Laddsf$4:
orl d2,d0 orl d2,d0
bra Laddsf$ret bra Laddsf$ret
1: 1:
movew IMM (ADD),d5 moveq IMM (ADD),d5
bra Lf$overflow bra Lf$overflow
Lsubsf$0: Lsubsf$0:
...@@ -2982,7 +2982,7 @@ Laddsf$a: ...@@ -2982,7 +2982,7 @@ Laddsf$a:
| Return a (if b is zero). | Return a (if b is zero).
movel a6@(8),d0 movel a6@(8),d0
1: 1:
movew IMM (ADD),d5 moveq IMM (ADD),d5
| We have to check for NaN and +/-infty. | We have to check for NaN and +/-infty.
movel d0,d7 movel d0,d7
andl IMM (0x80000000),d7 | put sign in d7 andl IMM (0x80000000),d7 | put sign in d7
...@@ -3028,7 +3028,7 @@ Laddsf$ret$den: ...@@ -3028,7 +3028,7 @@ Laddsf$ret$den:
| NaN, but if it is finite we return INFINITY with the corresponding sign. | NaN, but if it is finite we return INFINITY with the corresponding sign.
Laddsf$nf: Laddsf$nf:
movew IMM (ADD),d5 moveq IMM (ADD),d5
| This could be faster but it is not worth the effort, since it is not | This could be faster but it is not worth the effort, since it is not
| executed very often. We sacrifice speed for clarity here. | executed very often. We sacrifice speed for clarity here.
movel a6@(8),d0 | get the numbers back (remember that we movel a6@(8),d0 | get the numbers back (remember that we
...@@ -3149,7 +3149,7 @@ Lmulsf$2: | ...@@ -3149,7 +3149,7 @@ Lmulsf$2: |
lsll IMM (31-FLT_MANT_DIG+1),d6 lsll IMM (31-FLT_MANT_DIG+1),d6
| Start the loop (we loop #FLT_MANT_DIG times): | Start the loop (we loop #FLT_MANT_DIG times):
movew IMM (FLT_MANT_DIG-1),d3 moveq IMM (FLT_MANT_DIG-1),d3
1: addl d1,d1 | shift sum 1: addl d1,d1 | shift sum
addxl d0,d0 addxl d0,d0
lsll IMM (1),d6 | get bit bn lsll IMM (1),d6 | get bit bn
...@@ -3192,7 +3192,7 @@ Lmulsf$2: | ...@@ -3192,7 +3192,7 @@ Lmulsf$2: |
orl d3,d0 orl d3,d0
#endif #endif
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
btst IMM (FLT_MANT_DIG+1),d0 btst IMM (FLT_MANT_DIG+1),d0
beq Lround$exit beq Lround$exit
...@@ -3211,15 +3211,15 @@ Lmulsf$2: | ...@@ -3211,15 +3211,15 @@ Lmulsf$2: |
bra Lround$exit bra Lround$exit
Lmulsf$inop: Lmulsf$inop:
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
bra Lf$inop bra Lf$inop
Lmulsf$overflow: Lmulsf$overflow:
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
bra Lf$overflow bra Lf$overflow
Lmulsf$inf: Lmulsf$inf:
movew IMM (MULTIPLY),d5 moveq IMM (MULTIPLY),d5
| If either is NaN return NaN; else both are (maybe infinite) numbers, so | If either is NaN return NaN; else both are (maybe infinite) numbers, so
| return INFINITY with the correct sign (which is in d7). | return INFINITY with the correct sign (which is in d7).
cmpl d6,d1 | is b NaN? cmpl d6,d1 | is b NaN?
...@@ -3274,7 +3274,7 @@ Lmulsf$b$den: ...@@ -3274,7 +3274,7 @@ Lmulsf$b$den:
#ifndef __mcoldfire__ #ifndef __mcoldfire__
subw IMM (1),d3 | and adjust exponent subw IMM (1),d3 | and adjust exponent
#else #else
subl IMM (1),d3 | and adjust exponent subql IMM (1),d3 | and adjust exponent
#endif #endif
btst IMM (FLT_MANT_DIG-1),d1 btst IMM (FLT_MANT_DIG-1),d1
bne Lmulsf$2 | bne Lmulsf$2 |
...@@ -3360,7 +3360,7 @@ Ldivsf$2: | ...@@ -3360,7 +3360,7 @@ Ldivsf$2: |
movel IMM (0),d6 | movel IMM (0),d6 |
movel d6,d7 movel d6,d7
movew IMM (FLT_MANT_DIG+1),d3 moveq IMM (FLT_MANT_DIG+1),d3
1: cmpl d0,d1 | is a < b? 1: cmpl d0,d1 | is a < b?
bhi 2f | bhi 2f |
bset d3,d6 | set a bit in d6 bset d3,d6 | set a bit in d6
...@@ -3375,7 +3375,7 @@ Ldivsf$2: | ...@@ -3375,7 +3375,7 @@ Ldivsf$2: |
#endif #endif
| Now we keep going to set the sticky bit ... | Now we keep going to set the sticky bit ...
movew IMM (FLT_MANT_DIG),d3 moveq IMM (FLT_MANT_DIG),d3
1: cmpl d0,d1 1: cmpl d0,d1
ble 2f ble 2f
addl d0,d0 addl d0,d0
...@@ -3413,23 +3413,23 @@ Ldivsf$2: | ...@@ -3413,23 +3413,23 @@ Ldivsf$2: |
#endif #endif
1: 1:
| Now round, check for over- and underflow, and exit. | Now round, check for over- and underflow, and exit.
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
bra Lround$exit bra Lround$exit
Ldivsf$inop: Ldivsf$inop:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
bra Lf$inop bra Lf$inop
Ldivsf$overflow: Ldivsf$overflow:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
bra Lf$overflow bra Lf$overflow
Ldivsf$underflow: Ldivsf$underflow:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
bra Lf$underflow bra Lf$underflow
Ldivsf$a$0: Ldivsf$a$0:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
| If a is zero check to see whether b is zero also. In that case return | 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 | NaN; then check if b is NaN, and return NaN also in that case. Else
| return zero. | return zero.
...@@ -3451,7 +3451,7 @@ Ldivsf$a$0: ...@@ -3451,7 +3451,7 @@ Ldivsf$a$0:
rts | rts |
Ldivsf$b$0: Ldivsf$b$0:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
| If we got here a is not zero. Check if a is NaN; in that case return NaN, | 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 | else return +/-INFINITY. Remember that a is in d0 with the sign bit
| cleared already. | cleared already.
...@@ -3460,7 +3460,7 @@ Ldivsf$b$0: ...@@ -3460,7 +3460,7 @@ Ldivsf$b$0:
bra Lf$div$0 | else signal DIVIDE_BY_ZERO bra Lf$div$0 | else signal DIVIDE_BY_ZERO
Ldivsf$inf: Ldivsf$inf:
movew IMM (DIVIDE),d5 moveq IMM (DIVIDE),d5
| If a is INFINITY we have to check b | If a is INFINITY we have to check b
cmpl IMM (INFINITY),d1 | compare b with INFINITY cmpl IMM (INFINITY),d1 | compare b with INFINITY
bge Lf$inop | if b is NaN or INFINITY return NaN bge Lf$inop | if b is NaN or INFINITY return NaN
...@@ -3618,7 +3618,7 @@ SYM (__negsf2): ...@@ -3618,7 +3618,7 @@ SYM (__negsf2):
link a6,IMM (-24) link a6,IMM (-24)
moveml d2-d7,sp@ moveml d2-d7,sp@
#endif #endif
movew IMM (NEGATE),d5 moveq IMM (NEGATE),d5
movel a6@(8),d0 | get number to negate in d0 movel a6@(8),d0 | get number to negate in d0
bchg IMM (31),d0 | negate bchg IMM (31),d0 | negate
movel d0,d1 | make a positive copy movel d0,d1 | make a positive copy
...@@ -3662,7 +3662,7 @@ SYM (__cmpsf2_internal): ...@@ -3662,7 +3662,7 @@ SYM (__cmpsf2_internal):
link a6,IMM (-24) link a6,IMM (-24)
moveml d2-d7,sp@ moveml d2-d7,sp@
#endif #endif
movew IMM (COMPARE),d5 moveq IMM (COMPARE),d5
movel a6@(8),d0 | get first operand movel a6@(8),d0 | get first operand
movel a6@(12),d1 | get second operand movel a6@(12),d1 | get second operand
| Check if either is NaN, and in that case return garbage and signal | Check if either is NaN, and in that case return garbage and signal
...@@ -3746,7 +3746,7 @@ Lcmpsf$b$0: ...@@ -3746,7 +3746,7 @@ Lcmpsf$b$0:
Lcmpf$inop: Lcmpf$inop:
movl a6@(16),d0 movl a6@(16),d0
movew IMM (INEXACT_RESULT+INVALID_OPERATION),d7 moveq IMM (INEXACT_RESULT+INVALID_OPERATION),d7
moveq IMM (SINGLE_FLOAT),d6 moveq IMM (SINGLE_FLOAT),d6
PICJUMP $_exception_handler PICJUMP $_exception_handler
......
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