aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-02-04 16:39:16 +0000
committerNick Clifton <nickc@gcc.gnu.org>2015-02-04 16:39:16 +0000
commit771bef141f7b3233843415e91b58909c161c7f11 (patch)
treef38afb1a2745b90f21c2060a666dd6bc4ce1c643 /libgcc
parentf435bff380b38ad9ecd5b67a54de88c1ee5b1d22 (diff)
downloadgcc-771bef141f7b3233843415e91b58909c161c7f11.zip
gcc-771bef141f7b3233843415e91b58909c161c7f11.tar.gz
gcc-771bef141f7b3233843415e91b58909c161c7f11.tar.bz2
fpmath-sf.S (__rl78_int_pack_a_r8): Fix edge case rounding up the fraction.
* config/rl78/fpmath-sf.S (__rl78_int_pack_a_r8): Fix edge case rounding up the fraction. * config/rl78/rl78.c (rl78_note_reg_set): Note the use of REGs inside a MEM. From-SVN: r220410
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog5
-rw-r--r--libgcc/config/rl78/fpmath-sf.S14
2 files changed, 15 insertions, 4 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 8d7a6b0..d5540b0 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-02 Nick Clifton <nickc@redhat.com>
+
+ * config/rl78/fpmath-sf.S (__rl78_int_pack_a_r8): Fix edge case
+ rounding up the fraction.
+
2015-01-31 John David Anglin <danglin@gcc.gnu.org>
* config/pa/linux-atomic.c (__kernel_cmpxchg2): Change declaration of
diff --git a/libgcc/config/rl78/fpmath-sf.S b/libgcc/config/rl78/fpmath-sf.S
index f232f6b..6d4d4bd 100644
--- a/libgcc/config/rl78/fpmath-sf.S
+++ b/libgcc/config/rl78/fpmath-sf.S
@@ -49,9 +49,6 @@ START_FUNC __int_isinf
END_FUNC __int_isinf
-START_FUNC _int_unpack_sf
- ;; convert 32-bit SFmode [DE] to 6-byte struct [HL] ("A")
-
#define A_SIGN [hl+0] /* byte */
#define A_EXP [hl+2] /* word */
#define A_FRAC_L [hl+4] /* word */
@@ -66,6 +63,9 @@ START_FUNC _int_unpack_sf
#define B_FRAC_H [hl+14]
#define B_FRAC_HH [hl+15]
+START_FUNC _int_unpack_sf
+ ;; convert 32-bit SFmode [DE] to 6-byte struct [HL] ("A")
+
mov a, [de+3]
sar a, 7
mov A_SIGN, a
@@ -517,8 +517,14 @@ START_FUNC __rl78_int_pack_a_r8
movw ax, A_FRAC_L
addw ax, #1
movw A_FRAC_L, ax
- sknc
+ bnc $1f
incw A_FRAC_H
+
+ ;; If the rounding set the bit beyond the end of the fraction, increment the exponent.
+ mov a, A_FRAC_HH
+ bf a.1, $1f
+ incw A_EXP
+
1:
movw ax, A_FRAC_H
shrw ax, 1