From: "Christopher Li" <sparse@chrisli.org>
To: David Given <dg@cowlark.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH 03/15] Add type information to struct instruction.
Date: Wed, 24 Dec 2008 15:27:47 -0800 [thread overview]
Message-ID: <70318cbf0812241527h6abf21f1hbaa2d9c4b40d566b@mail.gmail.com> (raw)
In-Reply-To: <4952BF51.1040302@cowlark.com>
On Wed, Dec 24, 2008 at 3:01 PM, David Given <dg@cowlark.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Christopher Li wrote:
> [...]
>> OK, if it is just for OP_LOAD. Will this attached patch solve your problem?
>>
>> Instead of adding type to every instruction. It just add that for the OP_LOAD
>> instruction in insn->orig_type. If that works for you. I am very glad to reclaim
>> the space back on instruction structure.
>
> Sorry, I'm not at home right now and can't test this (and probably won't
> until New Year, though I'll have a go).
No problem. Have a nice Christmas.
>
> Also, I don't know if it *is* just of OP_LOAD. That's just the one I
> remember from looking back at old email. I think the issue is that
> OP_LOAD breaks the chain of pseudo->definer->pseudo->definer that I was
> using to determine the intrinsic type of the pseudo, but there may be
> other instructions that do this as well.
I hope that is the only one. Let me know if you find out there is
more instructions.
>
> I'd imagine that nobody else has come across this yet because most
> people are happy using the size to distinguish between different types;
> but (assuming that I've remembered this correctly) this'll bite anyone
> who needs to distinguish floats from int32s of doubles from int64s.
Right, other than the size, we need to distinguish between:
(sign/unsign) integer, floating point, pointers.
That is why we even have three type of cast instruction.
CAST, CASTFP and CASTPTR. They can generate fairly different
code.
> If space is really an issue, would it make sense therefore to replace
> the insn->size (and symbol->size etc) field with a ->type field pointing
> at the defining symbol for the type? Anyone who needs the type can get
> it from the defining symbol, plus all the other information that people
> like me need would be available, and may also simplify other code. (I
> could throw away a complete source file!)
Right, that is what I am purposing in previous email as well.
It looks have more code up front. But it can simplify the back end
who actually going to use it. It is actually much easier to do it
from front end while initializing those symbols.
Chris
next prev parent reply other threads:[~2008-12-24 23:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-15 0:25 [PATCH 00/15] Trivial sparse patches Alexey Zaytsev
2008-12-15 0:25 ` [PATCH 01/15] Evaluate iterator symbols Alexey Zaytsev
2008-12-15 0:26 ` [PATCH 02/15] Unhardcode byte size being 8 bits Alexey Zaytsev
2008-12-15 0:26 ` [PATCH 03/15] Add type information to struct instruction Alexey Zaytsev
2008-12-23 3:21 ` Christopher Li
2008-12-23 4:46 ` Alexey Zaytsev
2008-12-23 5:38 ` Christopher Li
2008-12-23 11:23 ` David Given
2008-12-24 3:09 ` Christopher Li
2008-12-24 23:01 ` David Given
2008-12-24 23:27 ` Christopher Li [this message]
2008-12-24 4:53 ` Alexey Zaytsev
2008-12-15 0:26 ` [PATCH 04/15] Replace the -specs cgcc option with -target Alexey Zaytsev
2008-12-15 0:26 ` [PATCH 05/15] Remove pre_buffer Alexey Zaytsev
2008-12-15 0:26 ` [PATCH 06/15] Sparc64 (Sparc V9, LP64) support Alexey Zaytsev
2008-12-15 0:26 ` [PATCH 07/15] OpenBSD support Alexey Zaytsev
2008-12-15 0:26 ` [PATCH 08/15] Make show_symbol newline-consistent Alexey Zaytsev
2008-12-15 0:27 ` [PATCH 09/15] Handle a terminal -o option properly Alexey Zaytsev
2008-12-15 0:27 ` [PATCH 10/15] Looks more evident this way Alexey Zaytsev
2008-12-15 0:27 ` [PATCH 11/15] Mark handle_switch as static and don't export it from lib.h Alexey Zaytsev
2008-12-15 0:27 ` [PATCH 12/15] Handle missing argument to -D Alexey Zaytsev
2008-12-15 0:27 ` [PATCH 13/15] Gdb macros to get a better look at some sparse data structures Alexey Zaytsev
2008-12-15 0:27 ` [PATCH 14/15] A slightly edited irc discussion with Josh Triplett Alexey Zaytsev
2008-12-15 0:27 ` [PATCH 15/15] Warning should be enough for an unhandled transparent union Alexey Zaytsev
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=70318cbf0812241527h6abf21f1hbaa2d9c4b40d566b@mail.gmail.com \
--to=sparse@chrisli.org \
--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).