Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
well formed flag ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 50 of 58 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Elizabeth D. Rather  
View profile  
 More options Oct 27 2012, 9:46 pm
Newsgroups: comp.lang.forth
From: "Elizabeth D. Rather" <erat...@forth.com>
Date: Sat, 27 Oct 2012 15:46:07 -1000
Local: Sat, Oct 27 2012 9:46 pm
Subject: Re: well formed flag ?
On 10/27/12 3:33 PM, Ed wrote:

And I agree with that wholeheartedly. By the time we started work on ANS
Forth, though, it had become common practice. The solution was to
replace NOT with either NEGATE (arithmetic inversion) or INVERT (invert
bits). All compromises have flaws, but at least you know what you're
getting.

Cheers,
Elizabeth

--
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rod Pemberton  
View profile  
 More options Oct 28 2012, 4:16 am
Newsgroups: comp.lang.forth
From: "Rod Pemberton" <do_not_h...@notemailnotz.cnm>
Date: Sun, 28 Oct 2012 04:19:57 -0400
Local: Sun, Oct 28 2012 4:19 am
Subject: Re: well formed flag ?
"Chris Hinsley" <chris.hins...@gmail.com> wrote in message

news:2012102721014029342-chrishinsley@gmailcom...

> Phew ! I was getting jelous and starting to wonder why I picked ebx as
> top of stack rather than eax ! ;)

It seems that only XLAT uses EBX.  So, it's more flexible in terms of
instruction choice, or more likely to not be clobbered.  ECX or CL is used
by loop, branching, and rotate or shift instructions.  EDX is used by
multiply and division instructions.  EAX is used by multiply, division,
string instructions, etc.  If you're moving immediates into registers, quite
a few x86 instructions have shorter forms for the EAX register.

Rod Pemberton


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Pelc  
View profile  
 More options Oct 28 2012, 7:55 am
Newsgroups: comp.lang.forth
From: stephen...@mpeforth.com (Stephen Pelc)
Date: Sun, 28 Oct 2012 11:53:04 GMT
Local: Sun, Oct 28 2012 7:53 am
Subject: Re: well formed flag ?

On Sun, 28 Oct 2012 11:05:55 +1100, "Ed" <inva...@nospam.com> wrote:
>The downside is that a good forth optimizer isn't cheap.  IIRC Stephen
>once quoted a figure of 50,000 lines of code.

Aout 5,000 lines for many CPUs. 6,000 lines for the x86 version.
Then add the code for the assembler and disassembler.

>And still it may not be as fast as a good C compiler.

The important comparison is the number of hours spent on the
code generators for C and Forth.

Stephen

--
Stephen Pelc, stephen...@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bernd Paysan  
View profile  
 More options Oct 28 2012, 9:17 am
Newsgroups: comp.lang.forth
From: Bernd Paysan <bernd.pay...@gmx.de>
Date: Sun, 28 Oct 2012 14:17:39 +0100
Local: Sun, Oct 28 2012 9:17 am
Subject: Re: well formed flag ?

Stephen Pelc wrote:
> The important comparison is the number of hours spent on the
> code generators for C and Forth.

IMHO VFX is limited on x86 by the numbers of registers.  As are C
compilers.  When I wrote my Wurstkessel cryptography core, Marcel did
compare the C compiler result with iForth on x64, where more registers
are available, and the speed was about the same.

On x86, Andy Glew (one of the designers of the Pentium Pro) suggested
adding an instruction for "well formed flags" in the Forth sense - which
could be used for bit-wise operations.  It got turned down by senior
management, because C compilers couldn't make any benefit from it;
though assembly code would.

Later, in the SSE instruction set, the idea was revived, and indeed
implemented: SSE compares store their result flags as either all bits
set or all bits cleared in the destination register.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marcel Hendrix  
View profile  
 More options Oct 28 2012, 10:59 am
Newsgroups: comp.lang.forth
From: m...@iae.nl (Marcel Hendrix)
Date: Sun, 28 Oct 2012 16:59:16 +0200
Local: Sun, Oct 28 2012 10:59 am
Subject: Re: well formed flag ?
Bernd Paysan <bernd.pay...@gmx.de> writes Re: well formed flag ?

> Stephen Pelc wrote:
>> The important comparison is the number of hours spent on the
>> code generators for C and Forth.
> IMHO VFX is limited on x86 by the numbers of registers.  As are C
> compilers.  When I wrote my Wurstkessel cryptography core, Marcel did
> compare the C compiler result with iForth on x64, where more registers
> are available, and the speed was about the same.

I redid these just now on an i7 2.66 GHz machine:

64bits - 0.985 seconds; Speed: 518,743,667 bytes/sec.
32bits - 2.981 seconds; Speed: 171,696,847 bytes/sec. ( rngs_wurst in CODE )
32bits - 4.741 seconds; Speed: 107,971,320 bytes/sec. ( high-level )

> On x86, Andy Glew (one of the designers of the Pentium Pro) suggested
> adding an instruction for "well formed flags" in the Forth sense - which
> could be used for bit-wise operations.  It got turned down by senior
> management, because C compilers couldn't make any benefit from it;
> though assembly code would.

Rngs_wurst is in CODE because the carry bit is needed.

        : rngs_wurst ( ud1 index -- ud2 )  
            64s ( 8 * ) 'rngs + 64@
            2>R
            DUP 0< >R D2* R> DUP D- 2R>
            ROT XOR >R XOR R> ; PRIVATE

> Later, in the SSE instruction set, the idea was revived, and indeed
> implemented: SSE compares store their result flags as either all bits
> set or all bits cleared in the destination register.

-marcel

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bernd Paysan  
View profile  
 More options Oct 28 2012, 1:37 pm
Newsgroups: comp.lang.forth
From: Bernd Paysan <bernd.pay...@gmx.de>
Date: Sun, 28 Oct 2012 18:37:20 +0100
Local: Sun, Oct 28 2012 1:37 pm
Subject: Re: well formed flag ?

Marcel Hendrix wrote:
>> IMHO VFX is limited on x86 by the numbers of registers.  As are C
>> compilers.  When I wrote my Wurstkessel cryptography core, Marcel did
>> compare the C compiler result with iForth on x64, where more
>> registers are available, and the speed was about the same.

> I redid these just now on an i7 2.66 GHz machine:

> 64bits - 0.985 seconds; Speed: 518,743,667 bytes/sec.
> 32bits - 2.981 seconds; Speed: 171,696,847 bytes/sec. ( rngs_wurst in
> CODE ) 32bits - 4.741 seconds; Speed: 107,971,320 bytes/sec. (
> high-level )

In theory, Wurstkessel should take about twice the time on a 32 bit
processor than on a 64 bit processor.  However, when we compile high-
level code for both, it's a factor 5.  The way the code is arranged
gives a benefit on x64 with 8 accumulator registers - a version tuned
for 32 bits would use one accumulator after the other (or maybe two
accumulators, 4 registers), but will have a lot less intrinsic
parallelism.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed  
View profile  
 More options Oct 29 2012, 8:48 am
Newsgroups: comp.lang.forth
From: "Ed" <inva...@nospam.com>
Date: Mon, 29 Oct 2012 23:46:51 +1100
Local: Mon, Oct 29 2012 8:46 am
Subject: Re: well formed flag ?

Bernd Paysan wrote:
> Stephen Pelc wrote:
> > The important comparison is the number of hours spent on the
> > code generators for C and Forth.

> IMHO VFX is limited on x86 by the numbers of registers.  As are C
> compilers.  When I wrote my Wurstkessel cryptography core, Marcel did
> compare the C compiler result with iForth on x64, where more registers
> are available, and the speed was about the same.

How many C compilers were tested?

> On x86, Andy Glew (one of the designers of the Pentium Pro) suggested
> adding an instruction for "well formed flags" in the Forth sense - which
> could be used for bit-wise operations.  It got turned down by senior
> management, because C compilers couldn't make any benefit from it;
> though assembly code would.

> Later, in the SSE instruction set, the idea was revived, and indeed
> implemented: SSE compares store their result flags as either all bits
> set or all bits cleared in the destination register.

I expect C (and similar languages) to generate better code, more easily,
because they operate at a higher level of abstraction than does Forth.
Unlike other languages, Forth is (as you point out) highly reliant on registers
and optimizers.  It needs these to eliminate the inefficiency of pushing items
around a virtual stack - something which conventional cpu's were never
designed to do.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed  
View profile  
 More options Oct 29 2012, 8:48 am
Newsgroups: comp.lang.forth
From: "Ed" <inva...@nospam.com>
Date: Mon, 29 Oct 2012 23:47:23 +1100
Local: Mon, Oct 29 2012 8:47 am
Subject: Re: well formed flag ?

Stephen Pelc wrote:
> On Sun, 28 Oct 2012 11:05:55 +1100, "Ed" <inva...@nospam.com> wrote:

> >The downside is that a good forth optimizer isn't cheap.  IIRC Stephen
> >once quoted a figure of 50,000 lines of code.

> Aout 5,000 lines for many CPUs. 6,000 lines for the x86 version.
> Then add the code for the assembler and disassembler.

No doubt you're glad it's not 50,000 :)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Haley  
View profile  
 More options Oct 29 2012, 9:33 am
Newsgroups: comp.lang.forth
From: Andrew Haley <andre...@littlepinkcloud.invalid>
Date: Mon, 29 Oct 2012 08:33:53 -0500
Local: Mon, Oct 29 2012 9:33 am
Subject: Re: well formed flag ?

Ed <inva...@nospam.com> wrote:
> I expect C (and similar languages) to generate better code, more
> easily, because they operate at a higher level of abstraction than
> does Forth.

On what is this opinion based?

> Unlike other languages, Forth is (as you point out) highly reliant
> on registers and optimizers.

And C isn't?

> It needs these to eliminate the inefficiency of pushing items around
> a virtual stack - something which conventional cpu's were never
> designed to do.

They weren't designed to evaluate expression trees either.  What you
perhaps don't realize is that expression trees and RPN are equivalent:
there is a 1:1 mapping between the two.  In both cases you have to
convert the abstract form into instructions that push data between
memory and registers.

Andrew.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 29 2012, 11:25 am
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Mon, 29 Oct 2012 08:25:17 -0700
Local: Mon, Oct 29 2012 11:25 am
Subject: Re: well formed flag ?

Andrew Haley <andre...@littlepinkcloud.invalid> writes:
> What you perhaps don't realize is that expression trees and RPN are
> equivalent: there is a 1:1 mapping between the two.  

I think not quite right--RPN is more like linear logic, unless you have
locals or something like PICK.  This is apparent from Koopman's book
where he talks about ways to compile C into Forth.  There's also a cool
paper by Henry Baker:

http://home.pipeline.com/~hbaker1/ForthStack.html

> In both cases you have to convert the abstract form into instructions
> that push data between memory and registers.

If the Forth code is written in the classic style (using global
variables to hold temporary values when stack shuffling gets too
complex) then it may be harder to compile good code.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Haley  
View profile  
 More options Oct 29 2012, 1:27 pm
Newsgroups: comp.lang.forth
From: Andrew Haley <andre...@littlepinkcloud.invalid>
Date: Mon, 29 Oct 2012 12:27:11 -0500
Local: Mon, Oct 29 2012 1:27 pm
Subject: Re: well formed flag ?

Paul Rubin <no.em...@nospam.invalid> wrote:
> Andrew Haley <andre...@littlepinkcloud.invalid> writes:
>> What you perhaps don't realize is that expression trees and RPN are
>> equivalent: there is a 1:1 mapping between the two.  

> I think not quite right--RPN is more like linear logic, unless you have
> locals or something like PICK.

Of course you have locals.  We've had locals in Forth for 20 years.

> This is apparent from Koopman's book where he talks about ways to
> compile C into Forth.

OK, I shouldn't have written that without a list of caveats.  :-)

If we're going to nitpick, and I guess we are, expression trees and
RPN are equivalent in the absence of stack order manipulation and
loops: in that case the algorithm to convert between the two is pretty
trivial.  In the presence of stack manipulation things get a bit more
complicated but it's a fairly simple matter of copying and creating
temporaries.  (We did all of this in gcj, which converts stack code to
expression trees in a GCC front end.)  There's certainly nothing
inherent to generating code for a register machine from stack code
that would make generation less efficient.  Data flow analysis on the
stack is no different from data flow analysis between a bunch of local
variables.  As Stephen has pointed out on many occasions, the only
additional thing you need to do in a Forth optimizer is a stack
shuffle at block boundaries.

> There's also a cool paper by Henry Baker:

> http://home.pipeline.com/~hbaker1/ForthStack.html

>> In both cases you have to convert the abstract form into instructions
>> that push data between memory and registers.

> If the Forth code is written in the classic style (using global
> variables to hold temporary values when stack shuffling gets too
> complex)

'tain't my classic style!  I always had to bear multi-tasking in mind,
anyway.

> then it may be harder to compile good code.

The same applies to C, surely.

Andrew.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 30 2012, 11:19 am
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Tue, 30 Oct 2012 08:18:56 -0700
Local: Tues, Oct 30 2012 11:18 am
Subject: Re: well formed flag ?

Andrew Haley <andre...@littlepinkcloud.invalid> writes:
>>> expression trees and RPN are equivalent: ...
> Of course you have locals.  We've had locals in Forth for 20 years.

OK, in this case there's equivalence, it's just no longer pure RPN, but
no problem.

>> If the Forth code is written in the classic style (using global
>> variables to hold temporary values when stack shuffling gets too
>> complex)

> 'tain't my classic style!  I always had to bear multi-tasking in mind,
> anyway.

Oh good point, by "global" I just meant "not local".  In particular if
you store to a variable, any subroutine you call might access or modify
it, so you need whole-program analysis to tell if that has happeened.

> The same applies to C, surely.

There are a bunch of rules in C about when the compiler can assume
variables aren't aliased.  I don't think Forth has anything like that.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Haley  
View profile  
 More options Oct 30 2012, 11:33 am
Newsgroups: comp.lang.forth
From: Andrew Haley <andre...@littlepinkcloud.invalid>
Date: Tue, 30 Oct 2012 10:33:46 -0500
Local: Tues, Oct 30 2012 11:33 am
Subject: Re: well formed flag ?

Paul Rubin <no.em...@nospam.invalid> wrote:
> Andrew Haley <andre...@littlepinkcloud.invalid> writes:
>>>> expression trees and RPN are equivalent: ...
>> Of course you have locals.  We've had locals in Forth for 20 years.

> OK, in this case there's equivalence, it's just no longer pure RPN, but
> no problem.

In what sense is it not "pure" RPN?  IMO,

  A B +

is still RPN, even if A and B are local variables.  RPN is just how
you write expressions.  It's no different from  A + B  or  (+ A B) .

>>> If the Forth code is written in the classic style (using global
>>> variables to hold temporary values when stack shuffling gets too
>>> complex)

>> 'tain't my classic style!  I always had to bear multi-tasking in mind,
>> anyway.

> Oh good point, by "global" I just meant "not local".  In particular if
> you store to a variable, any subroutine you call might access or modify
> it, so you need whole-program analysis to tell if that has happeened.

Sure, as in any language.  That's my point: there isn't really much of
a difference in practice.

Andrew.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 30 2012, 11:48 am
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Tue, 30 Oct 2012 08:48:13 -0700
Local: Tues, Oct 30 2012 11:48 am
Subject: Re: well formed flag ?

Andrew Haley <andre...@littlepinkcloud.invalid> writes:
> In what sense is it not "pure" RPN?  IMO,
>   A B +
> is still RPN, even if A and B are local variables.

The impurity happens when you have to store to locals (or to the
interior of the stack) in the middle of the evaluation.  I don't think
pure RPN has a way to do that.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Haley  
View profile  
 More options Oct 30 2012, 12:45 pm
Newsgroups: comp.lang.forth
From: Andrew Haley <andre...@littlepinkcloud.invalid>
Date: Tue, 30 Oct 2012 11:45:23 -0500
Local: Tues, Oct 30 2012 12:45 pm
Subject: Re: well formed flag ?

Paul Rubin <no.em...@nospam.invalid> wrote:
> Andrew Haley <andre...@littlepinkcloud.invalid> writes:
>> In what sense is it not "pure" RPN?  IMO,
>>   A B +
>> is still RPN, even if A and B are local variables.

> The impurity happens when you have to store to locals (or to the
> interior of the stack) in the middle of the evaluation.  I don't think
> pure RPN has a way to do that.

No, I'm sure it doesn't.  But pure RPN doesn't have a way to store
into a global either: all RPN can do is expressions.

Andrew.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Pelc  
View profile  
 More options Oct 30 2012, 2:05 pm
Newsgroups: comp.lang.forth
From: stephen...@mpeforth.com (Stephen Pelc)
Date: Tue, 30 Oct 2012 18:02:29 GMT
Local: Tues, Oct 30 2012 2:02 pm
Subject: Re: well formed flag ?

On Mon, 29 Oct 2012 23:47:23 +1100, "Ed" <inva...@nospam.com> wrote:
>Stephen Pelc wrote:
>> On Sun, 28 Oct 2012 11:05:55 +1100, "Ed" <inva...@nospam.com> wrote:

>> >The downside is that a good forth optimizer isn't cheap.  IIRC Stephen
>> >once quoted a figure of 50,000 lines of code.

>> Aout 5,000 lines for many CPUs. 6,000 lines for the x86 version.
>> Then add the code for the assembler and disassembler.

>No doubt you're glad it's not 50,000 :)

Oh, yes.

Stephen

--
Stephen Pelc, stephen...@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bernd Paysan  
View profile  
 More options Oct 30 2012, 3:10 pm
Newsgroups: comp.lang.forth
From: Bernd Paysan <bernd.pay...@gmx.de>
Date: Tue, 30 Oct 2012 20:10:42 +0100
Local: Tues, Oct 30 2012 3:10 pm
Subject: Re: well formed flag ?

Paul Rubin wrote:
> There are a bunch of rules in C about when the compiler can assume
> variables aren't aliased.  I don't think Forth has anything like that.

Standard Forth has IMHO 6 separate memory areas:

* dictionary + heap
* code memory
* data stack
* return stack
* floating point stack
* locals

You can only address the dictionary and heap with @ and !.

In any case, it would be *much* better for an optimizer if you
deliberately and explicitely can specify unaliased variables if it can
help the compiler.

Languages without arbitrary pointers like traditional Fortran have much
stricter rules for unaliased memories.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McDonald  
View profile  
 More options Oct 30 2012, 6:10 pm
Newsgroups: comp.lang.forth
From: Alex McDonald <b...@rivadpm.com>
Date: Tue, 30 Oct 2012 15:10:23 -0700 (PDT)
Local: Tues, Oct 30 2012 6:10 pm
Subject: Re: well formed flag ?
On Oct 30, 8:10 pm, Bernd Paysan <bernd.pay...@gmx.de> wrote:

DEFER causes an aliasing problem. Beyond DEFER, I don't think there
are any other cases.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Elizabeth D. Rather  
View profile  
 More options Oct 30 2012, 6:50 pm
Newsgroups: comp.lang.forth
From: "Elizabeth D. Rather" <erat...@forth.com>
Date: Tue, 30 Oct 2012 12:50:49 -1000
Local: Tues, Oct 30 2012 6:50 pm
Subject: Re: well formed flag ?
On 10/30/12 9:10 AM, Bernd Paysan wrote:

> Paul Rubin wrote:
>> There are a bunch of rules in C about when the compiler can assume
>> variables aren't aliased.  I don't think Forth has anything like that.

> Standard Forth has IMHO 6 separate memory areas:

> * dictionary + heap
> * code memory

The correct ANS terminology for those to is "data space" and "code
space". Data space is accessible to user programs. The "dictionary" is
in two parts, "name space" (headers, etc.) and "code space" (regardless
of whether they're in the same address space). Neither name space nor
code space guaranteed accessible to user programs.

Cheers,
Elizabeth

--
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed  
View profile  
 More options Oct 30 2012, 8:45 pm
Newsgroups: comp.lang.forth
From: "Ed" <inva...@nospam.com>
Date: Wed, 31 Oct 2012 11:44:30 +1100
Local: Tues, Oct 30 2012 8:44 pm
Subject: Re: well formed flag ?

Stephen Pelc wrote:
> On Mon, 29 Oct 2012 23:47:23 +1100, "Ed" <inva...@nospam.com> wrote:

> >Stephen Pelc wrote:
> >> On Sun, 28 Oct 2012 11:05:55 +1100, "Ed" <inva...@nospam.com> wrote:

> >> >The downside is that a good forth optimizer isn't cheap.  IIRC Stephen
> >> >once quoted a figure of 50,000 lines of code.

> >> Aout 5,000 lines for many CPUs. 6,000 lines for the x86 version.
> >> Then add the code for the assembler and disassembler.

> >No doubt you're glad it's not 50,000 :)

> Oh, yes.

You mention the disassembler.  Is this used by the code generator
in any way?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 30 2012, 9:28 pm
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Tue, 30 Oct 2012 18:28:43 -0700
Local: Tues, Oct 30 2012 9:28 pm
Subject: Re: well formed flag ?

Alex McDonald <b...@rivadpm.com> writes:
> DEFER causes an aliasing problem. Beyond DEFER, I don't think there
> are any other cases.

variable x
variable y    x y !   \ y points at x
3 y @ !               \ sets x to 3

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Pelc  
View profile  
 More options Oct 31 2012, 5:30 am
Newsgroups: comp.lang.forth
From: stephen...@mpeforth.com (Stephen Pelc)
Date: Wed, 31 Oct 2012 09:25:04 GMT
Local: Wed, Oct 31 2012 5:25 am
Subject: Re: well formed flag ?

On Wed, 31 Oct 2012 11:44:30 +1100, "Ed" <inva...@nospam.com> wrote:
>You mention the disassembler.  Is this used by the code generator
>in any way?

It's used by the humans testing the code generator.

Stephen

--
Stephen Pelc, stephen...@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Aliasing (was: well formed flag ?)" by Anton Ertl
Anton Ertl  
View profile  
 More options Oct 31 2012, 10:03 am
Newsgroups: comp.lang.forth
From: an...@mips.complang.tuwien.ac.at (Anton Ertl)
Date: Wed, 31 Oct 2012 14:03:34 GMT
Local: Wed, Oct 31 2012 10:03 am
Subject: Aliasing (was: well formed flag ?)

Paul Rubin <no.em...@nospam.invalid> writes:
>There are a bunch of rules in C about when the compiler can assume
>variables aren't aliased.  I don't think Forth has anything like that.

Wrong: If we applied the same attitude as seems to be dominating among
C compiler writers (that miscompiling non-standard programs is ok or
even encouraged), there is no aliasing beween the memory accesses in
the sequence "F! ! c@".  And something like that is pretty much all
that a C compiler can assume, too, even with the attitude above.
Fortunately the Forth implementors are saner and don't have that
attitude; or maybe they would be just as insane, if limits on compile
time and compiler writer time did not prevent them from implementing
optimizations that would profit from knowledge about non-aliasing.

If you are thinking of the keyword "restrict" in C, that is hardly
used.  One might introduce such a feature in Forth, too, but currently
systems would not do anything with it, and even if they did, would
programmers use it?  Judging from the C experience, most probably
would not.

- anton
--
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "well formed flag ?" by Anton Ertl
Anton Ertl  
View profile  
 More options Oct 31 2012, 11:16 am
Newsgroups: comp.lang.forth
From: an...@mips.complang.tuwien.ac.at (Anton Ertl)
Date: Wed, 31 Oct 2012 14:57:54 GMT
Local: Wed, Oct 31 2012 10:57 am
Subject: Re: well formed flag ?

Bernd Paysan <bernd.pay...@gmx.de> writes:
>Languages without arbitrary pointers like traditional Fortran have much
>stricter rules for unaliased memories.

Fortran has one particular such rule: The compiler may pass parameters
by reference, but a program must not pass the same array to a
functioon through two parameters.

That rule is not present in other languages without arbitrary
pointers, such as Algol, Pascal or Java.  In particular, Jensen's
Device (Algol 60) relies on two parameters referencing the same
variable through name calling.

Conversely, one can have a rule like the Fortran rule in a language
with arbitrary pointers like Forth, or add arbitrary pointers to
Fortran.  The generalization of Fortrans parameter rule would be: two
parameters would not be allowed to point to the same contiguous region
(in Forth terminology).  I think that it would be a bad idea to add
such a rule to Forth, though, even if we would not have to care about
backwards compatibility.

- anton
--
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rod Pemberton  
View profile  
 More options Oct 31 2012, 12:02 pm
Newsgroups: comp.lang.forth
From: "Rod Pemberton" <do_not_h...@notemailnotz.cnm>
Date: Wed, 31 Oct 2012 12:06:28 -0400
Local: Wed, Oct 31 2012 12:06 pm
Subject: Re: well formed flag ?
"Paul Rubin" <no.em...@nospam.invalid> wrote in message

news:7xhapcgf8f.fsf@ruckus.brouhaha.com...
...

> There are a bunch of rules in C about when the compiler can assume
> variables aren't aliased.  I don't think Forth has anything like that.

After Anton pointed it out, I have to ask what you're talking about too.

Except for 'restrict' keyword, a pointer may point to or within any C
object, i.e., aliased.  Or, a pointer may point to a special location
referred to as NULL.  NULL is typically zero but not required to be.
NULL just needs to be a location where no valid C object can be located.
A pointer can usually point to non-C objects too.  While that's usually a
standard C feature, it's implementation specific according to the
specifications.

Rod Pemberton


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 26 - 50 of 58 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »