If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
freeBSD and compilers
I find for most applications the same is true of 32 bit. Fortunately x86 maintains multiple widths of working registers from 8 bits up, which can be taken good advantage of in some cases. For my work, probably half of my variable can be held in 8 bits. Probably 40% require 16 bits and less than 10% require more. The down side is when everything, including Boolean values default to 32 or 64 bits because that is the "natural" size of the registers. That is insanity! No, it isn't. It's often forgotten that beneath the high-level language abstractions there is a real processor executing machine instructions, and this is possibly a case in point. Treating 8-bit data as 32-bit is not insanity once one looks at how the CPUs actually work. For example, in the Intel Atom, there's a thing called load-to-store forwarding, which forwards the data from a store operation to a subsequent load operation, short-circuiting the cache, as long as they both have the same address and data size. If a program stores a boolean as a 32-bit word but then loads it as an 8-bit word, load-to-store forwarding won't trigger, and the program executes more slowly. This is far from the only consideration involving how the processor actually works when deciding what the object representation of a high-level language's boolean type should be. There are non-trivial issues of word tearing, misaligned access, and false sharing, as well. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FreeBSD on DL585 | Will | Compaq Computers | 6 | December 21st 05 08:36 AM |
FreeBSD on DL585 | Will | Compaq Servers | 6 | December 21st 05 08:36 AM |
New Intel compilers for x86-64 | Yousuf Khan | AMD x86-64 Processors | 7 | October 3rd 04 11:43 PM |
New Intel compilers for x86-64 | Yousuf Khan | General | 7 | October 3rd 04 11:43 PM |
New Intel compilers for x86-64 | Yousuf Khan | Intel | 1 | October 2nd 04 08:17 PM |