LWN.net Logo

Nice jab at Emacs ;)

Nice jab at Emacs ;)

Posted Apr 24, 2003 1:27 UTC (Thu) by coriordan (guest, #7544)
Parent article: Opteron launches

> Building "cat" as a 64-bit application can only serve to make it bigger and
> slower. So a processor with native 32-bit support is a good thing.

Really? is someone sure about this?
'cat' only requires 16 bit ints. How come no-one ever compiles apps as 16-bit? How come GCC doesn't have a "compile as lower bit-width" optimisation? (or was someone just taking a wild guess? ;)

> ...applications which need to address vast amounts of memory (e.g., big
> scientific crankers, large databases, emacs) will benefit

Emacs ;)

...there was a time when this was true though. People mocking said it's name stood for "Eight Megabytes And Cycle Sucking". Eight Megabytes? cute, nowadays.

Ciaran O'Riordan


(Log in to post comments)

Hardly a useful optimization

Posted Apr 24, 2003 2:32 UTC (Thu) by proski (subscriber, #104) [Link]

How come GCC doesn't have a "compile as lower bit-width" optimisation?
This would have to be done across the board. Not just cat, but also libc would have to be recompiled. It int is 16-bit for an application and 32-bit for libc, such application would be unable to call libc functions without some kind of conversion of all data passed to and from those functions.

Another problem is that such optimization would be quite inefective on some architectures, including i386. You can have either 32-bit code that uses 32-bit and 8-bit registers, or 16-bit code that uses 16-bit and 8-bit registers. Using a 16-bit register in 32-bit code or vice versa requires a special instruction prefix.

Finally, there are very few applications that would benefit from such optimization. cat spends most time in libc and kernel. Any large program needs to address more than 64k. Programs doing heavy calculations with little code would still benefit from 32-bit bus width, given that the modern processors have on-die cache sufficient to keep the whole program and make memory access speed a non-issue.

Now, going from 32-bit to 64-bit is different because:

  1. Processors don't have 4Gb cache yet
  2. There is a lot you can do in 32-bit applications
  3. You can have a good 32-bit operating system
My guess is that that the transition is going to be more painful than going from 16-bit to 32-bit, and that there will be a lot of "partially 64-bit" software, including operating systems.

Nice jab at Emacs ;)

Posted Apr 24, 2003 2:33 UTC (Thu) by dlang (✭ supporter ✭, #313) [Link]

yes there are people who have looked at things like 'cat' in 32 bit and 64 bit mode. there have been discussions on this topic on the kernel mailing list a few times, this is in part why you can run the PPC with a 64 bit kernel and 32 bit userspace (and why people want to)

it turns out that if you have 64 bit kernel support simple tasks like cat really don't get any faster if you make cat 64 bit as well, and in some conditions actually make it slower due to the cache effects of the larger code

the Opteron is even better in that it appears to allow you to run a mixed 32/64 bit userspace so programs that don't benifit from the 64 bit mode can remain small while those that do can be compiled in 64 bit mode to gain the advantages

Opteron in 32 vs. 64 bit

Posted Apr 24, 2003 20:27 UTC (Thu) by josh_stern (guest, #4868) [Link]

When I looked at the specification of Opteron (some time ago), it
seemed that one had to use 64 bit code in order to get the advantage
of extra working registers (a significant shortage on 32 bit X86). Is
this still true, or has it been revised?

Opteron in 32 vs. 64 bit

Posted Apr 30, 2003 4:17 UTC (Wed) by emkey (guest, #144) [Link]

Its my understanding that you can only use the extra registers in 64 bit mode on the released opteron.

Nice jab at Emacs ;)

Posted Apr 24, 2003 8:02 UTC (Thu) by decaffeinated (guest, #4787) [Link]

As I recall, that's

Eight Megs And Continuously Swapping

Nice jab at Emacs ;)

Posted Apr 24, 2003 17:14 UTC (Thu) by JoeBuck (subscriber, #2330) [Link]

Right, the comment comes from the days when an 8Mb program was big and would continuously swap. But nowadays, Emacs is only a medium-sized program; Mozilla and many Gnome and KDE programs are a good deal bigger.

It's time to retire the slams against Emacs. They are out of date.

Nice jab at Emacs ;)

Posted Apr 24, 2003 9:18 UTC (Thu) by james (subscriber, #1325) [Link]

From the article:

Building "cat" as a 64-bit application can only serve to make it bigger and slower. So a processor with native 32-bit support is a good thing.

Actually, on the x86-64 architecture, the "slower" bit is dubious.

In 32 bit mode (which is designed to run existing binaries without modification), programs only have access to the x86's eight general purpose registers, and not all of these are really general purpose. In 64 bit mode, AMD have added an extra eight.

This means that x86-64 binaries have to load and store data to (usually cache) memory less often. This means that there are usually less instructions for the processor to decode.

It also means that compilers have more registers to play with when optimising. On the x86, there is often a limit to the amount of instruction-level parallelism that compliers can get out of source, simply because there aren't enough registers to spell out that several operations can happen at the same time. The extra eight registers are supposed to make this sort of optimisation a lot easier.

James.

Nice jab at Emacs ;)

Posted Apr 24, 2003 22:09 UTC (Thu) by jzbiciak (✭ supporter ✭, #5246) [Link]

You will trade instruction footprint for data footprint. Primarily, pointers will increase in size, but little else. In the end, it'll be close to a wash performance wise for most applications that aren't register starved (eg. cat), and a boost for anything with code that could use more registers.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds