现在虽说卖硬件的比不上卖软件的,卖软件的比不上卖服务的。但软件仍然是服务的基石。
而且不管是软件、硬件、还是服务,背后都是一行行的代码,以及基于这些代码所形成的软件功能、硬件系统、技术人员的经验等等。
这些代码有的用C/C++、Java、C#写,有的用PHP、JavaScript、Ruby写,有的用Verilog写。 Continue reading »

 

写这篇文章,是为了纠正上篇关于编译技术职业发展的帖子中自己的观点可能带来的误导。
尽量让面临硕士、博士选方向的学弟学妹了解编译知识在未来计算机技术职业生涯中的重要性,以及光明的未来方向。
Continue reading »

 

Pathscale刚刚发布了EKOPath4(http://www.pathscale.com/)

EKOPath4的新特性

  • Significant improvements in performance and robustness(性能健壮性)
  • Support for latest Intel® 64 & AMD64 processors(新处理器支持)
  • Support for SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4A & AVX(新SIMD扩展支持)
  • New C++ backend and GNU compatible runtime(新C++、GNU兼容的运行时库支持)
  • Complete implementation of C++ STL locale library(实现C++ STL本地库)
  • Reference counted basic_string using atomic locking
  • Thread-safety, including iostream and locale objects(线程安全提升)
  • Optimized exception handling(例外控制优化)
  • Optimized C and C++ debugging support(C/C++t调试支持优化)
  • More Fortran 2003 features(Fortran 2003支持)
  • Significantly improved IPA (inter-procedural analysis)(IPA分析提升)
  • Runtime improvements(运行时改进)
  • New PathAS assembler(新的PathAS汇编器)
  • Major overhaul of PathDB for better multi-core support
  • Hundreds of bug fixes and much more..

性能对比

高性能编译器最重要的是性能,Phoronix给出了针对某些例子的对比,EKOPath4.0的性能提升。如下,从这几个例子来看,EKOPath4.0的性能比GCC4.5高不少。

另外,Proronix也计划自己编译EKOPath编译器,并综合对比LLVM、EKOPath、GCC和Open64。《编译点滴》也会时刻关注,并第一时间刊登相关内容。

EKOPath4相关链接

  • 直接安装二进制版本Pathscale: http://c591116.r16.cf2.rackcdn.com/ekopath/nightly/Linux/ekopath-2011-06-12-installer.run
  • 编译器源码: git clone git://github.com/path64/compiler.git
  • 调试器(PathDB)源码  git clone git://github.com/path64/debugger.git

Pathscale简介

Pathscale是一家专注高性能编译器解决方案的公司,包括GPU和X86平台的高性能计算,以卖相关服务为主。CTO是Christopher Bergström。Fred Chow是技术方面的领导人。感兴趣的读者可以在#pathscale@freenode IRC上了解更多。 对于中国用户,Pathscale的CTO表示,如果感兴趣的人多,可以单独开#pathscale-cn频道服务,可以先在#pathscale IRC里和他说一声。   虽然EKOPath4自称开源,也的确能从上面的链接中找到编译器,调试器的源代码。但是也有人指出Pathscale一直承诺的开源兑现的力度很不够。下面的这段评论来自这里

Notes: Before continuing, yes, the open-sourcing of EKOPath 4 is what in recent days on Phoronix has been codenamed Dirndl as the results have been very impressive. Some Phoronix readers were sharp to figure it out within the forums and those following me on Twitter. Originally this open-source announcement was to happen two weeks ago, but since then there have been multiple delays for various reasons. While some Phoronix readers figured out EKOPath 4 was being open-sourced in advance, in some development circles this was already known for a number of days. Three weeks ago, Christopher Bergström (PathScale’s CTO), wrote to the Illumos development list and publicly dropped the EKOPath 4.0.10 binary and said "There will be a more broad and related announcement next week, but PathScale promises to continue providing EKOPath 4 as a free download for Solaris and family." On the Illumos IRC that day, the free EKOPath was again brought up. On a related note, back in April news broke that PathScale was working to develop a "CUDA killer" for the GPU. Back then it was promised it would be open-source and freely licensed.  

Open64和Pathscale的渊源

  • 2000年SGI将其 利用GPL协议MIPS Pro64编译器开源
  • 2001年University of Delaware 继续维护该编译器,并将其更名为Open64
  • 2001-2004年,计算所与Intel合作为安腾处理器基于Open64开发ORC项目,即Open Research Coompiler。
  • 2003年,Pathscale开始将该编译器移植到X86平台,并着手优化
  • 随后的几年里,Open64和Pathscale的代码相互移植了很多。
  • 最近,Pathscale升级到了GPLv3,而Open64还采用GPLv2,使得两者的代码越走越远
 

常谈的一个话题,没啥新意,这里只是做个简单总结。

宏只是编译器在预处理时做简单的字符串替换。当宏有参数时,和内联函数比较像,但尽量使用内联函数。

举几个例子说明:
1,宏中有条件判断时,要小心处理,容易出错。

#include 
#define MAX(a, b) \
if (a < b) \
cout << "Maximum is b:" << b << endl;
int main( void)
{
if (true)
MAX(20, 10)
else
cout << "Macro failed." << endl;
return 0;
}

Output:
Macro failed.

2,有自增自减时,要考虑到替换后,算符优先级问题。

#include 
#define MAX(a, b) cout << "The values are - a:" << a << " b:" << b << endl;
int main( void)
{
int a = 10;
int b = 10;
MAX(a++, b++);
return 0;
}

Output:
The values are - a:10 b:10

有参数时,不管内联还是宏,都是为了空间换时间,即通过赋值函数体,来换取函数调用带来的压栈、弹栈的性能开销。代价就是可执行程序变大。

2009-2011© 编译点滴 Suffusion theme by Sayontan Sinha

无觅相关文章插件,快速提升流量