Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #13226
| From | "Rod Pemberton" <do_not_have@notemailnot.cmm> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: SEE in gforth 7.0.0 64 bits |
| Date | 2012-06-24 18:44 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <js855o$k76$1@speranza.aioe.org> (permalink) |
| References | (3 earlier) <2012Jun22.131649@mips.complang.tuwien.ac.at> <js2jqv$fg4$1@speranza.aioe.org> <2012Jun23.155121@mips.complang.tuwien.ac.at> <js6ho0$o91$1@speranza.aioe.org> <2012Jun24.152416@mips.complang.tuwien.ac.at> |
"Anton Ertl" <anton@mips.complang.tuwien.ac.at> wrote in message
news:2012Jun24.152416@mips.complang.tuwien.ac.at...
> "Rod Pemberton" <do_not_have@notemailnot.cmm> writes:
...
> >a) unused label's and empty asm's. If gforth "knows"
> >to not emit asm code, why doesn't it "know" to not emit
> >unused labels and empty asm directives?
>
> The labels are used, and the empty asm statements are there for a
> reason; they are always empty, BTW.
>
IIRC, the asm directive for GCC disables code optimization for all
procedures and code blocks. That doesn't seem like a reason gforth would
desire to have... Was that the reason? I.e., if gforth isn't using
assembly, it should stick to C, then the C can be optimized, IMO.
> >b) unneeded do-while's. [...] why does it emit do-while's?
>
> This is the gcc maintainer's preferred way for getting around the C
> syntax anomaly that a block ("{...}") behaves syntactically different
> from a statement.
I.e., I believe you mean to prevent GCC treating a "{...}" block as a
"compound statement"... As in:
http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement-Exprs
If gforth doesn't need do-while or some other control-flow construct
(switch, if, for, etc), why does gforth need to emit curly-braces for a
block in the first place? I.e., with the DUP example, there seems to be no
need for the block... I'm assuming the block is needed or used somehow,
perhaps some other Forth word emits a switch() etc instead?
> Originally we used statement expressions for that,
> but the gcc maintainers seem to hate GNU C extensions
> and quibble about them when code in a bug report includes
> them, if they don't just classify the bug report as invalid outright.
>
...
> Gforth uses goto * to implement the indirect jumps used for threaded
> code. I would love to see your code that achieves that with
> do...whiles and how that optimizes better [...]
Oh, no... I suggested do-while's using "break" or "continue" to replace
(assumed) goto's to the other label's: H_dupe, I_dupe, etc. Maybe, that's a
locality-of-reference problem... too far apart or scope issue... different
block or procedure. Or, maybe my assumption that the label's are goto'd is
incorrect.
I'm assuming the indirection on the goto is a GCC extension. In my own
code, I use function pointers, dereferenced, to call the primitives or
low-level code. I've kept to ANSI C without goto's, but's it's normal ITC
code. Goto's are likely quicker. If gforth's emitted code manages to be
output in a single section or procedure, there won't be any procedure
overhead (prologue, epilogue, parameters). I'm not sure how the indirection
affects goto's in assembly since I don't use goto's. It should map well
onto x86, but I've seen GCC emit some inefficient code.
Rod Pemberton
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
SEE in gforth 7.0.0 64 bits Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-06-21 21:05 +0000
Re: SEE in gforth 7.0.0 64 bits Josh Grams <josh@qualdan.com> - 2012-06-21 22:52 +0000
Re: SEE in gforth 7.0.0 64 bits Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-06-22 11:25 +0000
Re: SEE in gforth 7.0.0 64 bits Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-06-22 12:23 +0000
Re: SEE in gforth 7.0.0 64 bits anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-06-22 11:57 +0000
Re: SEE in gforth 7.0.0 64 bits Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-06-22 20:42 +0000
Re: SEE in gforth 7.0.0 64 bits rugxulo@gmail.com - 2012-06-24 05:28 -0700
Re: SEE in gforth 7.0.0 64 bits Paul Rubin <no.email@nospam.invalid> - 2012-06-21 19:31 -0700
Re: SEE in gforth 7.0.0 64 bits Mark Wills <markrobertwills@yahoo.co.uk> - 2012-06-22 00:54 -0700
Re: SEE in gforth 7.0.0 64 bits anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-06-22 11:16 +0000
Re: SEE in gforth 7.0.0 64 bits "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-22 16:17 -0400
Re: SEE in gforth 7.0.0 64 bits anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-06-23 13:51 +0000
Re: SEE in gforth 7.0.0 64 bits "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-24 04:06 -0400
Re: SEE in gforth 7.0.0 64 bits Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-06-24 06:55 -0500
Re: SEE in gforth 7.0.0 64 bits anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-06-24 13:24 +0000
Re: SEE in gforth 7.0.0 64 bits "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-24 18:44 -0400
Re: SEE in gforth 7.0.0 64 bits Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-06-25 05:00 -0500
Re: SEE in gforth 7.0.0 64 bits "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-25 17:54 -0400
Re: SEE in gforth 7.0.0 64 bits Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-06-26 03:41 -0500
Re: SEE in gforth 7.0.0 64 bits rugxulo@gmail.com - 2012-06-24 05:25 -0700
Re: SEE in gforth 7.0.0 64 bits anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-06-24 14:08 +0000
Re: SEE in gforth 7.0.0 64 bits rugxulo@gmail.com - 2012-06-25 07:56 -0700
OT: fixing Mark's A0's, was [Re: SEE in gforth 7.0.0 64 bits] "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-22 16:18 -0400
Re: OT: fixing Mark's A0's, was [Re: SEE in gforth 7.0.0 64 bits] Marc Olschok <nobody@nowhere.invalid> - 2012-06-25 12:42 +0000
Re: OT: fixing Mark's A0's, was [Re: SEE in gforth 7.0.0 64 bits] Mark Wills <markrobertwills@yahoo.co.uk> - 2012-06-25 06:30 -0700
Re: OT: fixing Mark's A0's, was [Re: SEE in gforth 7.0.0 64 bits] rugxulo@gmail.com - 2012-06-25 08:04 -0700
Re: OT: fixing Mark's A0's, was [Re: SEE in gforth 7.0.0 64 bits] Mark Wills <markrobertwills@yahoo.co.uk> - 2012-06-25 11:00 -0700
Re: OT: fixing Mark's A0's, was [Re: SEE in gforth 7.0.0 64 bits] "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-25 17:47 -0400
Re: SEE in gforth 7.0.0 64 bits "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-06-22 16:01 -0400
Re: SEE in gforth 7.0.0 64 bits Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2012-06-24 15:15 +0100
csiph-web