From: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: vsementsov@virtuozzo.com, jhauser@eecs.berkeley.edu,
cota@braap.org, den@openvz.org, andrey.shinkevich@virtuozzo.com,
alex.bennee@linaro.org
Subject: [Qemu-devel] [PATCH] Fix: fp-test uninitialized member floatX::exp
Date: Tue, 30 Jul 2019 13:13:13 +0300 [thread overview]
Message-ID: <1564481593-776647-1-git-send-email-andrey.shinkevich@virtuozzo.com> (raw)
Not all the paths in the functions, such as f16ToFloatX(), initialize
the member 'exp' of the structure floatX.
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
source/slowfloat.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/fp/berkeley-testfloat-3/source/slowfloat.c b/tests/fp/berkeley-testfloat-3/source/slowfloat.c
index 4e84656..6e0f0a6 100644
--- a/tests/fp/berkeley-testfloat-3/source/slowfloat.c
+++ b/tests/fp/berkeley-testfloat-3/source/slowfloat.c
@@ -623,6 +623,7 @@ static void f16ToFloatX( float16_t a, struct floatX *xPtr )
xPtr->isInf = false;
xPtr->isZero = false;
xPtr->sign = ((uiA & 0x8000) != 0);
+ xPtr->exp = 0;
exp = uiA>>10 & 0x1F;
sig64 = uiA & 0x03FF;
sig64 <<= 45;
@@ -759,6 +760,7 @@ static void f32ToFloatX( float32_t a, struct floatX *xPtr )
xPtr->isInf = false;
xPtr->isZero = false;
xPtr->sign = ((uiA & 0x80000000) != 0);
+ xPtr->exp = 0;
exp = uiA>>23 & 0xFF;
sig64 = uiA & 0x007FFFFF;
sig64 <<= 32;
@@ -895,6 +897,7 @@ static void f64ToFloatX( float64_t a, struct floatX *xPtr )
xPtr->isInf = false;
xPtr->isZero = false;
xPtr->sign = ((uiA & UINT64_C( 0x8000000000000000 )) != 0);
+ xPtr->exp = 0;
exp = uiA>>52 & 0x7FF;
sig64 = uiA & UINT64_C( 0x000FFFFFFFFFFFFF );
if ( exp == 0x7FF ) {
@@ -1220,6 +1223,7 @@ static void f128MToFloatX( const float128_t *aPtr, struct floatX *xPtr )
xPtr->isZero = false;
uiA64 = uiAPtr->v64;
xPtr->sign = ((uiA64 & UINT64_C( 0x8000000000000000 )) != 0);
+ xPtr->exp = 0;
exp = uiA64>>48 & 0x7FFF;
sig.v64 = uiA64 & UINT64_C( 0x0000FFFFFFFFFFFF );
sig.v0 = uiAPtr->v0;
--
1.8.3.1
next reply other threads:[~2019-07-30 10:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 10:13 Andrey Shinkevich [this message]
2019-08-13 12:03 ` [Qemu-devel] [PATCH] Fix: fp-test uninitialized member floatX::exp Andrey Shinkevich
2019-08-13 12:21 ` Alex Bennée
2019-08-20 17:01 ` Andrey Shinkevich
2019-08-27 15:05 ` Andrey Shinkevich
2019-08-27 15:59 ` Alex Bennée
2019-08-29 15:50 ` Andrey Shinkevich
2019-08-20 15:16 ` Andrey Shinkevich
2019-08-20 15:21 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1564481593-776647-1-git-send-email-andrey.shinkevich@virtuozzo.com \
--to=andrey.shinkevich@virtuozzo.com \
--cc=alex.bennee@linaro.org \
--cc=cota@braap.org \
--cc=den@openvz.org \
--cc=jhauser@eecs.berkeley.edu \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).