Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #47571 > unrolled thread
| Started by | Jason Damisch <jasondamisch@yahoo.com> |
|---|---|
| First post | 2016-05-27 11:21 -0700 |
| Last post | 2016-05-28 23:42 -0400 |
| Articles | 10 — 6 participants |
Back to article view | Back to comp.lang.forth
32 bit VS 64 bit modes Jason Damisch <jasondamisch@yahoo.com> - 2016-05-27 11:21 -0700
Re: 32 bit VS 64 bit modes Paul Rubin <no.email@nospam.invalid> - 2016-05-27 13:06 -0700
Re: 32 bit VS 64 bit modes Jason Damisch <jasondamisch@yahoo.com> - 2016-05-27 13:22 -0700
Re: 32 bit VS 64 bit modes hughaguilar96@gmail.com - 2016-05-27 13:59 -0700
Re: 32 bit VS 64 bit modes anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-28 10:07 +0000
Re: 32 bit VS 64 bit modes Paul Rubin <no.email@nospam.invalid> - 2016-05-28 19:09 -0700
Re: 32 bit VS 64 bit modes Paul Rubin <no.email@nospam.invalid> - 2016-05-28 20:00 -0700
Re: 32 bit VS 64 bit modes Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> - 2016-05-29 17:46 +0000
Re: 32 bit VS 64 bit modes Paul Rubin <no.email@nospam.invalid> - 2016-05-29 11:27 -0700
Re: 32 bit VS 64 bit modes Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-05-28 23:42 -0400
| From | Jason Damisch <jasondamisch@yahoo.com> |
|---|---|
| Date | 2016-05-27 11:21 -0700 |
| Subject | 32 bit VS 64 bit modes |
| Message-ID | <496341e2-6ac8-4bcc-903e-c9e39e3495ae@googlegroups.com> |
> In another thread Anton Ertl stated > I have now access to an Odroid C2 running Ubuntu 16.04 in > 64-bit mode often called AArch64, but Gforth calls it arm64) I admit not being the most adroit computer programmer or user in the world. So, I thought that I'd ask, if people don't mind too much, what the various trade-offs and advantages are between 32 bit and 64 bit modes. For 16 bit VS 32 bit the advantages are obvious. But, it seems to me that 32 VS 64 has diminishing returns. Maybe 40 bit would be ideal? What reasons could there possibly be for having more than 4 GB of RAM? Jason
[toc] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-05-27 13:06 -0700 |
| Message-ID | <87zirbgta9.fsf@nightsong.com> |
| In reply to | #47571 |
Jason Damisch <jasondamisch@yahoo.com> writes: > I thought that I'd ask... what the various trade-offs and advantages > are between 32 bit and 64 bit modes.... it seems to me that 32 VS 64 > has diminishing returns. Besides address space, 64 bits effectively gives more parallelism. Like if you're doing a memory block move without special instructions, doing it 8 bytes at a time is much faster than with 4. Similarly if you're doing wide arithmetic. On the other hand, 64-bit programs consume more memory because pointers are twice as wide, and (depending on language etc.) integers can be twice as wide too. > Maybe 40 bit would be ideal? People want general purpose computers to have convenient byte addressing these days, since they're often processing character data rather than numerics. So the word size is almost always a power of 2. You see sizes like 40 bits in specialized processors like DSPs where byte addressing isn't as important. > What reasons could there possibly be for having more than 4 GB of RAM? "640k ought to be enough for anyone..." ;-). More seriously, one obvious benefit on PC's is that you can run lots of programs simultaneously and still allot plenty of memory to each one. As for individual programs using GB's of ram, some programs like web browsers do it, but that's an artifact of the ram being available and therefore applications bloat up to use it. Other programs like databases make actual good use of the memory, though typically not on consumer desktops. It's certainly true that bigger computers let you solve bigger problems. I half-remember hearing OKAD could use up to a GB or so of ram when it had the whole GA144 chip design in memory at once. That's the most memory intensive Forth program I can think of other than artificial benchmarks, and of course it would use more with a bigger or more complicated chip. But in the benchmark category, Anton's program to find the 10^9th Hamming number used an 8GB table, iirc.
[toc] | [prev] | [next] | [standalone]
| From | Jason Damisch <jasondamisch@yahoo.com> |
|---|---|
| Date | 2016-05-27 13:22 -0700 |
| Message-ID | <2f9fcc23-150b-4755-b83a-25640aae2e00@googlegroups.com> |
| In reply to | #47574 |
On Friday, May 27, 2016 at 1:06:26 PM UTC-7, Paul Rubin wrote: > Besides address space, 64 bits effectively gives more parallelism. Like > if you're doing a memory block move without special instructions, doing > it 8 bytes at a time is much faster than with 4. Similarly if you're > doing wide arithmetic. Thanks for the input. Others?
[toc] | [prev] | [next] | [standalone]
| From | hughaguilar96@gmail.com |
|---|---|
| Date | 2016-05-27 13:59 -0700 |
| Message-ID | <789cf38e-a530-4a70-a97a-97dafe278685@googlegroups.com> |
| In reply to | #47575 |
On Friday, May 27, 2016 at 1:22:46 PM UTC-7, Jason Damisch wrote: > On Friday, May 27, 2016 at 1:06:26 PM UTC-7, Paul Rubin wrote: > > > Besides address space, 64 bits effectively gives more parallelism. Like > > if you're doing a memory block move without special instructions, doing > > it 8 bytes at a time is much faster than with 4. Similarly if you're > > doing wide arithmetic. > > Thanks for the input. Others? My language is 64-bit --- the stack is 64-bit wide and numbers are 64-bit --- addresses however are 32-bit and the whole thing must fit in 4GB.
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2016-05-28 10:07 +0000 |
| Message-ID | <2016May28.120710@mips.complang.tuwien.ac.at> |
| In reply to | #47571 |
Jason Damisch <jasondamisch@yahoo.com> writes:
>I admit not being the most adroit computer programmer or user
>in the world. So, I thought that I'd ask, if people don't mind
>too much, what the various trade-offs and advantages are between
>32 bit and 64 bit modes. For 16 bit VS 32 bit the advantages
>are obvious. But, it seems to me that 32 VS 64 has diminishing
>returns. Maybe 40 bit would be ideal? What reasons could there
>possibly be for having more than 4 GB of RAM?
For having more? Because you can afford it. I recently bought a
cheap CPU, motherboard, cooler, and RAM. I had to decide whether to
buy 4GB for something like EUR20 or 8GB for EUR30 to go with the EUR30
CPU and the EUR 46 mainboard. I decided to buy 8GB. And sizes are
growing over time: Moore's law in action.
For using more? For some applications, you don't need more, for
others, using more helps. E.g. the game Runes of Magic is a 32-bit
program that crashes if the RAM usage goes above about 1.6GB, even on
a machine with 16GB. If it was a 64-bit application, these crashes
probably would not happen. In-Memory databases are a big topic these
days, and they often use more than 4GB. Or, in the Forth world I used
more than 4GB for something quite a while ago (IIRC it was
<https://www.complang.tuwien.ac.at/forth/programs/sbpcp.fs>).
One can also benefit from having larger integers. Also dependent on
the application.
Finally, in the case of AMD64 and Aarch64, the 64-bit architectures
provide additional benefits, in particular, more registers than the
32-bit architecture. That was the main point of my original posting:
Gforth uses the additional registers on Aarch64 for better stack
caching, i.e., faster execution.
- 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 2016: http://www.euroforth.org/ef16/
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-05-28 19:09 -0700 |
| Message-ID | <87d1o5fwdw.fsf@jester.gateway.pace.com> |
| In reply to | #47583 |
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: > Or, in the Forth world I used > more than 4GB for something quite a while ago (IIRC it was > <https://www.complang.tuwien.ac.at/forth/programs/sbpcp.fs>). If that took more than 1MB or so, then something was terribly wrong ;). I think it was actually http://rosettacode.org/wiki/Hamming_numbers#Forth since I remember the discussion here.
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-05-28 20:00 -0700 |
| Message-ID | <878tytfu06.fsf@jester.gateway.pace.com> |
| In reply to | #47598 |
Paul Rubin <no.email@nospam.invalid> writes: > If that took more than 1MB or so, then something was terribly wrong ;). Oh nm, pi(100000) was just an example and it goes much higher, using more memory. Though getting up to GB's would likely take a long time. It looks like it has been computed with fancy algorithms up to 10**26: https://en.wikipedia.org/wiki/Prime-counting_function
[toc] | [prev] | [next] | [standalone]
| From | Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> |
|---|---|
| Date | 2016-05-29 17:46 +0000 |
| Message-ID | <slrnnkmeaq.8vc.albert@cherry.spenarnc.xs4all.nl> |
| In reply to | #47598 |
On 2016-05-29, Paul Rubin <no.email@nospam.invalid> wrote: > anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: >> Or, in the Forth world I used >> more than 4GB for something quite a while ago (IIRC it was >> <https://www.complang.tuwien.ac.at/forth/programs/sbpcp.fs>). > > If that took more than 1MB or so, then something was terribly wrong ;). > > I think it was actually > http://rosettacode.org/wiki/Hamming_numbers#Forth > since I remember the discussion here. No, that was Anton's "slightly better prime counting program" as an answer to my "yet another prime counting program". On 64 bits that program can use a couple of Gbytes. The larger the prime table to start with the faster it goes. It is probably worth dusting off, make it parallel. Groetjes Albert -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-05-29 11:27 -0700 |
| Message-ID | <871t4kg1o4.fsf@jester.gateway.pace.com> |
| In reply to | #47610 |
Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> writes: > On 64 bits that program can use a couple of Gbytes. The larger the > prime table to start with the faster it goes. Ok, fair enough. > It is probably worth dusting off, make it parallel. I'd be more interested in seeing better algorithms.
[toc] | [prev] | [next] | [standalone]
| From | Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> |
|---|---|
| Date | 2016-05-28 23:42 -0400 |
| Message-ID | <20160528234240.5c5664a5@_> |
| In reply to | #47571 |
On Fri, 27 May 2016 11:21:29 -0700 (PDT) Jason Damisch <jasondamisch@yahoo.com> wrote: > > In another thread Anton Ertl stated > > I have now access to an Odroid C2 running Ubuntu 16.04 in > > 64-bit mode often called AArch64, but Gforth calls it arm64) > > I admit not being the most adroit computer programmer or user > in the world. So, I thought that I'd ask, if people don't mind > too much, what the various trade-offs and advantages are between > 32 bit and 64 bit modes. For 16 bit VS 32 bit the advantages > are obvious. But, it seems to me that 32 VS 64 has diminishing > returns. 64-bit x86 provided more registers for 64-bit mode. They also made some changes to the way instructions address memory. I'm not up to date on this. Maybe a post to alt.lang.asm, alt.os.development, comp.lang.asm.x86, or comp.arch etc will yield more answers. From posts to some other groups where I only lurk, I thought Anton had done some 64-bit x86 work. > Maybe 40 bit would be ideal? ... > What reasons could there > possibly be for having more than 4 GB of RAM? Software just keeps becoming more bloated. E.g., on Linux 4GB is more than enough, as long as you don't run a web browser, which will slam your entire 4GB of memory in no time flat. Rod Pemberton
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.forth
csiph-web