From: "Chris Li" <christ.li@gmail.com>
To: David Given <dg@cowlark.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: Odd behaviour with OP_SCAST
Date: Mon, 8 Sep 2008 14:02:18 -0700 [thread overview]
Message-ID: <70318cbf0809081402i7c7e80c4g9b45988b8cf2e0fc@mail.gmail.com> (raw)
In-Reply-To: <48C2F2BC.9030606@cowlark.com>
On Sat, Sep 6, 2008 at 2:14 PM, David Given <dg@cowlark.com> wrote:
> The end result is that my call statement turns into:
>
> call func, $0, %r3, %arg1, %arg1
>
> ...which is wrong.
>
> I assume that Clue's odd configuration is violating some assumption
> somewhere, but I'm not well-enough versed with the sparse internals to
> know where. It does seem odd to me that it's generating an OP_SCAST to
> convert the int to a double, rather than an OP_FPCAST like in the float.
Sparse assume that float and double have different size than int.
On the linearized instruction level, it does not have the full type
information any more. All it got is the size of the type. So it is
tricky to distinguish int vs float.
It generate cast to double because your third argument is a
double type.
Because the kernel does not have any floating pointer
code. Sparse did not take floating point very seriously.
The change require the instruction to have more type
information than size. I am tempting to just put a full
ctype pointer there.
Chris
next prev parent reply other threads:[~2008-09-08 21:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-06 21:14 Odd behaviour with OP_SCAST David Given
2008-09-08 21:02 ` Chris Li [this message]
2008-09-10 20:48 ` David Given
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=70318cbf0809081402i7c7e80c4g9b45988b8cf2e0fc@mail.gmail.com \
--to=christ.li@gmail.com \
--cc=dg@cowlark.com \
--cc=linux-sparse@vger.kernel.org \
/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).