Welcome to HardwareForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

compiler and locality and cache write through policy

 
   Hardware Problem Solving Community! (Home) -> Chips RSS
Related Topics:
Intel compiler, was Intel x86-64 "near-identical" - Quote : I ran the binary that was compiled with the flag (-QxN) through iccOut, it was able to run on the FX51. Much to my surprise, it ran fine..

L1 cache disabled OR NOT? - I upgraded my old dell xps d 233Mhz with the powerleap 1.4 celeron cpu. It's working great on bios A09 and windows 98se at 933Mhz. One question then, at start up there is an two beep error message - error system cache - cache disabled! I just hit escape

Conroe L1 cache ?? - In the Core 2 Duo it plainly states "Two 16-KB Level 1 data and, in contrast to previous CPU from Intel, that's about all it says about L1 cache. There's no mention of TLB anywhere in the document. The Xeon..

external cache on an amd64 - ive recently had a thought and figured i would post here to see if it were mad or not. my is the amd has 3 links which can connect ram other slots or ever other to it. now i was wondering if it would be

Intel P4's: why so cheap on the L1 cache? - My old Athlon XP had 64KB + 64KB data L1 cache, why did Intel go so cheap and only include 16KB data and 12Ku-op on the P4's? Hell, even the K62's had 32KB + 32KB data w/their L1 cache!
Next:  Chips: 45nm Penryn (Core2Quad) hit by erratum too  
Author Message
ThierryBingo

External


Since: Dec 08, 2007
Posts: 1



(Msg. 1) Posted: Sat Dec 08, 2007 9:52 am
Post subject: compiler and locality and cache write through policy
Archived from groups: comp>sys>ibm>pc>hardware>chips, others (more info?)

hey,

I have two questions regarding the cache and code optimisation and
woul appreciate your help Smile

1- Do current compilers interchange nested loops order to minimise
page fault as well as cache fault? for instance if the arrays are
stored in row order, the following code

for (i = 0; i < 100; i++)
for (j = 0; j < 100; j++)
x[i][j] = x[i][j]+3;

will perform much better than

for (j = 0; j < 100; j++)
for (i = 0; i < 100; i++)
x[i][j] = x[i][j]+3;

do the current widely used compilers (c++, java) perform such
optimisation automatically?



2- Write Through on write HIT
according to Patterson book: with this policy the data is written in
the cache and the lower-level memory.

my first question if we have two levels caching. will the write be
done in L1, L2 and the physical DRAM or just L2 while using this
write policy?

my second question is related to the book evaluation to the technique.
he says that the processor will be held up on writes unless they are
buffered. I don't clearly understand what he means. my understanding
is that with this policy the data is sent to the cache AND the lower
memory level AT THE SAME TIME. no? if yes, how will this policy hold
the processor back ?unless he means that while writing the data to the
off chip memory the data bus is used and no data can be read from the
DRAM?



thanks for your help

 >> Stay informed about: compiler and locality and cache write through policy 
Back to top
Login to vote
Terje Mathisen

External


Since: Apr 17, 2004
Posts: 13



(Msg. 2) Posted: Sat Dec 08, 2007 3:00 pm
Post subject: Re: compiler and locality and cache write through policy [Login to view extended thread Info.]
Archived from groups: comp>sys>ibm>pc>hardware>chips, others (more info?)

ThierryBingo DeleteThis @googlemail.com wrote:
> hey,
>
> I have two questions regarding the cache and code optimisation and
> woul appreciate your help Smile
>
> 1- Do current compilers interchange nested loops order to minimise
> page fault as well as cache fault? for instance if the arrays are
> stored in row order, the following code
>
> for (i = 0; i < 100; i++)
> for (j = 0; j < 100; j++)
> x[i][j] = x[i][j]+3;
>
> will perform much better than
>
> for (j = 0; j < 100; j++)
> for (i = 0; i < 100; i++)
> x[i][j] = x[i][j]+3;
>
> do the current widely used compilers (c++, java) perform such
> optimisation automatically?

Some compilers do, depending upon exactly how the arrays have been
declared/allocated.

In particular, SUN/Sparc blew away one of the SPECint 2000 benchmarks by
determining such a convoluted set of prerequisites for doing this
particular optimization on dynamically allocated arrays that they
effectively only work on the benchmark code.

Terje

--
- <Terje.Mathisen DeleteThis @hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"

 >> Stay informed about: compiler and locality and cache write through policy 
Back to top
Login to vote
Display posts from previous:   
   Hardware Problem Solving Community! (Home) -> Chips All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]