编写高效的程序需要:1.选择合适的数据结构和算法 2.编译器能够有效优化以转换为高效可执行代码的源代码 3.利用并行性
优化编译器的局限性
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715152251967-1971961506.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715152312045-1011673758.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715152329826-1268754017.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715152351717-31461734.png)
程序示例:
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715154205154-731083274.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715154301592-1963592517.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715154219998-125794343.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715154242311-296351592.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715154314186-74087130.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715154409561-896188551.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715160159061-269106596.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715160413967-1571537788.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715160423514-952951857.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715160739123-1101183947.png)
combine3的汇编代码:
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715161344076-227572060.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715161423670-2126005279.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715161434920-1584616889.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715161558904-1320222312.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715161611529-842524475.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715163146561-1558213386.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160715163255607-223730760.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716111627342-428110661.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716112818342-1205681363.png)
load->mul load->mul
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716121843686-1724942101.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716122058795-1108145192.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716122821420-1071909495.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716122304170-436411210.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716122833264-817341764.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716122915998-393093666.png)
load load mul mul
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716124507139-523119612.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716124626092-1872456122.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716125333311-1129226787.png)
加载:从存储器读到寄存器 存储:从寄存器写到存储器
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716132244248-1097176712.png)
![](https://images2015.cnblogs.com/blog/817411/201607/817411-20160716132743373-851425255.png)
才能这种东西 本来就是靠自己挖掘创造的 我也不是什么天才 我只是比任何人都拼命工作 一步一个脚印走过来了 等我回头一看 背后没有一个身影 那帮懒惰的人在山脚念叨着 谁叫那家伙是天才 开什么玩笑 我最讨厌悠哉悠哉长大的慢性子 比我有时间 有精力 感情丰富的人 为什么比我懒惰 那就给我啊 要把这些东西都浪费掉的话 就通通给我 我还有很多很多想创造的东西 给我啊--------摘自《legal high II》 与诸君共勉