mathematica 发表于 2011-12-4 08:34:56

郭可以参考一下Prime95 version 26的代码

February 23, 2011. You may download version 26 now. Much of the FFT assembly code has been rewritten for better speed on newer CPU architectures. There are also many more FFT sizes supported. The net result is significantly faster test times for most users! To upgrade from version 25, simply exit Prime95, download the new version, and unzip the new version replacing the old version.

http://www.mersenne.org/

Software Source Code

If you use GIMPS source code to find Mersenne primes, you must agree to adhere to the GIMPS free software license agreement. Other than that restriction, you may use this code as you see fit.

The source code for the program is highly optimized Intel assembly language. There are many more-readable FFT algorithms available on the web and in textbooks. The program is also completely non-portable. If you are curious anyway, you can download all the source code (33.1MB). This file includes all the version 26.6 source code for Windows, Linux, FreeBSD, and Mac OS X. Last updated: April 8, 2011.

http://www.mersenne.org/freesoft/default.php

这个里面也有大整数乘法除法之类的,希望对你有用!有源代码的

G-Spider 发表于 2011-12-4 12:57:46

相当恐怖的汇编代码。

gxqcn 发表于 2011-12-4 20:00:52

我想我的汇编代码规模也会算是恐怖级的。:)

liangbch 发表于 2011-12-5 11:51:28

哈哈,我看了一下源码,没有想象中的恐怖。
源代码中的汇编文件为Intel格式,使用微软的ml来编译。对于linux平台, 使用
Agner Fog 提供的一个工具objconv 将微软格式的.lib文件转化为Linux格式的.a文件。
总共30个汇编文件,约914KB, 汇编文件源码(包含注释和空行在内)共23000多行。

G-Spider 发表于 2011-12-5 12:11:35

LS两位。:lol

wayne 发表于 2011-12-5 12:17:02

LS三位,:lol

liangbch 发表于 2011-12-5 18:40:18

没有仔细的看代码,把这套源码看简单了。这套源码中大量使用了MASM中的MACRO,大量的宏被定义在.mac文件中,而在.asm文件调用这些宏。大量的MACRO展开类似于循环展开,减少了比较和跳转语句,指令数却成倍的增加,这样就不难立即为什么源代码的行数并不大,而目标代码(比如gwnum.a,gwnum.lib达到26M多)却很大的原因了。

liangbch 发表于 2011-12-6 12:15:12

刚刚搜索了一下关于FFT优化的论文,找到一篇美国特拉华大学的几个教授在2007年发表的题为《Experience of Optimizing FFT on Intel Architectures》的论文,见 http://www.capsl.udel.edu/pub/doc/papers/POHLL2007-Daniel.pdf

其中的3位作者应该是华人,
xiaoming Li, 可能是李晓明,北京大学校长助理、教授、博士生导师
Xueping Li,可能是美国田纳西州 诺克斯维尔 大学的助理教授,见 http://web.utk.edu/~xli27/
Guang R. Gaom, 早年毕业于清华大学,见他的简历http://www.capsl.udel.edu/~ggao/cv_2011.pdf

G-Spider 发表于 2011-12-6 13:07:29

从PAPI的评估测试来看,FFTW各方面都很优秀。从PAPI_BR_CN和PAPI_BR_INS看出,做了更多的展开。
页: [1]
查看完整版本: 郭可以参考一下Prime95 version 26的代码