From: David Given <dg@cowlark.com>
To: linux-sparse@vger.kernel.org
Subject: Re: Odd behaviour with OP_SCAST
Date: Wed, 10 Sep 2008 21:48:16 +0100 [thread overview]
Message-ID: <48C83290.9010206@cowlark.com> (raw)
In-Reply-To: <70318cbf0809081402i7c7e80c4g9b45988b8cf2e0fc@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]
Chris Li wrote:
[...]
> 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.
Here's another one; and this is with a stock unmodified sparse, too, so
I know it's not my fault.
extern double pow(double x, double y);
double d(double p)
{ return pow(2, p); }
-->
call.64 %r2 <- pow, $2, %arg1
ret.64 %r2
(Again with test-unssa, which seems to be convenient for displaying
intermediate code.)
[...]
> The change require the instruction to have more type
> information than size. I am tempting to just put a full
> ctype pointer there.
In fact, that's what I've got in the private patch I'm using for Clue,
although I'm only using it for determining the types of pseudos; I just
hacked alloc_typed_instruction() (which knows the type) to add it. No
other changes.
(This, BTW, is for a Clue backend that targets C. Yes, I can now compile
C into C, which I'm sure might be useful to *someone*... due to getting
ints and doubles confused some of the benchmarks are producing the wrong
results, but the Whetstone one appears to be reasonably intact and
*claims* that C compiled via sparse and Clue into C gets about 90% of
the performance of direct compilation. Even though the benchmark is
known to be poor and unreliable anyway, that's still indicative of
sparse doing a pretty decent job...)
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "All power corrupts, but we need electricity." --- Diana Wynne Jones,
│ _Archer's Goon_
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
prev parent reply other threads:[~2008-09-10 20:48 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
2008-09-10 20:48 ` David Given [this message]
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=48C83290.9010206@cowlark.com \
--to=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).