06.08.2013 Views

Threads in the new ISO C Standard from 2011

Threads in the new ISO C Standard from 2011

Threads in the new ISO C Standard from 2011

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Constant Propagation Example 3(3)<br />

Preserv<strong>in</strong>g <strong>the</strong> data dependency means lett<strong>in</strong>g <strong>the</strong> hardware know<br />

about <strong>the</strong>m.<br />

That can be done <strong>in</strong> different ways for different processors.<br />

One way is to <strong>in</strong>sert <strong>in</strong>structions so that <strong>the</strong>re will be a cha<strong>in</strong> of<br />

dependences for <strong>the</strong> processor pipel<strong>in</strong>e to see.<br />

Compilers thus must preserve such dependences <strong>in</strong> <strong>the</strong> complete<br />

program!<br />

Writ<strong>in</strong>g optimiz<strong>in</strong>g compilers C all of a sudden became twice as<br />

<strong>in</strong>terest<strong>in</strong>g.<br />

There is, however, a very simple first version implementation: treat all<br />

memory_order_consume as memory_order_acquire which<br />

automatically will order <strong>the</strong> memory accesses.<br />

Jonas Skeppstedt (js@cs.lth.se) Lecture 6 2013 44 / 70

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!