上篇文章前瞻-主流处理器中的数据并行支持(SIMD)>和《前瞻-拿起SIMD的武器I》分别介绍了当今主流CPU中的SIMD扩展 ,以及前人是如何利用SIMD来做优化的,本文<前瞻-拿起SIMD的武器II>将探讨如何使用CPU的向量指令为程序做优化

如何实现?

编程环境

在现在CPU设计中都加入SIMD扩展并不是解决应用性能问题的好方法。如果没有很好的利用途径,再强大的SIMD扩展指令集都是徒劳。接下来,我们从编译器技术和编程方法论上探讨如何使用SIMD指令来实现应用加速。 Continue reading »

 

上篇文章前瞻-主流处理器中的数据并行支持(SIMD)》 介绍了当今主流CPU中的SIMD扩展,本文将介绍前人是物和利用SIMD来做优化的,下篇<前瞻-拿起SIMD的武器II>将探讨如何使用CPU的向量指令为程序做优化

已有在SIMD上的优化工作:

正如之前提到的,SIMD对具有以下特性的程序性能提升明显:天然数据并行,访存模式重复、在局部数据上重复操作、控制流数据无关。很多应用有这方面的特性,并能通过使用SIMD扩展提高性能,但实际仅有小部分从中获益,接下来将介绍在单核处理器上,利用Intel的SIMD扩展针对某些应用提升性能的研究,如多媒体,数据安全,数据库和一些科学计算应用。

多媒体处理

多媒体处理需要软件和硬件的很多支持。如MPEG-1,MPEG-2,MPEG-4,MPEG-7,H.263,JPEG2000等需要实时做复杂的媒体处理.3D图像和立体视频处理都需要更强劲的实时处理.因为各种媒体都需要不同的处理方式,技术支持、算法和硬件,因此针对他们的SIMD扩展改进也很不同。 Continue reading »

 

引言部分:

多媒体处理算法应用在很多媒体处理环境中,如对文本,手写数据,2D/3D图形和音频对象的捕捉、制造、存储和传输等。过去 都是使用昂贵的多媒体处理硬件协同工作来加速。现在,通用处理器通过在体系结构上增加媒体处理支持来减少使用协同处理器分配和返回带来的开销。在通用处理 器上一个基本的操作能同时作用多个元素的支持成为SIMD并行处理。通过SIMD扩展,通用护理器通过捕捉多媒体算法中潜在的并行特性来加速应用。

自 Intel在Pentium II和Pentium 处理器引入了MMX技术以来,IA-32架构已经引入了许多SIMD扩展,分别是:MMX,流SIMD扩展(SSE), 流SIMD扩展(SSE2)和流SIMD扩展(SSE3),SSSE3,SSE4和高级向量扩展(AVX).这些扩展都提供了一组指令,能够为封装好的整点或浮点数据提供SIMD类型的操作。其他结构也 有自己的SIMD扩展。如AMD的3DNow!,Cell和PowerPC的AltiVec等等。 Continue reading »
 

这两天在折腾小例子,用来表现对语言做某种扩展后将可更高效的编程。我那蹩脚的coding技术捉襟见肘。一个小例子要言简意赅,写在半页ppt里,要有对比,有突出,又要很直观。尝试了很多次。写小例子很能考察编程能力,指针,静态,数组,寄存器变量,各个类型长度等等。要达到瞄一眼就能印象深刻,被震撼的感觉,难!

眼见为实,看下面的小例子,简单的写个循环:

[code lang="cpp"]
ip (short int* fb, short int* bb,short int* res)
{
int i=0;
for (; i&lt; 8; i++)
res[i] = fb[i] + bb[i]+1;
}[/code]

在龙芯上用simd(单指令多数据,一条指令可以存多个数据)来实现的话,需要这么写,别忘了包含loongson.h头文件,这段代码在gcc4.3之后才支持: Continue reading »

 

反汇编器和汇编器是两个互逆的过程,后者将汇编源文件转换为机器码,前者将机器码转换成汇编语言。

汇编器通过将汇编指令符号转换为opcode和解析符号名为存储位置的形式创建目标代码,该目标代码就是机器码.其中符号解析是汇编器的关键部分.很多汇编器还提供宏支持来方便文本替换.相对于高层语言的编译器,汇编器简单很多.最早的汇编器出现在20世纪50年代,很多现代汇编其器都支持指令调度优化.Linux下使用最频繁的汇编器是gas,Gnu Assembler,因为它是GCC的默认后端,是Binutils的一部分。

反汇编器的输出通常是可读的汇编码格式,因此它时反向工程的重要工具。通常汇编语言允许常数和注释,但是在生成机器码时这些信息通常被删除,所以,在机器码上的反汇编操作只能产生无常数和注释的汇编码,所以程序员很难读懂,也很难转换为原来的高级代码。现在也有些编译器通过使用符号调试信息和交互式允许用户为特定区域的代码和值使用符号代替的方式来增强可读性。现在常见的反汇编器有:各种调试器都包含反汇编器,如GNU Binutils中的objdump就是gdb的交互式反汇编器,其他的还有PVDasm,一个支持多CPU反汇编器,OllyDbg–32位汇编级分析调试器,ILDASM–.NET Framework SDK中,用来反汇编PE文件等等

参考:

http://en.wikipedia.org/wiki/Assembly_language#Assembler

http://en.wikipedia.org/wiki/GNU_Assembler
http://en.wikipedia.org/wiki/Disassembler

 

这是gcc maillist中某国际友人 laurent@guerby.net 做的2个小时报告的ppt,报告题目为GCC Toulibre 20091216。最近一直想深入了解gcc,而这个ppt基本包含本博想了解的内容,所以将其翻译并分享到这里。翻译过程中,很多地方可能有错,请大家不吝赐教。原版的ppt见文末。

  • 什么是GCC

GCC–GNU Compiler Collection,即GNU 编译器集合。GCC即可作为本地编译器也能作为交叉编译器,它支持很多高级语言和多个编译和目标平台。GCC的网址 http://gcc.gnu.org.它是FSF基金会版权所有的自由软件. Continue reading »

 

SpiderMonkey is the JavaScript VM embedded in Mozilla firefox . TraceMonkey is a  scheme in SpiderMonkey to turn some JavaScript hot code to native instructions in order to make it run fast. It was been developed by Andreas Gal etc in mozilla and the paper about it was published on PLDI,2009. The paper was named :Trace-based Just-in-Time Type Specialization for Dynamic Languages.

TraceMonkey simply identifies loop back edges and do the optimization only on loops.  every loop back edge is a potential trace point.The loop becomes hot on its second iteration,so TraceMonkey records the code along the trace in a low-level compiler intermediate representation LIR(In Nanojit, LIR is the source language for compilation to machine code. LIR stands for low-level intermediate representation.) .TraceMonkey stops recording when execution returns to the loop header or exits the loop.After recording is finished,TraceMonkey compiles the trace to native code using the recorded type information for optimization.These code can be entered if the interpreter PC and the types of values match those observed when trace recording was started. Continue reading »

 

这是Fred chow 在德拉华大学所讲的open64课程讲稿的翻译。若需要原文ppt,请发邮件向我索取。
转载请注明出处: http://lingcc.com

Fred Chow 原版幻灯片见最后一页
1,历史:
1980-83 斯坦福大学RISC编译器研究
1987 MIPS Ucode编译器(R2000) -O2下的全局优化
1991 MIPS UCode编译器(R4000) -O3下的循环优化

另外:
1989 Cydrome Cydra5编译器 软流水优化
1994  SGI Ragnarok编译器(R8000) 浮点性能优化(Floating-pt performance?)

1997年SGI将上面两个分支连同斯坦福SUIF的工作,Rice的IPA整合在一起发布MIPSpro编译器(R10000)
2000年Pro64/Open64编译器(安腾)诞生

2,Open64大事记:
Continue reading »

 

zz from 真水无味    http://sysku.com/blog/post/357.html

微软XP系统下,部分开始运行经典命令
winver———检查Windows版本

wmimgmt.msc—-打开windows管理体系结构(WMI)

wupdmgr——–windows更新程序

wscript——–windows脚本宿主设置

write———-写字板

winmsd———系统信息

wiaacmgr——-扫描仪和照相机向导

winchat——–XP自带局域网聊天

mem.exe——–显示内存使用情况

Msconfig.exe—系统配置实用程序

mplayer2——-简易widnows media player

mspaint——–画图板

mstsc———-远程桌面连接

mplayer2——-媒体播放机

magnify——–放大镜实用程序

mmc————打开控制台

mobsync——–同步命令

dxdiag———检查DirectX信息

drwtsn32—— 系统医生

devmgmt.msc— 设备管理器

dfrg.msc——-磁盘碎片整理程序

diskmgmt.msc—磁盘管理实用程序

dcomcnfg——-打开系统组件服务

ddeshare——-打开DDE共享设置

dvdplay——–DVD播放器

net stop messenger—–停止信使服务

net start messenger—-开始信使服务

notepad——–打开记事本

nslookup——-网络管理的工具向导

ntbackup——-系统备份和还原

narrator——-屏幕“讲述人”

ntmsmgr.msc—-移动存储管理器

ntmsoprq.msc—移动存储管理员操作请求

netstat -an—-(TC)命令检查接口

syncapp——–创建一个公文包

sysedit——–系统配置编辑器

sigverif——-文件签名验证程序

sndrec32——-录音机

shrpubw——–创建共享文件夹

secpol.msc—–本地安全策略

syskey———系统加密,一旦加密就不能解开,保护windows xp系统的双重密码

services.msc—本地服务设置

Sndvol32——-音量控制程序

sfc.exe——–系统文件检查器

sfc /scannow—windows文件保护

tsshutdn——-60秒倒计时关机命令

tourstart——xp简介(安装完成后出现的漫游xp程序)

taskmgr——–任务管理器

eventvwr——-事件查看器

eudcedit——-造字程序

explorer——-打开资源管理器

packager——-对象包装程序

perfmon.msc—-计算机性能监测程序

progman——–程序管理器

regedit.exe—-注册

rsop.msc——-组策略结果集

regedt32——-注册表编辑器

rononce -p —-15秒关机

regsvr32 /u *.dll—-停止dll文件运行

regsvr32 /u zipfldr.dll——取消ZIP支持

cmd.exe——–CMD命令提示符

chkdsk.exe—–Chkdsk磁盘检查

certmgr.msc—-证书管理实用程序

calc———–启动计算器

charmap——–启动字符映射表

cliconfg——-SQL SERVER 客户端网络实用程序

Clipbrd——–剪贴板查看器

conf———–启动netmeeting

compmgmt.msc—计算机管理

cleanmgr——-垃圾整理

ciadv.msc——索引服务程序

osk————打开屏幕键盘

odbcad32——-ODBC数据源管理器

oobe/msoobe /a—-检查XP是否激活

lusrmgr.msc—-本机用户和组

logoff———注销命令

iexpress——-木马捆绑工具,系统自带

Nslookup——-IP地址侦测器

fsmgmt.msc—–共享文件夹管理器

utilman——–辅助工具管理器

gpedit.msc—–组策略

 

Mar. 25, 2008

Palamida, an open-source risk management company, believes in open source. But at the same time, its corporate code audits of more than 500 million lines of code has found time and again "specific open-source projects inside mission critical systems that had not been patched" with most recent updates.

Part of the problem? Many companies are unclear both about what programs they’re using, never mind when and how to update them.

As Palamida pointed out in a statement shared with Linux-Watch, "nine out of 10 open-source projects do not have commercial services behind them (such as Red Hat, Novell, etc.) that can push the updates as they appear." Besides that, even companies that do a good job of tracking their open-source software can miss things. Palamida gave an example of one company, which thought it was doing a good job, but it turned out that instead of using 300 open-source projects, they were actually using 835 programs.

The point? Even if you are using an open-source program, like the popular data compression library zlib which does a good job of patching problems, but you don’t know that you’re using zlib, how are you going to keep it up to date? Well, clearly, you’re not.

In the case of some of these programs, you may not actually have a problem. For example, if you’re running Linux from a major distributor such as Ubuntu, you don’t need to worry much about keeping OpenSSH, the secure shell remote control program, current. Ubuntu will do that for you.

On the other hand, Palamida pointed out that you may be using other open-source programs, such as Apache Geronimo, the open-source Java Enterprise Edition server, the BusyBox embedded tool kit or Freetype, a font-rendering engine, and you may be missing their updates.

So what do you do? According to Theresa Bui-Friday, co-founder of Palamida, in an e-mail interview, education comes first, "coupled with an in-house policy that is easy to understand and enforce. While many companies do a good job of tracking some of their open source through various means (from spreadsheets to e-mails), these methods aren’t able to capture the breadth and scope of actual open-source use. Thus, undocumented code is left in the code base which leaves the organization open to vulnerabilities. If you don’t know what you have, you don’t know if it needs patching and can’t effectively mitigate app sec risks."

Next, businesses should "implement an automated solution to regularly audit code." Palamida has several programs that can help with this.

These are IP Amplifier, which is a code-auditing tool and IP Authorizer, which helps ISVs (independent software vendors) make sure they’re using approved code with the right licenses.

For ISVs, "We recommend at each build as the software dev process is so dynamic and fluid. Additionally, once a process has been put into place, we recommend that companies adopt a means for developers to register their open-source code use by receiving approval to use a specific project, say, Zlib, and then downloading the ‘gold version’ of that project, the most stable, up-to-date version, and adding it to what we’ve termed the ‘Golden Vault’ of open source. These would be the approved projects, in their most stable form, collected in a database wherein all of your developers can quickly and easily go to retrieve what they need without trolling the Web for a version that might be vulnerable and might not be on the approved use list," explained Bui-Friday.

If a company is an ISV and facing an emergency, "such as product going to market and a serious flaw may have been found last minute, or an acquisition or a data breach has occurred and you’re trying to find out why," Bui-Friday said "bringing in professionals is the quickest and easiest way to perform a thorough code audit. Due to their high level of expertise and knowledge of the audit process, the professional services arm of our organization can do an audit in three weeks that may take a company three months to handle on [its] own."

"Ideally, though," Bui-Friday continued, "organizations will be equipped to handle audits and we recommend that they start with the applications that mean the most to them, i.e., the areas that cause the most financial, security and business strain if it’s not handled. You do not need to audit everything all at once. You need to prioritize based on business need. It’s important to have a policy in place that outlines regular and complete code audits."

When all is said and done, Bui-Friday said, "We want organizations to be able to do away with incomplete manual processes and protect themselves against app security risks."

While obviously Palamida has its own business interest here, the points the company makes are excellent ones. A company needs to track its open-source programs, both for its own sake and for the sake of its customers. Otherwise it will eventually face a serious operations problem without even being able to understand exactly where the underlying software problem lies.

Steven J. Vaughan-Nichols

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

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