mirror of
https://github.com/foxsen/archbase.git
synced 2026-04-14 02:29:45 +08:00
initial import to public repository
This commit is contained in:
13
materials/chapter1/flops_bandwidth.csv
Normal file
13
materials/chapter1/flops_bandwidth.csv
Normal file
@@ -0,0 +1,13 @@
|
||||
CPU,年代,主频,SIMD,GFLOPS,GB/s,含SIMD比例,无SIMD比例
|
||||
DEC Alpha 21264,1996,600MHz,-,1.2,2,0.6,0.6
|
||||
AMD K7 Athlon,1999,700MHz,-,1.4,1.6,0.88,0.88
|
||||
Intel Pentium III,1999,600MHz,-,0.6,0.8,0.75,0.75
|
||||
Intel Pentium IV,2001,1.5GHz,-,3,3.2,0.94,0.94
|
||||
Intel Core2 E6420 X2,2007,2.8GHz,128位,22.4,8.5,2.64,1.32
|
||||
AMD K10 Phenom II X4 955,2009,3.2GHz,128位,51.2,21.3,2.4,1.2
|
||||
Intel Nehalem X5560,2009,2.8GHz,128位,44.8,32,1.4,0.7
|
||||
IBM Power8,2014,5.0GHz,128位,480,230.4,2.08,1.04
|
||||
AMD Piledriver Fx8350,2014,4.0GHz,256位,128,29.9,4.29,1.07
|
||||
Intel Skylake E3-1230 V5,2015,3.4GHz,256位,217.6,34.1,6.38,1.6
|
||||
龙芯3A2000,2015,1.0GHz,-,16,16,1,1
|
||||
龙芯3A5000,2020,2.5GHz,256位,160.0,51.2,3.13,0.78
|
||||
|
22
materials/chapter1/program_and_data.csv
Normal file
22
materials/chapter1/program_and_data.csv
Normal file
@@ -0,0 +1,22 @@
|
||||
a,b,c,d
|
||||
100,3,,3
|
||||
101,4,,4
|
||||
102,5,,5
|
||||
103,7,,7
|
||||
104,,,12
|
||||
105,,,35
|
||||
106,,,47
|
||||
,……,,……
|
||||
200,读取100号单元,,读取100号单元
|
||||
201,读取101号单元,,读取101号单元
|
||||
202,两数相乘,,两数相乘
|
||||
203,存入结果到104号单元,,存入结果到104号单元
|
||||
204,读取102号单元,,读取102号单元
|
||||
205,读取103号单元,,读取103号单元
|
||||
206,两数相乘,,两数相乘
|
||||
207,存入结果到105号单元,,存入结果到105号单元
|
||||
208,读取104号单元,,读取104号单元
|
||||
209,读取105号单元,,读取105号单元
|
||||
210,两数相加,,两数相加
|
||||
211,存入结果到106号单元,,存入结果到106号单元
|
||||
,a),,b)
|
||||
|
29
materials/chapter1/spec_cpu2000.csv
Normal file
29
materials/chapter1/spec_cpu2000.csv
Normal file
@@ -0,0 +1,29 @@
|
||||
SPEC程序,运行时间/秒,分值,运行时间/秒1,分值1
|
||||
164.gzip,503,279,323,433
|
||||
175.vpr,389,360,222,632
|
||||
176.gcc,206,533,110,1003
|
||||
181.mcf,480,375,195,925
|
||||
186.crafty,166,604,122,822
|
||||
197.parser,707,254,266,676
|
||||
252.eon,159,815,141,924
|
||||
253.perlbmk,418,431,279,644
|
||||
254.gap,338,325,155,711
|
||||
255.vortex,291,652,125,1520
|
||||
256.bzip2,383,391,285,527
|
||||
300.twolf,421,712,364,824
|
||||
SPEC_INT2000,,447,,764
|
||||
168.wupwise,338,473,123,1296
|
||||
171.swim,1299,239,324,957
|
||||
172.mgrid,1045,172,169,1062
|
||||
173.applu,900,233,197,1067
|
||||
177.mesa,244,574,156,896
|
||||
178.galgel,507,572,143,2022
|
||||
179.art,173,1504,97,2686
|
||||
183.equake,457,285,96,1353
|
||||
187.facerec,288,659,146,1306
|
||||
188.ammp,538,409,274,803
|
||||
189.lucas,716,279,181,1104
|
||||
191.fma3d,550,382,203,1034
|
||||
200.sixtrack,553,199,276,399
|
||||
301.apsi,1159,224,235,1108
|
||||
SPEC_FP2000,,367,,1120
|
||||
|
9
materials/chapter10/MPI.c
Normal file
9
materials/chapter10/MPI.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "mpi.h"
|
||||
int main(int argc,char *argv[])
|
||||
{ int myid,count;
|
||||
MPI_Init(&agrc,&argv); /*启动计算*/
|
||||
MPI_Comm_size(MPI_COMM_WORLD,&count); /*获得进程总数*/
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &myid);/*获得自己进程号*/
|
||||
printf("I am %d of %d\n", myid,count); /*打印消息*/
|
||||
MPI_Finalize();/*结束计算*/
|
||||
}
|
||||
19
materials/chapter10/Makefile
Normal file
19
materials/chapter10/Makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
# 注意:为了保持生成的文件宽度相同,每个源文件最长的行应该都保持为80,不够的可以在某一行末尾添空格
|
||||
# 理论上各种Mono的字体应该都可以满足,但实际测试发现很多字体并不能保证生成的字符宽度一致。
|
||||
|
||||
%.c.png:%.c
|
||||
pygmentize -f png -O encoding=utf8,font_name='SimSun-ExtB',line_numbers=False -o $@ $<
|
||||
# pygmentize -f png -O encoding=utf8,font_name='Noto Sans Mono CJK SC',line_numbers=False $< -o $@
|
||||
|
||||
%.S.png:%.S
|
||||
pygmentize -f png -O encoding=utf8,font_name='SimSun-ExtB',line_numbers=False -o $@ $<
|
||||
# pygmentize -f png -O encoding=utf8,font_name='Noto Sans Mono CJK SC',line_numbers=False $< -o $@
|
||||
|
||||
%.txt.png:%.txt
|
||||
pygmentize -f png -O encoding=utf8,font_name='noto',line_numbers=False -o $@ $<
|
||||
|
||||
all:atomic.c.png barrier.c.png critical.c.png dataprallel.c.png for.c.png loongsonSIMD.S.png Makefile maritx_OpenMP.c.png martix_MPI.c.png master.c.png MPI.c.png paralle.c.png parallel_for.c.png parallel_sections.c.png pi_C.c.png pi_MPI.c.png pi_OpenMP.c.png pi_Pthreads.c.png Pthreads.c.png sections.c.png SIMD.S.png single.c.png taskparllel.c.png test4.c.png threadprivate.c.png tra_SIMD.c.png OpenMP_struct.c.png
|
||||
@echo 'done'
|
||||
|
||||
clean:
|
||||
rm -f *.png
|
||||
10
materials/chapter10/OpenMP_struct.c
Normal file
10
materials/chapter10/OpenMP_struct.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <omp.h>
|
||||
main(){
|
||||
int var1,var2,var3;
|
||||
…
|
||||
#pragma omp parallel private(var1,var2) shared(var3)
|
||||
{
|
||||
…
|
||||
}
|
||||
…
|
||||
}
|
||||
48
materials/chapter10/Pthreads.c
Normal file
48
materials/chapter10/Pthreads.c
Normal file
@@ -0,0 +1,48 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
#define NUM_THREADS 4 //假设线程数目为4
|
||||
#define n 1000
|
||||
double *A,*B,*C;
|
||||
void *matrixMult(void *id) {//计算矩阵乘
|
||||
int my_id = (int ) id;
|
||||
int i,j,k,start,end;
|
||||
//计算进程负责的部分
|
||||
start = my_id*(n/NUM_THREADS);
|
||||
if(my_id == NUMTHREADS-1)
|
||||
end = n;
|
||||
else
|
||||
end = start+(n/NUM_THREADS);
|
||||
|
||||
for(i=start;i<end;i++)
|
||||
for(j=0;j<n;j++)
|
||||
{
|
||||
C[i*n+j] = 0;
|
||||
for(k=0;k<n;k++)
|
||||
C[i*n+j]+=A[i*n+k]*B[k*n+j];
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
int i,j;
|
||||
pthread_t tids[NUM_THREADS];
|
||||
//分配数据空间
|
||||
A = (double *)malloc(sizeof(double)*n*n);
|
||||
B = (double *)malloc(sizeof(double)*n*n);
|
||||
C = (double *)malloc(sizeof(double)*n*n);
|
||||
//初始化数组
|
||||
for(i=0;i<n;i++)
|
||||
for(j=0;j<n;j++){
|
||||
A[i*n+j] = 1.0;
|
||||
B[i*n+j] = 1.0;
|
||||
}
|
||||
|
||||
for(i=0; i<NUM_THREADS; i++)
|
||||
pthread_create(&tids[i], NULL, matrixMult, (void *) i);
|
||||
|
||||
for(i=0; i<NUM_THREADS; i++)
|
||||
pthread_join(tids[i], NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
12
materials/chapter10/SIMD.S
Normal file
12
materials/chapter10/SIMD.S
Normal file
@@ -0,0 +1,12 @@
|
||||
li $4, 0x0
|
||||
li $5, 0x8
|
||||
daddu $src0, $4
|
||||
daddu $src1, $4
|
||||
daddu $result, $4
|
||||
lb $6, 0x0($src0)
|
||||
lb $7, 0x0($src1)
|
||||
daddu $6, $6, $7
|
||||
sb $6, 0x0($result)
|
||||
daddiu $4, 0x1
|
||||
blt $4, $5, 1b
|
||||
nop
|
||||
1
materials/chapter10/atomic.c
Normal file
1
materials/chapter10/atomic.c
Normal file
@@ -0,0 +1 @@
|
||||
#pragma omp atomic newline
|
||||
1
materials/chapter10/barrier.c
Normal file
1
materials/chapter10/barrier.c
Normal file
@@ -0,0 +1 @@
|
||||
#pragma omp barrier newline
|
||||
1
materials/chapter10/critical.c
Normal file
1
materials/chapter10/critical.c
Normal file
@@ -0,0 +1 @@
|
||||
#pragma omp critical[name] newline
|
||||
3
materials/chapter10/dataprallel.c
Normal file
3
materials/chapter10/dataprallel.c
Normal file
@@ -0,0 +1,3 @@
|
||||
for(i=0,i<N,i++){
|
||||
local[i] = (i+0.5)*w;
|
||||
}
|
||||
2
materials/chapter10/for.c
Normal file
2
materials/chapter10/for.c
Normal file
@@ -0,0 +1,2 @@
|
||||
#pragma omp for [private(list)| firstprivate(list)|lastprivate(list)| \
|
||||
reduction(reduction-identifier:list)|schedule(kind[,chunk_size])|collapse(n)|ordered| nowait] newline
|
||||
4
materials/chapter10/loongsonSIMD.S
Normal file
4
materials/chapter10/loongsonSIMD.S
Normal file
@@ -0,0 +1,4 @@
|
||||
gsldxc1 $f0, 0x0($src0, $0)
|
||||
gsldxc1 $f2, 0x0($src1, $0)
|
||||
paddb $f0, $f0, $f2
|
||||
gssdxc1 $f0, 0x0($result, $0)
|
||||
24
materials/chapter10/maritx_OpenMP.c
Normal file
24
materials/chapter10/maritx_OpenMP.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <omp.h>
|
||||
#define n 1000
|
||||
double A[n][n],B[n][n],C[n][n];
|
||||
|
||||
int main()
|
||||
{
|
||||
int i,j,k;
|
||||
//初始化矩阵A和矩阵B
|
||||
for(i=0;i<n;i++)
|
||||
for(j=0;j<n;j++) {
|
||||
A[i][j] = 1.0;
|
||||
B[i][j] = 1.0;
|
||||
}
|
||||
//并行计算矩阵C
|
||||
#pragma omp parallel for shared(A,B,C) private(i,j,k)
|
||||
for(i=0;i<n;i++)
|
||||
for(j=0;j<n;j++){
|
||||
C[i][j] = 0;
|
||||
for(k=0;k<n;k++)
|
||||
C[i][j]+=A[i][k]*B[k][j];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
58
materials/chapter10/martix_MPI.c
Normal file
58
materials/chapter10/martix_MPI.c
Normal file
@@ -0,0 +1,58 @@
|
||||
#include <stdio.h>
|
||||
#include "mpi.h"
|
||||
#define n 1000
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
double *A,*B,*C;
|
||||
int i,j,k;
|
||||
int ID,num_procs,line;
|
||||
MPI_Status status;
|
||||
|
||||
MPI_Init(&argc,&argv); //Initialize the MPI environment
|
||||
MPI_Comm_rank(MPI_COMM_WORLD,&ID);//获取当前进程号
|
||||
MPI_Comm_size(MPI_COMM_WORLD,&num_procs);//获取进程数目
|
||||
|
||||
//分配数据空间
|
||||
A = (double *)malloc(sizeof(double)*n*n);
|
||||
B = (double *)malloc(sizeof(double)*n*n);
|
||||
C = (double *)malloc(sizeof(double)*n*n);
|
||||
line = n/num_procs;//按进程数来划分数据
|
||||
|
||||
if(ID==0){ //节点0,主进程
|
||||
//初始化数组
|
||||
for(i=0;i<n;i++)
|
||||
for(j=0;j<n;j++){
|
||||
A[i*n+j] = 1.0;
|
||||
B[i*n+j] = 1.0;
|
||||
}
|
||||
//将矩阵A、B的相应数据发送给从进程
|
||||
for(i=1;i<num_procs;i++) {
|
||||
MPI_Send(B,n*n,MPI_DOUBLE,i,0,MPI_COMM_WORLD);
|
||||
MPI_Send(A+(i-1)*line*n,line*n,MPI_DOUBLE,i,1,MPI_COMM_WORLD);
|
||||
}
|
||||
//接收从进程计算结果
|
||||
for(i=1;i<num_procs;i++)
|
||||
MPI_Recv(C+(i-1)*line*n,line*n,MPI_DOUBLE,i,2,MPI_COMM_WORLD,&status);
|
||||
//计算剩下的数据
|
||||
for(i=(num_procs-1)*line;i<n;i++)
|
||||
for(j=0;j<n;j++) {
|
||||
C[i*n+j]=0;
|
||||
for(k=0;k<n;k++)
|
||||
C[i*n+j]+=A[i*n+k]*B[k*n+j];
|
||||
}
|
||||
} else {
|
||||
//其他进程接收数据,计算结果,发送给主进程
|
||||
MPI_Recv(B,n*n,MPI_DOUBLE,0,0,MPI_COMM_WORLD,&status);
|
||||
MPI_Recv(A+(ID-1)*line*n,line*n,MPI_DOUBLE,0,1,MPI_COMM_WORLD,&status);
|
||||
for(i=(ID-1)*line;i<ID*line;i++)
|
||||
for(j=0;j<n;j++) {
|
||||
C[i*n+j]=0;
|
||||
for(k=0;k<n;k++)
|
||||
C[i*n+j]+=A[i*n+k]*B[k*n+j];
|
||||
}
|
||||
MPI_Send(C+(num_procs-1)*line*n,line*n,MPI_DOUBLE,0,2,MPI_COMM_WORLD);
|
||||
}
|
||||
MPI_Finalize();
|
||||
Return 0;
|
||||
}
|
||||
|
||||
1
materials/chapter10/master.c
Normal file
1
materials/chapter10/master.c
Normal file
@@ -0,0 +1 @@
|
||||
#pragma omp master newline
|
||||
2
materials/chapter10/paralle.c
Normal file
2
materials/chapter10/paralle.c
Normal file
@@ -0,0 +1,2 @@
|
||||
#pragma omp parallel [if(scalar_expression)| num_threads(integer-expression)|default(shared|none)| private(list)| \
|
||||
firstprivate(list)|shared(list)| copyin(list) |reduction(operator:list)| proc_bind(master|close|spread)] newline
|
||||
6
materials/chapter10/parallel_for.c
Normal file
6
materials/chapter10/parallel_for.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma omp parallel for [if(scalar_expression)|num_threads(integer-expression|default(shared|none)| \
|
||||
private(list)|firstprivate(list)|lastprivate(list)|shared(list)|copyin(list)|reduction(Structured_block:list)| \
|
||||
proc_bind(master|close|spread)|schedule(kind[,chunk_size])|collapse(n)|ordered] newline
|
||||
For_loop{
|
||||
...
|
||||
}
|
||||
10
materials/chapter10/parallel_sections.c
Normal file
10
materials/chapter10/parallel_sections.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma omp parallel sections [if(scalar_expression)|num_threads(integer-expression)| \
|
||||
default(shared|none)|private(list)|firstprivate(list)|lastprivate(list)|shared(list)| \
|
||||
copyin(list)|reduction(Structured_block:list)|proc_bind(master|close|spread)]
|
||||
{
|
||||
[#progma omp section newline]
|
||||
Structured_block
|
||||
[#progma omp section newline
|
||||
Structured_block]
|
||||
......
|
||||
}
|
||||
18
materials/chapter10/pi_C.c
Normal file
18
materials/chapter10/pi_C.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
int main(){
|
||||
int i;
|
||||
int num_steps=1000000;
|
||||
double x,pi,step,sum=0.0;
|
||||
step = 1.0/(double) num_steps;
|
||||
|
||||
for(i=0;i<num_steps;i++){
|
||||
x=(i+0.5)*step;
|
||||
sum = sum+4.0/(1.0+x*x);
|
||||
}
|
||||
|
||||
pi = step*sum;
|
||||
printf("pi %1f\n", pi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
37
materials/chapter10/pi_MPI.c
Normal file
37
materials/chapter10/pi_MPI.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include “mpi.h”
|
||||
int main(int argc, char **argv){
|
||||
int num_steps=1000000;
|
||||
double x,pi,step,sum,sumallprocs;
|
||||
int i,start, end,temp;
|
||||
int ID,num_procs;//进程编号及组中的进程数量, 进程编号的范围为0到num_procs-1
|
||||
MPI_Status status;
|
||||
//Initialize the MPI environment
|
||||
MPI_Init(&argc,&argv);
|
||||
MPI_Comm_rank(MPI_COMM_WORLD,&ID);//
|
||||
MPI_Comm_size(MPI_COMM_WORLD,&num_procs);
|
||||
//任务划分并计算
|
||||
step = 1.0/num_steps;
|
||||
start = ID *(num_steps/num_procs) ;
|
||||
|
||||
if (ID == num_procs-1)
|
||||
end = num_steps;
|
||||
else
|
||||
end = start + num_steps/num_procs;
|
||||
|
||||
for(i=start; i<end;i++) {
|
||||
x=(i+0.5)*step;
|
||||
sum += 4.0/(1.0+x*x);
|
||||
}
|
||||
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
MPI_Reduce(&sum,&sumallprocs,1,MPI_DOUBLE,MPI_SUM,0, MPI_COMM_WORLD);
|
||||
|
||||
if(ID==0) {
|
||||
pi = sumallprocs*step;
|
||||
printf("pi %1f\n", pi);
|
||||
}
|
||||
|
||||
MPI_Finalize();
|
||||
return 0;
|
||||
}
|
||||
17
materials/chapter10/pi_OpenMP.c
Normal file
17
materials/chapter10/pi_OpenMP.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <omp.h>
|
||||
int main(){
|
||||
int i;
|
||||
int num_steps=1000000;
|
||||
double x,pi,step,sum=0.0;
|
||||
step = 1.0/(double) num_steps;
|
||||
#pragma omp parallel for private(i, x), reduction(+:sum)
|
||||
for(i=0;i<num_steps;i++)
|
||||
{
|
||||
x=(i+0.5)*step;
|
||||
sum = sum+4.0/(1.0+x*x);
|
||||
}
|
||||
pi = step*sum;
|
||||
printf("pi %1f\n", pi);
|
||||
return 0;
|
||||
}
|
||||
47
materials/chapter10/pi_Pthreads.c
Normal file
47
materials/chapter10/pi_Pthreads.c
Normal file
@@ -0,0 +1,47 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
#define NUM_THREADS 4 //假设线程数目为4
|
||||
int num_steps = 1000000;
|
||||
double step = 0.0, sum = 0.0;
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
void *countPI(void *id) {
|
||||
int index = (int ) id;
|
||||
int start = index*(num_steps/NUM_THREADS);
|
||||
int end;
|
||||
double x = 0.0, y = 0.0;
|
||||
if (index == NUM_THREADS-1)
|
||||
end = num_steps;
|
||||
else
|
||||
end = start+(num_steps/NUM_THREADS);
|
||||
|
||||
for (int i=start; i<end; i++){
|
||||
x=(i+0.5)*step;
|
||||
y +=4.0/(1.0+x*x);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
sum += y;
|
||||
pthread_mutex_unlock(&mutex);
|
||||
}
|
||||
|
||||
int main() {
|
||||
int i;
|
||||
double pi;
|
||||
step = 1.0 / num_steps;
|
||||
sum = 0.0;
|
||||
pthread_t tids[NUM_THREADS];
|
||||
pthread_mutex_init(&mutex, NULL);
|
||||
|
||||
for(i=0; i<NUM_THREADS; i++) {
|
||||
pthread_create(&tids[i], NULL, countPI, (void *) i);
|
||||
}
|
||||
for(i=0; i<NUM_THREADS; i++){
|
||||
pthread_join(tids[i], NULL);
|
||||
}
|
||||
pthread_mutex_destroy(&mutex);
|
||||
pi = step*sum;
|
||||
printf("pi %1f\n", pi);
|
||||
return 0;
|
||||
}
|
||||
8
materials/chapter10/sections.c
Normal file
8
materials/chapter10/sections.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma omp sections [private(list) |firstprivate(list)| \
|
||||
lastprivate(list)|reduction(reduction-identifier:list)|nowait] newline
|
||||
{
|
||||
[#pragma omp section newline]
|
||||
Structured_block
|
||||
[#pragma omp section newline
|
||||
Structured_block]
|
||||
}
|
||||
2
materials/chapter10/single.c
Normal file
2
materials/chapter10/single.c
Normal file
@@ -0,0 +1,2 @@
|
||||
#pragma omp single [private(list)|firstprivate(list)| copyprivate(list)|nowait] newline
|
||||
Structured_block
|
||||
5
materials/chapter10/taskparllel.c
Normal file
5
materials/chapter10/taskparllel.c
Normal file
@@ -0,0 +1,5 @@
|
||||
if(processor_ID="a") {
|
||||
task A;
|
||||
}else if (processor_ID="b"){
|
||||
Task B;
|
||||
}
|
||||
7
materials/chapter10/test4.c
Normal file
7
materials/chapter10/test4.c
Normal file
@@ -0,0 +1,7 @@
|
||||
If(mypid==0) {
|
||||
MPI_Bcast(buf0,count,type,0,comm,ierr);
|
||||
MPI_Send(buf1,count,type,1,tag,comm,ierr);
|
||||
} else {
|
||||
MPI_Recv(buf1,count,type,0,tag,comm,ierr);
|
||||
MPI_Bcast(buf0,count,type,0,comm,ierr);
|
||||
}
|
||||
1
materials/chapter10/threadprivate.c
Normal file
1
materials/chapter10/threadprivate.c
Normal file
@@ -0,0 +1 @@
|
||||
#pragma omp threadprivate(list)
|
||||
2
materials/chapter10/tra_SIMD.c
Normal file
2
materials/chapter10/tra_SIMD.c
Normal file
@@ -0,0 +1,2 @@
|
||||
for (i = 0; i < 8; i++)
|
||||
RESULT[i] = SRC0[i] + SRC1[i];
|
||||
7
materials/chapter11/cache_parameter.csv
Normal file
7
materials/chapter11/cache_parameter.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
⠀,IBM Power8,Intel Haswell,Oracle SPARC T5,龙芯3A5000
|
||||
每芯片核数,12,4,16,4
|
||||
每核线程数,8,2,8,1
|
||||
每核一级指令Cache,32KB,32KB,16KB,64KB
|
||||
每核一级数据Cache,64KB,32KB,16KB,64KB
|
||||
每核二级Cache,512KB,256KB,128 KB,256KB
|
||||
片上共享LLC,96MB,8MB,8MB,16MB
|
||||
|
32
materials/chapter12/2006brbandwidth.csv
Normal file
32
materials/chapter12/2006brbandwidth.csv
Normal file
@@ -0,0 +1,32 @@
|
||||
SPEC CPU2006,loongson 3A5000,zen1 r3-1200,skylake i3 9100f,zen1/3A5000,skylake/3A5000
|
||||
400.perlbench,1285.22,1330.7,1507.39,103.50%,117.30%
|
||||
401.bzip2,687.2,679.21,700.24,98.80%,101.90%
|
||||
403.gcc,528.81,625.04,726.01,118.20%,137.30%
|
||||
429.mcf,259.12,186.98,251.16,72.20%,96.90%
|
||||
445.gobmk,666.08,495.13,533.88,74.30%,80.20%
|
||||
456.hmmer,561.53,553.7,645.47,98.60%,114.90%
|
||||
458.sjeng,896.9,662.04,840.26,73.80%,93.70%
|
||||
462.libquantum,1109.34,1225.5,1380.07,110.50%,124.40%
|
||||
464.h264ref,370.65,468.73,483.39,126.50%,130.40%
|
||||
471.omnetpp,333.52,356.34,442.49,106.80%,132.70%
|
||||
473.astar,512.46,354.04,349.51,69.10%,68.20%
|
||||
483.xalancbmk,1045.16,963.92,1362.81,92.20%,130.40%
|
||||
SPECint_2006,615.94,576.2,667.59,93.50%,108.40%
|
||||
410.bwaves,106.04,112.99,94.37,106.60%,89.00%
|
||||
416.gamess,489.11,592.77,616.36,121.20%,126.00%
|
||||
433.milc,11.81,48.688,43.09,412.30%,364.90%
|
||||
434.zeusmp,171.28,101.7,88.22,59.40%,51.50%
|
||||
435.gromacs,130.19,174.94,158.7,134.40%,121.90%
|
||||
436.cactusADM,7.02,12.711,13.05,181.10%,185.90%
|
||||
437.leslie3d,134.2,300.84,208.51,224.20%,155.40%
|
||||
444.namd,239.86,234.96,260.51,98.00%,108.60%
|
||||
447.dealII,659.59,854.76,830.83,129.60%,126.00%
|
||||
450.soplex,386.41,462.08,514.6,119.60%,133.20%
|
||||
453.povray,738.4,889.04,1060.83,120.40%,143.70%
|
||||
454.calculix,233.14,351.24,352.48,150.70%,151.20%
|
||||
459.GemsFDTD,70.57,136.25,111.24,193.10%,157.60%
|
||||
465.tonto,409.28,426.25,513.51,104.10%,125.50%
|
||||
470.lbm,24.27,57.785,63.32,238.10%,260.90%
|
||||
481.wrf,323.44,460.5,504.5,142.40%,156.00%
|
||||
482.sphinx3,420.3,432.66,546.2,102.90%,130.00%
|
||||
SPECfp_2006,152.4,214.47,213.45,140.70%,140.10%
|
||||
|
32
materials/chapter12/2006brpercent.csv
Normal file
32
materials/chapter12/2006brpercent.csv
Normal file
@@ -0,0 +1,32 @@
|
||||
SPEC CPU2006,loongson 3A5000,zen1 r3-1200,Skylake i3 9100f
|
||||
400.perlbench,20.30%,22.00%,22.10%
|
||||
401.bzip2,14.80%,15.80%,16.70%
|
||||
403.gcc,19.30%,21.10%,25.70%
|
||||
429.mcf,32.50%,22.80%,22.30%
|
||||
445.gobmk,18.80%,18.90%,19.20%
|
||||
456.hmmer,7.60%,8.50%,9.80%
|
||||
458.sjeng,19.80%,20.00%,19.90%
|
||||
462.libquantum,31.70%,29.50%,29.50%
|
||||
464.h264ref,5.50%,6.90%,9.00%
|
||||
471.omnetpp,25.10%,25.30%,24.30%
|
||||
473.astar,23.20%,18.00%,18.10%
|
||||
483.xalancbmk,30.10%,29.80%,29.90%
|
||||
SPECint_2006,18.50%,18.40%,19.30%
|
||||
410.bwaves,3.00%,2.40%,2.70%
|
||||
416.gamess,6.60%,8.30%,8.60%
|
||||
433.milc,1.20%,2.10%,2.10%
|
||||
434.zeusmp,4.90%,1.60%,2.70%
|
||||
435.gromacs,4.00%,3.00%,3.00%
|
||||
436.cactusADM,0.20%,0.20%,0.60%
|
||||
437.leslie3d,5.90%,4.70%,16.60%
|
||||
444.namd,5.80%,5.40%,5.40%
|
||||
447.dealII,17.50%,19.30%,19.60%
|
||||
450.soplex,18.60%,19.30%,20.80%
|
||||
453.povray,14.40%,16.80%,16.40%
|
||||
454.calculix,5.60%,6.00%,6.70%
|
||||
459.GemsFDTD,3.20%,3.10%,7.60%
|
||||
465.tonto,7.00%,6.10%,10.00%
|
||||
470.lbm,1.30%,1.40%,1.40%
|
||||
481.wrf,7.80%,9.70%,11.40%
|
||||
482.sphinx3,11.10%,12.00%,11.10%
|
||||
SPECfp_2006,4.60%,4.50%,5.90%
|
||||
|
32
materials/chapter12/2006brpred.csv
Normal file
32
materials/chapter12/2006brpred.csv
Normal file
@@ -0,0 +1,32 @@
|
||||
SPEC CPU2006,loongson 3A5000,zen1 r3-1200,skylake i3 9100f,zen1/3A5000,skylake/3A5000
|
||||
400.perlbench,1.18%,1.10%,0.71%,0.93,0.6
|
||||
401.bzip2,5.38%,5.08%,4.94%,0.94,0.92
|
||||
403.gcc,1.52%,1.31%,1.03%,0.86,0.68
|
||||
429.mcf,5.62%,3.57%,3.86%,0.64,0.69
|
||||
445.gobmk,8.29%,9.80%,8.56%,1.18,1.03
|
||||
456.hmmer,1.12%,0.66%,0.65%,0.59,0.58
|
||||
458.sjeng,4.47%,5.89%,4.17%,1.32,0.93
|
||||
462.libquantum,0.79%,0.21%,0.09%,0.27,0.11
|
||||
464.h264ref,2.09%,1.64%,1.69%,0.78,0.81
|
||||
471.omnetpp,2.53%,1.65%,1.83%,0.65,0.72
|
||||
473.astar,13.60%,12.03%,12.75%,0.88,0.94
|
||||
483.xalancbmk,0.43%,0.51%,0.34%,1.19,0.79
|
||||
SPECint_2006,2.48%,1.97%,1.64%,0.79,0.66
|
||||
410.bwaves,0.09%,0.25%,0.15%,2.78,1.67
|
||||
416.gamess,0.94%,1.07%,0.69%,1.14,0.73
|
||||
433.milc,6.58%,0.40%,0.23%,0.06,0.03
|
||||
434.zeusmp,1.38%,0.95%,0.12%,0.69,0.09
|
||||
435.gromacs,7.04%,6.19%,6.11%,0.88,0.87
|
||||
436.cactusADM,0.33%,1.49%,0.17%,4.52,0.52
|
||||
437.leslie3d,0.33%,1.66%,0.22%,5.03,0.67
|
||||
444.namd,4.66%,4.38%,4.52%,0.94,0.97
|
||||
447.dealII,2.48%,2.31%,2.06%,0.93,0.83
|
||||
450.soplex,5.51%,4.22%,4.40%,0.77,0.8
|
||||
453.povray,1.86%,1.30%,0.56%,0.7,0.3
|
||||
454.calculix,3.23%,2.80%,3.02%,0.87,0.93
|
||||
459.GemsFDTD,0.29%,0.40%,0.10%,1.38,0.34
|
||||
465.tonto,1.20%,0.93%,0.91%,0.78,0.76
|
||||
470.lbm,0.46%,0.45%,0.38%,0.98,0.83
|
||||
481.wrf,1.08%,0.51%,0.24%,0.47,0.22
|
||||
482.sphinx3,2.35%,1.80%,1.88%,0.77,0.8
|
||||
SPECfp_2006,1.30%,1.24%,0.65%,0.95,0.5
|
||||
|
32
materials/chapter12/2006insts.csv
Normal file
32
materials/chapter12/2006insts.csv
Normal file
@@ -0,0 +1,32 @@
|
||||
SPEC CPU2006,loongson 3A5000,zen1 r3-1200,Skylake i3 9100f,zen1/3A5000,skylake/3A5000
|
||||
400.perlbench,"2,120,668","1,893,315","1,875,825",89.30%,88.50%
|
||||
401.bzip2,"2,598,456","2,230,210","2,105,917",85.80%,81.00%
|
||||
403.gcc,"918,503","720,416","637,262",78.40%,69.40%
|
||||
429.mcf,"270,116","273,830","279,889",101.40%,103.60%
|
||||
445.gobmk,"1,447,758","1,364,925","1,349,346",94.30%,93.20%
|
||||
456.hmmer,"1,725,941","1,293,236","1,140,944",74.90%,66.10%
|
||||
458.sjeng,"2,448,077","2,256,035","2,259,544",92.20%,92.30%
|
||||
462.libquantum,"1,287,345","1,354,349","1,355,304",105.20%,105.30%
|
||||
464.h264ref,"3,906,022","3,057,443","2,574,503",78.30%,65.90%
|
||||
471.omnetpp,"455,925","515,436","535,127",113.10%,117.40%
|
||||
473.astar,"804,288","862,191","855,804",107.20%,106.40%
|
||||
483.xalancbmk,"845,446","857,273","858,951",101.40%,101.60%
|
||||
SPECint_2006,"18,828,544","16,678,659","15,828,415",88.60%,84.10%
|
||||
410.bwaves,"867,049","643,946","563,805",74.30%,65.00%
|
||||
416.gamess,"6,326,795","4,818,900","4,737,215",76.20%,74.90%
|
||||
433.milc,"495,564","573,026","562,614",115.60%,113.50%
|
||||
434.zeusmp,"1,255,758","901,519","682,460",71.80%,54.30%
|
||||
435.gromacs,"1,523,919","1,606,588","1,621,933",105.40%,106.40%
|
||||
436.cactusADM,"1,059,689","913,079","460,976",86.20%,43.50%
|
||||
437.leslie3d,"586,968","663,348","350,522",113.00%,59.70%
|
||||
444.namd,"1,602,845","1,630,103","1,627,678",101.70%,101.50%
|
||||
447.dealII,"1,078,354","1,048,560","1,029,969",97.20%,95.50%
|
||||
450.soplex,"588,538","562,087","535,320",95.50%,91.00%
|
||||
453.povray,"715,602","816,008","838,778",114.00%,117.20%
|
||||
454.calculix,"1,941,778","1,615,746","1,473,997",83.20%,75.90%
|
||||
459.GemsFDTD,"773,507","832,552","471,723",107.60%,61.00%
|
||||
465.tonto,"2,028,792","2,212,799","1,674,174",109.10%,82.50%
|
||||
470.lbm,"877,312","817,999","821,754",93.20%,93.70%
|
||||
481.wrf,"1,437,760","953,405","794,095",66.30%,55.20%
|
||||
482.sphinx3,"2,229,029","1,850,550","1,867,714",83.00%,83.80%
|
||||
SPECfp_2006,"25,389,259","22,460,213","20,114,726",88.50%,79.20%
|
||||
|
32
materials/chapter12/2006ipc.csv
Normal file
32
materials/chapter12/2006ipc.csv
Normal file
@@ -0,0 +1,32 @@
|
||||
SPEC CPU2006,loongson 3A5000,zen1 r3-1200,skylake i3 9100f,zen1/3A5000,skylake/3A5000
|
||||
400.perlbench,2.54,2.45,2.72,96.50%,107.10%
|
||||
401.bzip2,1.86,1.73,1.68,93.00%,90.30%
|
||||
403.gcc,1.1,1.1,1.22,100.00%,110.90%
|
||||
429.mcf,0.32,0.33,0.45,103.10%,140.60%
|
||||
445.gobmk,1.42,1.05,1.12,73.90%,78.90%
|
||||
456.hmmer,2.97,2.57,2.68,86.50%,90.20%
|
||||
458.sjeng,1.81,1.33,1.68,73.50%,92.80%
|
||||
462.libquantum,1.42,1.67,1.88,117.60%,132.40%
|
||||
464.h264ref,2.69,2.5,2.38,92.90%,88.50%
|
||||
471.omnetpp,0.54,0.57,0.73,105.60%,135.20%
|
||||
473.astar,0.89,0.79,0.77,88.80%,86.50%
|
||||
483.xalancbmk,1.4,1.3,1.84,92.90%,131.40%
|
||||
SPECint_rate2006,1.34,1.24,1.4,92.90%,105.00%
|
||||
410.bwaves,1.42,1.9,1.41,133.80%,99.30%
|
||||
416.gamess,2.97,2.82,2.92,94.90%,98.30%
|
||||
433.milc,0.4,0.97,0.81,242.50%,202.50%
|
||||
434.zeusmp,1.39,2.01,1.68,144.60%,120.90%
|
||||
435.gromacs,1.31,2.32,2.13,177.10%,162.60%
|
||||
436.cactusADM,1.79,1.72,1.44,96.10%,80.40%
|
||||
437.leslie3d,0.91,1.38,0.93,151.60%,102.20%
|
||||
444.namd,1.66,1.75,1.94,105.40%,116.90%
|
||||
447.dealII,1.52,1.79,1.7,117.80%,111.80%
|
||||
450.soplex,0.84,0.94,1.02,111.90%,121.40%
|
||||
453.povray,2.06,2.12,2.6,102.90%,126.20%
|
||||
454.calculix,1.66,2.3,2.16,138.60%,130.10%
|
||||
459.GemsFDTD,0.88,1.27,0.82,144.30%,93.20%
|
||||
465.tonto,2.33,2.27,2.53,97.40%,108.60%
|
||||
470.lbm,0.74,1.62,1.79,218.90%,241.90%
|
||||
481.wrf,1.67,1.95,1.73,116.80%,103.60%
|
||||
482.sphinx3,1.52,1.55,1.85,102.00%,121.70%
|
||||
SPECfp_rate2006,1.34,1.73,1.62,129.70%,121.00%
|
||||
|
32
materials/chapter12/2006rate4.csv
Normal file
32
materials/chapter12/2006rate4.csv
Normal file
@@ -0,0 +1,32 @@
|
||||
CPU2006 rate4,loongson 3A5000,Zen1 r3-1200,skylake i3 9100f,zen1/3A5000,skylake/3A5000
|
||||
400.perlbench,102,125,136,122.50%,133.30%
|
||||
401.bzip2,64.4,69.6,67.7,108.10%,105.10%
|
||||
403.gcc,75.5,107,121,141.70%,160.30%
|
||||
429.mcf,50.5,81.3,88.3,161.00%,174.90%
|
||||
445.gobmk,95.8,79.7,85.4,83.20%,89.10%
|
||||
456.hmmer,128,184,214,143.80%,167.20%
|
||||
458.sjeng,86,71.3,89.2,82.90%,103.70%
|
||||
462.libquantum,89.2,154,121,172.60%,135.70%
|
||||
464.h264ref,147,178,201,121.10%,136.70%
|
||||
471.omnetpp,45,54.8,60,121.80%,133.30%
|
||||
473.astar,58.6,57.1,55.9,97.40%,95.40%
|
||||
483.xalancbmk,68.6,90.2,111,131.50%,161.80%
|
||||
SPECint2006,79.39,95.99,103.16,120.90%,129.90%
|
||||
410.bwaves,82.1,210,152,255.80%,185.10%
|
||||
416.gamess,84.8,114,119,134.40%,140.30%
|
||||
433.milc,44.6,103,83.2,230.90%,186.50%
|
||||
434.zeusmp,83.6,179,190,214.10%,227.30%
|
||||
435.gromacs,58.3,103,92.2,176.70%,158.10%
|
||||
436.cactusADM,114,193,256,169.30%,224.60%
|
||||
437.leslie3d,68.3,114,96,166.90%,140.60%
|
||||
444.namd,80,85.8,94.7,107.30%,118.40%
|
||||
447.dealII,142,187,176,131.70%,123.90%
|
||||
450.soplex,62.9,99,101,157.40%,160.60%
|
||||
453.povray,149,136,155,91.30%,104.00%
|
||||
454.calculix,62,116,118,187.10%,190.30%
|
||||
459.GemsFDTD,53.4,98.2,80.7,183.90%,151.10%
|
||||
465.tonto,106,98.7,136,93.10%,128.30%
|
||||
470.lbm,51.1,99.4,87.3,194.50%,170.80%
|
||||
481.wrf,92.1,175,164,190.00%,178.10%
|
||||
482.sphinx3,81.3,125,139,153.80%,171.00%
|
||||
SPECfp2006,78.65,126.28,124.86,160.60%,158.80%
|
||||
|
32
materials/chapter12/2006speed-nopara.csv
Normal file
32
materials/chapter12/2006speed-nopara.csv
Normal file
@@ -0,0 +1,32 @@
|
||||
SPEC CPU2006,loongson 3A5000,zen1 r3-1200,skylake i3 9100f,zen1/3A5000,skylake/3A5000
|
||||
400.perlbench,28.9,31.2,35.2,108.00%,121.80%
|
||||
401.bzip2,17.2,18.7,19.2,108.70%,111.60%
|
||||
403.gcc,23.8,30.8,38.4,129.40%,161.30%
|
||||
429.mcf,26.9,27.5,36.3,102.20%,134.90%
|
||||
445.gobmk,25.5,20,21.6,78.40%,84.70%
|
||||
456.hmmer,39.2,46.2,54.3,117.90%,138.50%
|
||||
458.sjeng,22.2,17.8,22.5,80.20%,101.40%
|
||||
462.libquantum,54.6,63.6,72,116.50%,131.90%
|
||||
464.h264ref,37.9,45.1,51,119.00%,134.60%
|
||||
471.omnetpp,18,17.2,21,95.60%,116.70%
|
||||
473.astar,19.1,15.4,15.8,80.60%,82.70%
|
||||
483.xalancbmk,28.1,26,36.8,92.50%,131.00%
|
||||
SPECint2006,26.86,27.15,31.91,101.10%,118.80%
|
||||
410.bwaves,54.8,98.9,85.4,180.50%,155.80%
|
||||
416.gamess,22.2,28.6,30.2,128.80%,136.00%
|
||||
433.milc,17.9,38.4,32.4,214.50%,181.00%
|
||||
434.zeusmp,24.6,51,56.3,207.30%,228.90%
|
||||
435.gromacs,15.2,25.8,23.2,169.70%,152.60%
|
||||
436.cactusADM,52,58.6,93.1,112.70%,179.00%
|
||||
437.leslie3d,36.2,48.3,62.3,133.40%,172.10%
|
||||
444.namd,20.6,21.5,23.8,104.40%,115.50%
|
||||
447.dealII,39.7,48.6,46.7,122.40%,117.60%
|
||||
450.soplex,28.6,34.7,39.4,121.30%,137.80%
|
||||
453.povray,38.1,34.1,40.9,89.50%,107.30%
|
||||
454.calculix,17.6,29.3,30.2,166.50%,171.60%
|
||||
459.GemsFDTD,29.8,40.2,45.7,134.90%,153.40%
|
||||
465.tonto,28.1,25.2,37.1,89.70%,132.00%
|
||||
470.lbm,28.5,66.8,74.8,234.40%,262.50%
|
||||
481.wrf,32.1,56.8,64.9,176.90%,202.20%
|
||||
482.sphinx3,33.5,40.8,48.6,121.80%,145.10%
|
||||
SPECfp2006,28.72,40.69,45.2,141.70%,157.30%
|
||||
|
32
materials/chapter12/2006speed.csv
Normal file
32
materials/chapter12/2006speed.csv
Normal file
@@ -0,0 +1,32 @@
|
||||
SPEC CPU2006,loongson 3A5000,zen1 r3-1200,skylake i3 9100f,zen1/3A5000,skylake/3A5000
|
||||
400.perlbench,29.1,31.4,35.3,107.90%,121.30%
|
||||
401.bzip2,17.3,18.5,19.2,106.90%,111.00%
|
||||
403.gcc,23.9,30.8,38.1,128.90%,159.40%
|
||||
429.mcf,27.1,27.6,37,101.80%,136.50%
|
||||
445.gobmk,25.6,20.1,21.7,78.50%,84.80%
|
||||
456.hmmer,39.2,46.2,54.7,117.90%,139.50%
|
||||
458.sjeng,22.4,17.8,22.5,79.50%,100.40%
|
||||
462.libquantum,78.8,141,123,178.90%,156.10%
|
||||
464.h264ref,38,45.1,51,118.70%,134.20%
|
||||
471.omnetpp,18.1,17.2,21.2,95.00%,117.10%
|
||||
473.astar,19.3,15.6,15.8,80.80%,81.90%
|
||||
483.xalancbmk,28.7,25.9,36.9,90.20%,128.60%
|
||||
SPECint2006,27.87,29.05,33.47,104.20%,120.10%
|
||||
410.bwaves,54.4,99.1,85.2,182.20%,156.60%
|
||||
416.gamess,22.9,28.4,30.2,124.00%,131.90%
|
||||
433.milc,18,38.8,32.3,215.60%,179.40%
|
||||
434.zeusmp,25,51,56.2,204.00%,224.80%
|
||||
435.gromacs,15.3,25.8,23.5,168.60%,153.60%
|
||||
436.cactusADM,84.8,135,228,159.20%,268.90%
|
||||
437.leslie3d,36.2,48.2,62.8,133.10%,173.50%
|
||||
444.namd,20.7,21.5,23.8,103.90%,115.00%
|
||||
447.dealII,39.8,48.7,46.7,122.40%,117.30%
|
||||
450.soplex,28.5,34.6,39.8,121.40%,139.60%
|
||||
453.povray,39.1,34.2,41.5,87.50%,106.10%
|
||||
454.calculix,17.6,29.2,30.1,165.90%,171.00%
|
||||
459.GemsFDTD,35.2,65.1,56.7,184.90%,161.10%
|
||||
465.tonto,28.4,25.2,37.2,88.70%,131.00%
|
||||
470.lbm,28.8,67.5,74.6,234.40%,259.00%
|
||||
481.wrf,36.5,53.9,65,147.70%,178.10%
|
||||
482.sphinx3,34.1,40.6,48.4,119.10%,141.90%
|
||||
SPECfp2006,30.29,43.85,48.34,144.80%,159.60%
|
||||
|
37
materials/chapter12/AMDTest.csv
Normal file
37
materials/chapter12/AMDTest.csv
Normal file
@@ -0,0 +1,37 @@
|
||||
测试程序,指标,性能,分值
|
||||
World of Padman v1.2,每秒帧数(FPS),越大越好,177.33
|
||||
H.264 v2015-11-02,每秒帧数(FPS),越大越好,101.97
|
||||
"GraphicsMagic v1.3.12
|
||||
HWB Color Space",每分钟迭代次数,越大越好,108
|
||||
"John The Ripper v1.7.9
|
||||
Traditional DES",每秒破解的数目,越大越好,5174833
|
||||
"John The Ripper v1.7.9
|
||||
Blowfish",每秒破解的数目,越大越好,1970
|
||||
TTSIOD 3D Renderer v2.2w,每秒帧数(FPS),越大越好,39.01
|
||||
Parallel BZIP2 Compression v1.0.5,秒数,越小越好,27.98
|
||||
"7-ZIP Compression v9.20.1
|
||||
Compress Speed Test",MIPS,越大越好,7242
|
||||
"LAME MP3 Encoding v3.99.3
|
||||
WAV to MP#",秒数,越小越好,22.86
|
||||
"x264 v2011-12-06
|
||||
H.264 Video Encoding",每秒帧数(FPS),越大越好,54.04
|
||||
"FFmpeg v0.10
|
||||
AVI to NTSC VCD",秒数,越小越好,17.57
|
||||
"OpenSSL v1.0.0e
|
||||
RSA 4096-bit",每秒签名数,越大越好,58.58
|
||||
"Himeno Benchmark v3.0
|
||||
Poisson pressure solver",MFLOPS,越大越好,516.47
|
||||
"PostgreSQL pgbench v8.4.11
|
||||
TPC-B transaction per second",TPS,越大越好,427.13
|
||||
"Apache benchmark v2.2.21
|
||||
Static web page serving",每秒请求数,越大越好,11784.34
|
||||
C-Ray v1.1,秒数,越小越好,120.23
|
||||
POV-Ray v3.6.1,秒数,越小越好,1129
|
||||
"Smallpt v1.0
|
||||
Global Illumnination Renderer",秒数,越小越好,241
|
||||
"TSCP v1.81
|
||||
AI Chess performance",每秒计算的节点数,越大越好,261528
|
||||
"NAS Parallel benchmarks v3.3
|
||||
EP.B",总的Mop/s,越大越好,70.06
|
||||
"STREAM v2009-04-11
|
||||
Copy",MB/s,越大越好,6381.28
|
||||
|
43
materials/chapter12/LMbench.csv
Normal file
43
materials/chapter12/LMbench.csv
Normal file
@@ -0,0 +1,43 @@
|
||||
工具名称,测量
|
||||
,延迟
|
||||
lat_connect,TCP连接
|
||||
lat_ctx,通过基于管道的“hot-potato”令牌传递的上下文切换
|
||||
lat_dram_page,DRAM页开启
|
||||
lat_fcntl,fcntl文件锁“hot-potato”令牌传递
|
||||
lat_fifo,FIFO“hot-potato”令牌传递
|
||||
lat_fs,文件创建和删除
|
||||
lat_http,http GET请求延迟
|
||||
lat_mem_rd,内存读的延迟
|
||||
lat_mmap,mmap操作
|
||||
lat_ops,"对于基本数据类型(int, int64, float, double)的基本操作(xor, add, mul, div, mod)延迟"
|
||||
lat_pagefault,缺页处理
|
||||
lat_pipe,pipe“hot-potato”令牌传递
|
||||
lat_pmake,完成N个并行任务的时间
|
||||
lat_proc,过程调用的开销以及使用fork, fork和execve,fork和sh进程创建进程的时间
|
||||
lat_rand,随机数产生器
|
||||
lat_rpc,SUN RPC远程过程调用
|
||||
lat_select,select操作
|
||||
lat_sem,信号量“hot-potato”令牌传递
|
||||
lat_sig,信号处理的安装和处理
|
||||
lat_syscall,open、close、getppid、write、stat、fstat系统调用
|
||||
lat_tcp,TCP“hot-potato”令牌传递
|
||||
lat_udp,UDP“hot-potato”令牌传递
|
||||
lat_unix,UNIX“hot-potato”令牌传递
|
||||
lat_unix_connect,UNXI socket连接
|
||||
lat_usleep,usleep、select、pselect、nanosleep、settimer时间分辨率
|
||||
,带宽
|
||||
bw_file_rd,文件的读带宽
|
||||
bw_mem,内存的读带宽、写带宽和拷贝带宽
|
||||
bw_mmap_rd,从mmap的内存中读取带宽
|
||||
bw_pipe,pipe,进程间数据拷贝
|
||||
bw_tcp,TCP进程间数据拷贝
|
||||
bw_unix,UNIX进程通信带宽
|
||||
,其他
|
||||
disk,磁盘的带宽和寻道时间
|
||||
line,Cache行的大小
|
||||
lmdd,dd程序
|
||||
mhz,CPU时钟频率
|
||||
par_mem,内存子系统的并发性(ILP)
|
||||
par_ops,基本操作的并发性(ILP)
|
||||
stream,STREAM
|
||||
tlb,TLB大小
|
||||
|
14
materials/chapter12/PARSEC.csv
Normal file
14
materials/chapter12/PARSEC.csv
Normal file
@@ -0,0 +1,14 @@
|
||||
程序,应用领域,并行模式,并行粒度,数据共享,数据交换,Pthreads,OpenMP,TBB
|
||||
blackscholes,金融分析,数据并行,粗粒度,低,低,X,X,X
|
||||
bodytrack,计算视觉,数据并行,中等粒度,高,中等,X,X,X
|
||||
canneal,工程类,非结构化,细粒度,高,高,X,,
|
||||
dedup,企业存储,流水线,中等粒度,高,高,X,,
|
||||
facesim,动画,数据并行,粗粒度,低,中等,X,,
|
||||
ferret,相似性查找,流水线,中等粒度,高,高,X,,
|
||||
fluidanimate,动画,数据并行,细粒度,低,中等,X,,X
|
||||
freqmine,数据挖掘,数据并行,中等粒度,高,中等,,X,
|
||||
raytrace,渲染,数据并行,中等粒度,高,低,X,,
|
||||
streamcluster,数据挖掘,数据并行,中等粒度,低,中等,X,,X
|
||||
swaptions,金融分析,数据并行,粗粒度,低,低,X,,X
|
||||
vips,媒体处理,数据并行,粗粒度,低,中等,X,,
|
||||
x264,媒体处理,流水线,粗粒度,高,高,X,,
|
||||
|
28
materials/chapter12/SPEC2000.csv
Normal file
28
materials/chapter12/SPEC2000.csv
Normal file
@@ -0,0 +1,28 @@
|
||||
定点测试程序,语言,分类,描述
|
||||
164.gzip,C,压缩,gzip来源于是GNU的gzip。gzip使用LZ77(Lempel-Ziv)压缩算法,所有的压缩和解压缩都在内存中发生
|
||||
175.vpr,C,FPGA电路布局和布线,FPGA集成电路中的布局和布线程序,能自动实现映射技术的电路,如网表或超图,把FPGA逻辑块和IO pad连在一起
|
||||
176.gcc,C,C编程语言编译器,基于gcc版本2.7.2,它产生Motorola 88200处理器的代码,该编译过程开启了许多优化的选项
|
||||
181.mcf,C,组合,优化,该程序为解决公共交通公司单车场容量约束车辆调度问题设计求解的算法
|
||||
186.crafty,C,棋类游戏,国际象棋,高性能计算机棋类程序,包含大量的逻辑操作,例如与、或、异或和移位。其输入5个不同棋盘和深度,搜索树决定下一步的移动,用于比较处理器的定点、分支预测和流水线的效率
|
||||
197.parser,C,字处理,基于link语法的英文语法解析器,解析器包含一个60000词的字典,输入为一个句子,输出为句子的分析,分析捕获了句子的语法结构
|
||||
252.eon,C++,计算机可视化技术,一种基于概率的射线追踪器。其渲染了一个150x150像素屋子角落前方的椅子,渲染的算法采用Kajiya、Cook和Rushmeier
|
||||
253.perlbmk,C,PERL编程语言,解释执行语言Perl,包括四个脚本:Email到HTML的转换MHonArc;Specdiff脚本;使用标准迭代算法寻找完全数;检测所产生的1000个随机数
|
||||
254.gap,C,群论,解释器,GAP表示群论、算法和编程,其实现了计算群论中的一个语言和库。程序执行包括一些组合函数、大数、有限域函数、置换群、子群格计算和可解群中找到正规化子等等
|
||||
255.vortex,C,面向对象数据库,源自一个单用户面向对象的数据库交易测试VORTEx,事务包括在数据库中创建一项、删除一项和数据的查找。包括三个不同的数据库,邮件列表、零件目录表和几何数据
|
||||
256.bzip2,C,压缩,源自Julian Seward的bzip2,一个块排序的数据压缩算法,所有的压缩和解压缩在内存中进行。三个输入:大的tiff图像文件,程序二进制文件,源代码的tar文件
|
||||
300.twolf,C,布局布线模拟器,芯片的布局和标准单元的全局连线的模拟。布局的问题是排列,采用模拟退火作为启发式方法来寻找最好的解决方法。全局路由使用了构造算法和迭代改进对子微芯片进行互连
|
||||
浮点测试程序,语言,分类,描述
|
||||
168.wupwise,Fortran 77,物理,量子色动力学,Wuppertal Wilson Ferminon求解器的简称,属于量子色动力学的格点规范理论领域。通过BiCGStab迭代的方法,求解了非齐次Lattice-Dirac方程
|
||||
171.swim,Fortran 77,浅水建模,天气预报程序,用于测试当前高性能计算机的性能。实现浅水方程的有限差分的动力学模型,处理1335x1335范围的数据数组,迭代512次
|
||||
172.mgrid,Fortran 77,三维势场多栅格求解器,使用一个简单的多网格求解器来计算一个三维的线性势场,源自NAS并行测试程序,对可移植性进行修改并采用不同的工作负载
|
||||
173.applu,Fortran 77,抛物线/椭圆偏微分方程,模拟了三维逻辑结构化网格上的5个耦合非线性偏微分方程(PDE),使用了隐式伪时间匹配方法,基于稀疏雅可比矩阵的双因子近似因子分解方法
|
||||
177.mesa,C,三维图形库,Mesa是一个开源的OpenGL实现库,支持通用帧缓冲,能配置为与OS和窗口系统无关。测试浮点、标量和内存的性能。输入为二维标量域,输出为PNG的二维图像文件
|
||||
178.galgel,Fortran 90,计算流体动力学,源自GAMM测试程序的特定实例。低普朗特数流体在对流时发生震荡失稳的数值分析,计算稳态到失稳的临界格拉晓夫数和临界频率,使用频谱伽略金方法
|
||||
179.art,C,图像识别,神经网络,使用自适应共振理论2(ART 2)神经网络方法,在温度图像中识别对象。对象是直升飞机或者飞机,神经网络首先在对象上进行训练,训练结束后,在扫描域图像中去找已经学习过的图像
|
||||
183.equake,C,地震波传播模拟,使用有限元方法在非结构化网格中计算波长,模拟了地震时弹性波的传播,在大的、异构的山谷,如加州的圣费尔南多山谷或洛杉矶盆地,计算弹性波的传播,目标是能识别地震引起地表运动的历史时间
|
||||
187.facerec,Fortran 90,图像处理,人脸识别,人脸的学习,从典范图像中抽取图像。对于每个要探测的图库,与相册图库进行匹配,查找相似性结果向量,寻找最大值,识别出相关图像
|
||||
188.ammp,C,计算化学,在水包裹的混合蛋白质抑制剂环境下计算分子动力学,求解ODE方程,它是系统中原子运动的牛顿方程。该程序所模拟的蛋白质是HIV蛋白酶和茚地那韦抑制剂混合物
|
||||
189.lucas,Fortran 90,数论,素数测试,执行了Lucas-Lehmer测试,检查梅森数的素数性2p-1。通过离散加权转换技术来计算梅森mod平方,使用数据局部的FFT算法来执行Lucas-Lehmer迭代的大定点数的平方
|
||||
191.fma3d,Fortran 90,有限元碰撞模拟,这个程序计算非弹性、三维固体和结构在受到冲击或者突然加上负载时的瞬态动态响应行为。该程序构建了元素库,也对真实物质的特性进行建模,如弹性和塑性等
|
||||
200.sixtrack,Fortran 77,高能核物理加速器设计,模拟在粒子加速器模型中,跟踪变化数量的粒子,以及变化数量的粒子发生了翻转。加速器的模型,如大型强子对撞机(LHC),可以用于动力学孔径的检查,如梁的长期稳定性
|
||||
301.apsi,Fortran 77,气象学,污染物分布,求解中尺度天气系统的和天气的变化,包括位温,U和V风的分量,中尺度的垂直速度,W压力,污染物浓度分布C,源Q。采用劈分算法对整个系统进行求解
|
||||
|
31
materials/chapter12/SPEC2006.csv
Normal file
31
materials/chapter12/SPEC2006.csv
Normal file
@@ -0,0 +1,31 @@
|
||||
定点测试程序,语言,分类,描述
|
||||
400.perlbench,C,Perl编程语言,Perl脚本程序,包括垃圾邮件检测程序SpamAssassin、邮件索引器MHonArc和specdiff
|
||||
401.bzip2,C,压缩,bzip2压缩程序,输入包括JPEG图片、源代码、HTML文件和混合文件等,使用不同的压缩级别进行压缩和解压缩
|
||||
403.gcc,C,C编译器,基于gcc 3.2编译器,产生Opteron的代码
|
||||
429.mcf,C,组合优化,一个用于大型公共交通的单车场车辆调度程序,使用了商业产品中常用的网络单纯形算法
|
||||
445.gobmk,C,人工智能,围棋go,下围棋游戏,读入围棋格式文件,然后执行一些命令,根据围棋规则分析当前的局势,决定更为有利的下一步走法
|
||||
456.hmmer,C,基因序列搜索,使用Profile隐马尔可夫模型(HMM),进行蛋白质基因序列分析
|
||||
458.sjeng,C,人工智能,棋类游戏,一个排名很高的棋类游戏,属于棋类树的搜索和模式识别,通过组合alpha-beta剪枝或proof-number树搜索、形式判断、启发式前向修剪来寻找最佳的棋子移动
|
||||
462.libquantum,C,物理,量子计算,模拟了一台量子计算机,执行了Shor多项式时间因式分解算法
|
||||
464.h264ref,C,视频压缩,视频压缩标准H.264/AVC的一种参考设计,基于h264avc 9.3版本,使用两个参数组对YUV格式源文件进行H.264编码
|
||||
471.omnetpp,C++,离散时间模拟,使用OMNet++离散时间模拟器对一个大型的校园网络进行建模,包括8000台计算机和900个交换机以及各种以太网协议
|
||||
473.astar,C++,路径寻找算法,二维地图的寻路算法库,常用于游戏中的人工智能,实现了三种不同类型的A*算法
|
||||
483.xalancbmk,C++,XML处理,将XML文档转换为HTML、纯文本或者其他XML格式的文档。是Xalan-C++的一个修改版本,Xalan-C++实现了XSL转换和XML Path语言
|
||||
浮点测试程序,语言,分类,描述
|
||||
410.bwaves,Fortran,流体动力学,对三维瞬间跨音速粘性流体层流冲击波的模拟计算。该算法实现了非压缩Navier-Stokes等式的全隐式无分裂求解,采用了Bi-CGstab算法,迭代求解了非对称线性方程组
|
||||
416.gamess,Fortran,量子化学,源自量子化学计算用得最广的GAMESS(从头计算量子化学程序)。采用三种SCF自洽场方法(RHF、ROHF、MCSCF)对胞嘧啶分子、水和Cu2+离子、三唑离子进行自洽场计算
|
||||
433.milc,C,物理,量子色动力学(QCD),来自MIMD格计算(MILC)、四维SU(3)格点规范理论的模拟,用来研究QCD量子色动力学、夸克和胶子,采用了su3imp程序的串行版本
|
||||
434.zeusmp,Fortran,物理,计算流体动力学(CFD),伊利诺伊大学香槟分校开发的计算流体动力学程序,用于模拟天体物理现象。模拟了一个沿着X轴方向统一磁场中的三维冲击波
|
||||
435.gromacs,C/ Fortran,生物化学,分子动力学,计算数百到数百万粒子的牛顿运动方程。模拟了一个在水和离子溶液中的蛋白质溶菌酶结构在各种实验手段如核磁共振的X光照射下的变化
|
||||
436.cactusADM,C/ Fortran,物理,广义相对论,采用交错超越的数值分析方法,对时空曲率由内部物质决定的爱因斯坦演化方程进行求解,演化方程由10个标准的ADM 3+1分解的二阶非线性偏微分方程组成
|
||||
437.leslie3d,Fortran,流体动力学,来自三维大涡模拟和线性涡流模型,其使用麦科马克预测校正时间积分方法,用来计算湍流的计算流体力学程序。计算了一个如燃油注入燃烧室的时间分层混合流体
|
||||
444.namd,C++,生物学,分子动力学,源自并行程序NAMD,其模拟了大规模的生物分子系统。namd.input模拟了92224个原子组成的A-I载脂蛋白,ref有38次迭代
|
||||
447.dealII,C++,有限元分析,计算自适应有限元和误差估计。对非常系数的亥姆霍兹方程进行求解,使用了基于二元加权误差估计生成最佳网络的自适应方法
|
||||
450.soplex,C++,线性规划,优化,使用了单纯型算法和松弛线性算法求解线性方程。测试模拟包括铁路规划和军用空运规划的物理模型
|
||||
453.povray,C++,图像光线跟踪,光线跟踪是一种渲染技术,通过模拟真实世界的光线传输方式计算实景的影像。该计算基于柏林噪声函数,渲染一幅1280x1024的反锯齿国际象棋棋盘图像
|
||||
454.Calculix,C/ Fortran,结构力学,使用SPOOLES求解器库,进行线性和非线性三维结构力学的有限元分析。计算了一个高速旋转压气盘在离心力作用下的应力和变形情况
|
||||
459.GemsFDTD,Fortran,计算电磁学,使用了FDTD(有限差分时域)方法求解三维时域中的麦克斯韦方程,计算了一个理想导体的雷达散射界面
|
||||
465.tonto,Fortran,量子化学,面向对象的从头算量子化学包。模拟了量子晶体学领域计算,设置约束于分子的HF波函数,更好地匹配X光衍射实验数据
|
||||
470.lbm,C,流体动力学,实现了格子玻尔兹曼方法(LBM),模拟在三维空间的非压缩流体,常用于材料科学中模拟流体的行为
|
||||
481.wrf,C/ Fortran,天气预报,基于WRF模型,是下一代中等规模数值天气预报系统,用于天气预报和大气研究,模拟30公里区域和两天内的天气
|
||||
482.sphinx3,C,语音识别,基于卡内基-梅隆大学开发的著名的语音识别软件,使用了AN4数据库,输入为原始的音频格式,输出为识别出来的话语
|
||||
|
26
materials/chapter12/SPEC2017.csv
Normal file
26
materials/chapter12/SPEC2017.csv
Normal file
@@ -0,0 +1,26 @@
|
||||
SPECrate 2017定点程序,SPECspeed 2017定点程序,语言,描述
|
||||
500.perlbench_r,600.perlbench_s,C,文本处理,Perl解释器
|
||||
502.gcc_r,602.gcc_s,C,编译,GNU C编译器
|
||||
505.mcf_r,605.mcf_s,C,组合和优化,求解车辆调度问题
|
||||
520.omnetpp_r,620.omnetpp_s,C++,计算机网络,离散事件模拟
|
||||
523.xalancbmk_r,623.xalancbmk_s,C++,通过XSLT将XML转换为HTML
|
||||
525.x264_r,625.x264_s,C,视频压缩,x264视频编解码
|
||||
531.deepsjeng_r,631.deepsjeng_s,C++,人工智能,下棋程序,alpha-beta树搜索
|
||||
541.leela_r,641.leela_s,C++,人工智能,下棋程序(go),蒙特卡洛树搜索
|
||||
548.exchange2_r,648.exchange2_s,Fortran,人工智能,9x9数独,递归方式求解
|
||||
557.xz_r,657.xz_s,C,压缩和解压缩,xz压缩程序
|
||||
SPECrate 2017浮点程序,SPECspeed 2017浮点程序,语言,描述
|
||||
503.bwaves_r,603.bwaves_s,Fortran,计算流体动力学,爆炸建模
|
||||
507.cactuBSSN_r,607.cactuBSSN_s,"C++, C, Fortran",物理,广义相对论和数值相对论,求解真空中的爱因斯坦方程
|
||||
508.namd_r,,C++,结构生物学,模拟大规模的生物分子系统
|
||||
510.parest_r,,C++,分子医学成像,光学层析成像问题的有限元求解器
|
||||
511.povray_r,,"C++, C",计算机可视化,光线追踪应用POV-Ray
|
||||
519.lbm_r,619.lbm_s,C,流体动力学
|
||||
521.wrf_r,621.wrf_s,"Fortran, C",天气预报建模,基于新一代中尺度数值天气预报系统WRF
|
||||
526.blender_r,,"C++, C",三维渲染和动画,基于开源的三维制作套件Blender
|
||||
527.cam4_r,627.cam4_s,"Fortran, C",大气环流建模,地球系统模型CESM中的大气建模部分
|
||||
,628.pop2_s,"Fortran, C",大规模海洋建模(气候层面),地球系统模型CESM中的海洋建模部分
|
||||
538.imagick_r,638.imagick_s,C,图像处理,图像处理软件包ImageMagick中convert部分
|
||||
544.nab_r,644.nab_s,C,分子动力学,基于生命科学计算领域中分子建模应用NAB(核酸构建器)
|
||||
549.fotonik3d_r,649.fotonik3d_s,Fortran,计算电磁学,利用时域有限差分方法计算光子波导的透射系数
|
||||
554.roms_r,654.roms_s,Fortran,区域海洋建模,基于区域海洋建模系统ROMS
|
||||
|
5
materials/chapter12/STREAM.csv
Normal file
5
materials/chapter12/STREAM.csv
Normal file
@@ -0,0 +1,5 @@
|
||||
opname,operation,description
|
||||
Copy,a(i)=b(i),2个双精度浮点的访存操作(16字节),每个迭代没有浮点操作
|
||||
Scale,a(i)=q*b(i),2个双精度浮点的访存操作(16字节),每个迭代包含一个浮点乘法操作
|
||||
Add,a(i)=b(i)+c(i),3个双精度浮点的访存操作(24字节),每次迭代包含一个浮点加法操作
|
||||
Triad,a(i)=b(i)+q*c(i),3个双精度浮点的访存操作(24字节),每次迭代两个浮点操作
|
||||
|
11
materials/chapter12/UnixBench.csv
Normal file
11
materials/chapter12/UnixBench.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
测试项目,项目描述
|
||||
Dhystone,测试和比较定点计算性能
|
||||
Whetstone,测试和比较浮点计算性能
|
||||
Execl系统调用,测量每秒能执行的execl系统调用的次数
|
||||
文件拷贝,测量数据从一个文件拷贝到另一个文件的速率
|
||||
管道吞吐率,测量一个进程每秒能执行的把512字节写入管道再读回来的次数
|
||||
基于管道的上下文切换,测量两个进程基于管道交换一个不断增长的整数的速度
|
||||
进程创建,测量一个进程创建和回收一个立刻退出的子进程的速度
|
||||
Shell脚本,测量进程每分钟能执行的一些文件操作脚本的次数
|
||||
系统调用开销,测量进入和退出操作系统内核的开销
|
||||
图形测试,粗略测量系统2D和3D图形操作的性能
|
||||
|
19
materials/chapter12/alu-delay.csv
Normal file
19
materials/chapter12/alu-delay.csv
Normal file
@@ -0,0 +1,19 @@
|
||||
lat_ops延迟(ns),loongson 3A5000,zen1 r3-1200,skylake i3 9100f
|
||||
integer bit,0.27,0.29,0.27
|
||||
integer add,0,0,0
|
||||
integer mul,0.02,0.02,1.24
|
||||
integer div,6.21,8.03,10.86
|
||||
integer mod,3.6,5.61,11.32
|
||||
int64 bit,0.27,0.29,0.27
|
||||
int64 add,0,0,0
|
||||
int64 mul,0.02,0.02,1.22
|
||||
int64 div,7.6,10.63,17.1
|
||||
int64 mod,3.34,5.34,16.55
|
||||
float add,2,1.2,1.6
|
||||
float mul,2,1.2,1.61
|
||||
float div,10.82,4.04,4.58
|
||||
double add,2,1.2,1.6
|
||||
double mul,2,1.6,1.6
|
||||
double div,9.22,5.25,5.78
|
||||
float bogomflops,5.04,1.53,1.2
|
||||
double bogomflops,9.62,1.81,1.61
|
||||
|
20
materials/chapter12/cpu-params.csv
Normal file
20
materials/chapter12/cpu-params.csv
Normal file
@@ -0,0 +1,20 @@
|
||||
厂商,Loongson,AMD,Intel
|
||||
处理器型号,3A5000,r3 1200,i3 9100f
|
||||
上市时间,2021,2017,2019
|
||||
工艺,12nm,14nm,14nm
|
||||
指令集,LoongArch,X86-64,X86-64
|
||||
微结构型号,GS464V,Zen1,SkyLake
|
||||
频率,2.5GHz,2.5GHz,2.5GHz
|
||||
内存类型和频率,DDR4 3200MHz,DDR4 3200MHz,DDR4 2400MHz
|
||||
Cache层次,"64KB以及ICache
|
||||
64KB一级DCache
|
||||
256KB二级Cache
|
||||
16MB三级Cache","64KB一级ICache
|
||||
32KB一级DCache
|
||||
512KB二级Cache
|
||||
8MB三级Cache","32KB一级ICache
|
||||
32KB一级DCache
|
||||
256KB二级Cache
|
||||
6MB三级Cache"
|
||||
核心队列和重命名寄存器数量,128项ROB,64项load队列,48项store队列,32项分支队列,32项定点、32项浮点和32项访存保留站,128项定点和128项浮点重命名寄存器。,192项ROB,72项load队列,44项store队列,84项定点和96项浮点保留站,168项定点和160项浮点重命名寄存器。,224项ROB,72项load队列,56项store队列,97项统一保留站,180项定点和168项浮点重命名寄存器。
|
||||
功能部件数,4个定点,2个访存部件,2个256位的浮点乘加,4个定点部件,2个访存部件,4个128位浮点部件(其中2个FMA/FMUL,2个FADD),4个定点、3个访存、3个256位浮点乘加
|
||||
|
5
materials/chapter12/memory-latency.csv
Normal file
5
materials/chapter12/memory-latency.csv
Normal file
@@ -0,0 +1,5 @@
|
||||
CPU型号,"3A5000 2.5G","Zen1 r3 1200","Zen+ r3 3100","Skylake i3 9100f"
|
||||
一级Cache延迟,4拍,4拍,4拍,4拍
|
||||
二级Cache延迟,14 拍,17拍,12拍,12拍
|
||||
三级Cache延迟,38~45 拍,38~49拍,38~45拍,38~48拍
|
||||
内存访问延迟,40拍+80ns,40拍+85ns,40拍+75ns,40拍+68ns
|
||||
|
14
materials/chapter12/perf-eval-class.csv
Normal file
14
materials/chapter12/perf-eval-class.csv
Normal file
@@ -0,0 +1,14 @@
|
||||
a,b,c
|
||||
性能建模,分析建模,概率模型
|
||||
性能建模,分析建模,队列模型
|
||||
性能建模,分析建模,马尔可夫模型
|
||||
性能建模,分析建模,Petri网模型
|
||||
性能建模,模拟建模,踪迹驱动模拟
|
||||
性能建模,模拟建模,执行驱动模拟
|
||||
性能建模,模拟建模,全系统模拟
|
||||
性能建模,模拟建模,事件驱动模拟
|
||||
性能建模,模拟建模,统计方法模拟
|
||||
性能测量,片上硬件监测器(例如性能计数器),片上硬件监测器(例如性能计数器)
|
||||
性能测量,片外硬件监测器,片外硬件监测器
|
||||
性能测量,软件监测器,软件监测器
|
||||
性能测量,微码插桩,微码插桩
|
||||
|
27
materials/chapter12/perf-event-3A5000.csv
Normal file
27
materials/chapter12/perf-event-3A5000.csv
Normal file
@@ -0,0 +1,27 @@
|
||||
事件号,事件名称,事件定义
|
||||
00H,clkcnt,时钟周期数
|
||||
01H,roq_cmtcnt,提交指令数
|
||||
02H,brq_branch,brq返回分支指令数
|
||||
03H,brq_err_branch,brq返回预测错误分支指令数
|
||||
04H,dtlb_access_cnt,数据tlb访问次数
|
||||
08H,dcache_access,一级数据Cache访问次数
|
||||
09H,dcache_miss,一级数据Cache缺失次数
|
||||
0AH,vcache_access,victim_cache访问次数
|
||||
0BH,vcache_miss,victim_cache缺失次数
|
||||
0CH,scres_total,三级Cache访问次数
|
||||
0DH,scres_miss,三级Cache缺失次数
|
||||
24H,roq_vecfp_cmtcnt,处理器提交向量浮点运算指令数
|
||||
25H,roq_vecint_cmtcnt,处理器提交向量定点运算指令数
|
||||
27H,roq_ex_cnt,处理器中例外次数
|
||||
29H,brq_bhtbrq,返回条件跳转类分支指令数
|
||||
2AH,brq_err_bht,brq返回条件跳转类错误预测分支指令数
|
||||
2FH,ade_ualign_cnt,发生不对齐访问错误次数
|
||||
32H,roq_load_cmtcnt,处理器提交load指令数
|
||||
33H,roq_store_cmtcnt,处理器提交store指令数
|
||||
34H,roq_scaint_cmtcnt,处理器提交标量定点运算指令数
|
||||
40H,roq_cmt_4inst,提交阻塞周期数
|
||||
41H,dec_deliver_stall,前端阻塞周期数
|
||||
42H,be_stall,后端阻塞周期数
|
||||
4CH,fxq_stall,定点发射队列阻塞周期数
|
||||
4EH,mmq_stall,访存发射队列阻塞周期数
|
||||
4FH,ftq_stall,浮点发射队列阻塞周期数
|
||||
|
19
materials/chapter12/perf-event-nehalem.csv
Normal file
19
materials/chapter12/perf-event-nehalem.csv
Normal file
@@ -0,0 +1,19 @@
|
||||
事件号,umask值,事件,描述
|
||||
3CH,00H,UnHalted Core cycles,时钟周期或拍数
|
||||
C0H,00H,Instruction retired,提交的指令数
|
||||
2EH,4FH,LLC reference,访问最后一级Cache的数目
|
||||
2EH,41H,LLC misses,访问最后一级Cache失效的数目
|
||||
C4H,00H,Branch Instruction Retired,提交的分支指令的数目
|
||||
C5H,00H,Branch Misses Retired,提交的误预测的分支指令的数目
|
||||
0BH,01H,MEM_INST_RETIRED.LOADS,提交的load指令的数目
|
||||
0BH,02H,MEM_INST_RETIRED.STORES,提交的store指令的数目
|
||||
0EH,01H,UOPS_ISSUED.ANY,从重命名表发射到保留站的微码数目
|
||||
0FH,02H,MEM_UNCORE_RETIRED.OTHER_CORE_L2_HITM,提交的load访存操作,命中芯片相邻核二级Cache,并在Modified状态
|
||||
12H,01H,SIMD_INT_128.PACKED_MPY,128位的SIMD定点乘法操作的数目
|
||||
24H,01H,L2_RQST.LD_MISS,二级load请求,二级Cache失效,二级load包括L1D失效和L1D预取
|
||||
26H,FFH,L2_DATA_RQSTS.ANY,所有的二级数据请求
|
||||
40H,0FH,L1D_CACHE_LD.MESI,所有的一级数据Cache读请求
|
||||
C4H,00H,BR_INST_RETIRED.ALL_BRANCHES,提交的分支指令
|
||||
D2H,0FH,RAT_STALLS.ANY,寄存器分配表引起的堵塞
|
||||
2AH,01H,UNC_QMC_OCCUPANCY.CH0,内存控制器通道0读请求发生
|
||||
60H,01H,UNC_DRAM_OPEN.CH0,DRAM通道0由于读或者写发出open命令,因为该页首先需要打开
|
||||
|
8
materials/chapter12/perf-tools.csv
Normal file
8
materials/chapter12/perf-tools.csv
Normal file
@@ -0,0 +1,8 @@
|
||||
工具,平台,链接
|
||||
Intel Vtune,Intel X86,http://software.intel.com/intel-vtune-amplifier-xe
|
||||
Linux perf,X86/MIPS等,http://perf.wiki.kernel.org
|
||||
oprofile,X86/MIPS等,http://oprofile.sourceforge.net
|
||||
DCPI,Alpha,http://www.hp.com/openvms/products/dcpi
|
||||
Perf-mon,UltraSPARC,http://www.sics.se/~mch/perf-monitor/index.html
|
||||
AMD CodeAnalyst,AMD X86,http://developer.amd.com/tools-and-sdks/compute__trashed/amd-codeanalyst-performance-analyzer-for-linux/
|
||||
PAPI,X86,http://icl.cs.utk.edu/papi/software/index.html
|
||||
|
8
materials/chapter12/performance-formula.csv
Normal file
8
materials/chapter12/performance-formula.csv
Normal file
@@ -0,0 +1,8 @@
|
||||
硬件或软件,影响什么,如何影响
|
||||
算法,程序的执行指令数,算法决定源程序执行指令的数目,好的算法可以大幅度减少运算的次数
|
||||
编程语言,程序的执行指令数,编程语言可能对执行指令数产生巨大的影响,比如解释执行、即时编译或者原生编译的三类语言完成同样的功能所需要的指令数可能有数量级的差异
|
||||
编译器和库,程序的执行指令数、CPI,编译器和库决定了源程序到计算机指令的翻译过程,编译程序的效率既影响到程序的执行指令数又影响到CPI,如Intel的ICC编译器编出来的程序,效率可比GCC高30%,其能充分利用向量化指令和针对处理器结构的优化
|
||||
指令系统结构,程序的执行指令数、CPI和时钟频率,指令系统结构影响到CPU性能的3个方面,因为它影响到完成某个功能所需的指令数、每条指令的周期数,以及处理器的时钟频率
|
||||
微体系结构,CPI和时钟频率,微体系结构的改进可以降低CPI,也可以细分流水线来提高频率
|
||||
物理设计,时钟频率,物理设计和电路的进步可以降低每个时钟周期的FO4,从而提高时钟频率
|
||||
工艺,时钟频率,工艺的进步使得晶体管变快从而提高时钟频率
|
||||
|
5
materials/chapter12/stream-bandwidth.csv
Normal file
5
materials/chapter12/stream-bandwidth.csv
Normal file
@@ -0,0 +1,5 @@
|
||||
STREAM四核(openMP),3A5000,Zen1,Skylake
|
||||
Copy,23860.9,39896.4,26983.3
|
||||
Scale,22347.3,25073.3,19110.9
|
||||
Add,19323,29768.5,21516
|
||||
Triad,21043.8,29146.8,21490.7
|
||||
|
13
materials/chapter2/add_and_ref.S
Normal file
13
materials/chapter2/add_and_ref.S
Normal file
@@ -0,0 +1,13 @@
|
||||
add:
|
||||
add.w $a0, $a0, $a1 //a+b
|
||||
jr $ra //return
|
||||
ref:
|
||||
addi.d $sp, $sp, -16 //stack allocate
|
||||
addi.w $a1, $r0, 34 //t2=34
|
||||
addi.w $a0, $r0, 12 //t1=12
|
||||
st.d $ra, $sp, 8 //save $ra
|
||||
bl add //call add()
|
||||
ld.d $ra, $sp, 8 //restore $ra
|
||||
addi.d $sp, $sp, 16 //stack release
|
||||
jr $ra //return
|
||||
|
||||
13
materials/chapter2/add_and_ref.c
Normal file
13
materials/chapter2/add_and_ref.c
Normal file
@@ -0,0 +1,13 @@
|
||||
int add(int a,int b)
|
||||
{
|
||||
return a+b;
|
||||
}
|
||||
|
||||
int ref(void)
|
||||
{
|
||||
|
||||
int t1 = 12;
|
||||
int t2 = 34;
|
||||
|
||||
return add(t1,t2);
|
||||
}
|
||||
8
materials/chapter2/addr_compare.csv
Normal file
8
materials/chapter2/addr_compare.csv
Normal file
@@ -0,0 +1,8 @@
|
||||
寻址方式,MIPS,PowerPC,PA-RISC,SPARC,LoongArch
|
||||
寄存器寻址,Y,Y,Y,Y,Y
|
||||
立即数寻址,Y,Y,Y,Y,Y
|
||||
偏移量寻址,Y,Y,Y,Y,Y
|
||||
变址寻址,Y(仅浮点),Y,Y,Y,Y
|
||||
比例变址寻址,,,Y,,
|
||||
自增/自减+偏移量寻址,,Y,Y,,
|
||||
自增/自减+变址寻址,,Y,Y,,
|
||||
|
11
materials/chapter2/addressing.csv
Normal file
11
materials/chapter2/addressing.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
寻址方式,格式,含义
|
||||
寄存器寻址(Register),"ADD R1,R2",regs[R1]=regs[R1]+regs[R2]
|
||||
立即数寻址(Immediate),"ADD R1,#2",regs[R1]=regs[R1]+2
|
||||
偏移量寻址(Displacement),"ADD R1,100(R2)",regs[R1]=regs[R1]+mem[100+regs[R2]]
|
||||
寄存器间接寻址(Reg.Indirect),"ADD R1,(R2)",regs[R1]=regs[R1]+mem[regs[R2]]
|
||||
变址寻址(Indexed),"ADD R1,(R2+R3)",regs[R1]=regs[R1]+mem[regs[R2]+regs[R3]]
|
||||
绝对寻址(Absolute),"ADD R1,(100)",regs[R1]=regs[R1]+mem[100]
|
||||
存储器间接寻址(Mem.Indirect),"ADD R1,@(R2)",regs[R1]=regs[R1]+mem[mem[regs[R2]]]
|
||||
自增量寻址(Autoincrement),"ADD R1,(R2)+","regs[R1]=regs[R1]+mem[regs[R2]],regs[R2]=regs[R2]+d"
|
||||
自减量寻址(Autodecrement),"ADD R1,-(R2)","regs[R2]=regs[R2]-d,regs[R1]=regs[R1]+mem[regs[R2]]"
|
||||
比例变址寻址(Scaled),"ADD R1,100(R2)(R3)",regs[R1]=regs[R1]+mem[100+regs[R2]+regs[R3]*d]
|
||||
|
11
materials/chapter2/alpha.S
Normal file
11
materials/chapter2/alpha.S
Normal file
@@ -0,0 +1,11 @@
|
||||
LOOP:
|
||||
LDT fp3=y(r2,0)
|
||||
LDT fp1=x(r1,0)
|
||||
MULT fp3=fp3,fp2
|
||||
ADDQ r2=r2,8
|
||||
MULT fp1=fp1,fp4
|
||||
SUBQ r4=r2,r6
|
||||
ADDT fp1=fp3,fp1
|
||||
STT x(r1,0)=fp1
|
||||
ADDQ r1=r1,8
|
||||
BNE r4,LOOP
|
||||
5
materials/chapter2/alpha_note.txt
Normal file
5
materials/chapter2/alpha_note.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
r1指向x
|
||||
r2指向y
|
||||
r6指向y的结尾
|
||||
fp2内容为t
|
||||
fp4内容为r
|
||||
45
materials/chapter2/alu_inst.csv
Normal file
45
materials/chapter2/alu_inst.csv
Normal file
@@ -0,0 +1,45 @@
|
||||
指令,指令功能
|
||||
ADD.W,字加
|
||||
ADDI.W,字加立即数
|
||||
SUB.W,字减
|
||||
ADD.D,双字加
|
||||
ADDI.D,双字加立即数
|
||||
SUB.D,双字减
|
||||
SLT,有符号数比较小于置1
|
||||
SLTI,有符号数立即数比较小于置1
|
||||
SLTU,无符号数比较小于置1
|
||||
SLTUI,无符号数立即数比较小于置1
|
||||
AND,与
|
||||
OR,或
|
||||
XOR,异或
|
||||
NOR,或非
|
||||
ANDI,与立即数
|
||||
ORI,或立即数
|
||||
XORI,异或立即数
|
||||
LU12I.W,加载20位立即数到高位
|
||||
SLL.W,字逻辑左移变量位
|
||||
SRL.W,字逻辑右移变量位
|
||||
SRA.W,字算术右移变量位
|
||||
SLLI.W,字逻辑左移常量位
|
||||
SRLI.W,字逻辑右移常量位
|
||||
SRAI.W,字算术右移常量位
|
||||
SLL.D,双字逻辑左移变量位
|
||||
SRL.D,双字逻辑右移变量位
|
||||
SRA.D,双字算术右移变量位
|
||||
SLLI.D,双字逻辑左移常量位
|
||||
SRLI.D,双字逻辑右移常量位
|
||||
SRAI.D,双字算术右移常量位
|
||||
MUL.W,字乘取低半部分
|
||||
MULH.W,有符号字乘取高半部分
|
||||
MULH.WU,无符号字乘取高半部分
|
||||
MUL.D,双字乘取低半部分
|
||||
MULH.D,有符号双字乘取高半部分
|
||||
MULH.DU,无符号双字乘取高半部分
|
||||
DIV.W,有符号字除取商
|
||||
DIV.WU,无符号字除取商
|
||||
MOD.W,有符号字除取余
|
||||
MOD.WU,无符号字除取余
|
||||
DIV.D,有符号双字除取商
|
||||
DIV.DU,无符号双字除取商
|
||||
MOD.D,有符号双字除取余
|
||||
MOD.DU,无符号双字除取余
|
||||
|
12
materials/chapter2/control_inst.csv
Normal file
12
materials/chapter2/control_inst.csv
Normal file
@@ -0,0 +1,12 @@
|
||||
指令,指令功能
|
||||
JIRL,相对寄存器偏移跳转并链接
|
||||
B,无条件相对转移
|
||||
BL,无条件相对转移并链接
|
||||
BEQ,等于时相对转移
|
||||
BNE,不等时相对转移
|
||||
BLT,有符号比较小于时相对转移
|
||||
BGE,有符号比较大于等于时相对转移
|
||||
BLTU,无符号比较小于时相对转移
|
||||
BGEU,无符号比较大于等于时相对转移
|
||||
BEQZ,等于0相对转移
|
||||
BNEZ,不等于0时相对转移
|
||||
|
8
materials/chapter2/if_else.S
Normal file
8
materials/chapter2/if_else.S
Normal file
@@ -0,0 +1,8 @@
|
||||
move $t0, cond_exp
|
||||
beqz $t0, .L1
|
||||
<then_statement>
|
||||
b .L2
|
||||
.L1:
|
||||
<else_statement>
|
||||
.L2:
|
||||
|
||||
5
materials/chapter2/if_else.c
Normal file
5
materials/chapter2/if_else.c
Normal file
@@ -0,0 +1,5 @@
|
||||
if (cond_exp)
|
||||
then_statement
|
||||
else
|
||||
else_statement
|
||||
|
||||
6
materials/chapter2/int_type.csv
Normal file
6
materials/chapter2/int_type.csv
Normal file
@@ -0,0 +1,6 @@
|
||||
C语言名称,LA32名称/数据长度,LA64名称/数据长度,X86名称/数据长度,X86-64名称/数据长度
|
||||
char,Byte/1,Byte/1,Byte/1,Byte/1
|
||||
short,Halfword/2,Halfword/2,Word/2,Word/2
|
||||
int,Word/4,Word/4,Dword/4,Dword/4
|
||||
long,Word/4,Dword/8,Dword/4,Qword/8
|
||||
long long,Dword/8,Dword/8,Qword/8,Qword/8
|
||||
|
5
materials/chapter2/isatype.csv
Normal file
5
materials/chapter2/isatype.csv
Normal file
@@ -0,0 +1,5 @@
|
||||
堆栈型,累加器型,寄存器-存储器型,寄存器-寄存器型
|
||||
PUSH A,LOAD A,"LOAD R1,A","LOAD R1,A"
|
||||
PUSH B,ADD B,"ADD R1,B","LOAD R2,B"
|
||||
ADD,STORE C,"STORE C,R1","ADD R3,R1,R2"
|
||||
POP C,,,"STORE C,R3"
|
||||
|
38
materials/chapter2/loop.S
Normal file
38
materials/chapter2/loop.S
Normal file
@@ -0,0 +1,38 @@
|
||||
test_for:
|
||||
or $t0,$r0,$r0
|
||||
or $t1,$r0,$r0
|
||||
.L2:
|
||||
blt $t0,$a0,.L3
|
||||
or $a0,$t1,$r0
|
||||
jr $ra
|
||||
.L3:
|
||||
add.w $t1,$t1,$t0
|
||||
addi.w $t0,$t0,1
|
||||
b .L2
|
||||
|
||||
|
||||
test_while:
|
||||
or $t0,$r0,$r0
|
||||
or $t1,$r0,$r0
|
||||
.L2:
|
||||
blt $t0,$a0,.L3
|
||||
or $a0,$t1,$r0
|
||||
jr $ra
|
||||
.L3:
|
||||
add.w $t1,$t1,$t0
|
||||
addi.w $t0,$t0,1
|
||||
b .L2
|
||||
|
||||
|
||||
test_dowhile:
|
||||
or $t0,$r0,$r0
|
||||
or $t3,$r0,$r0
|
||||
.L2:
|
||||
add.w $t1,$t3,$t0
|
||||
addi.w $t2,$t0,1
|
||||
or $t3,$t1,$r0
|
||||
or $t0,$t2,$r0
|
||||
blt $t2,$a0,.L2
|
||||
or $a0,$t1,$r0
|
||||
jr $ra
|
||||
|
||||
36
materials/chapter2/loop.c
Normal file
36
materials/chapter2/loop.c
Normal file
@@ -0,0 +1,36 @@
|
||||
int test_for(int a) {
|
||||
int sum = 0;
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < a; i++) {
|
||||
sum += i;
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
||||
int test_while(int a) {
|
||||
int sum = 0;
|
||||
int i = 0;
|
||||
|
||||
while (i < a) {
|
||||
sum += i;
|
||||
i++;
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
||||
int test_dowhile(int a) {
|
||||
int sum = 0;
|
||||
int i = 0;
|
||||
|
||||
do {
|
||||
sum += i;
|
||||
i++;
|
||||
} while (i < a);
|
||||
|
||||
return sum;
|
||||
}
|
||||
12
materials/chapter2/mem_inst.csv
Normal file
12
materials/chapter2/mem_inst.csv
Normal file
@@ -0,0 +1,12 @@
|
||||
指令,指令功能
|
||||
LD.B,取字节
|
||||
LD.BU,取字节,无符号扩展
|
||||
LD.H,取半字
|
||||
LD.HU,取半字,无符号扩展
|
||||
LD.W,取字
|
||||
LD.WU,取字,无符号扩展
|
||||
LD.D,取双字
|
||||
ST.B,存字节
|
||||
ST.H,存半字
|
||||
ST.W,存字
|
||||
ST.D,存双字
|
||||
|
7
materials/chapter2/ppc.S
Normal file
7
materials/chapter2/ppc.S
Normal file
@@ -0,0 +1,7 @@
|
||||
LOOP:
|
||||
LFU fp0=y(r4=r4+8)
|
||||
FMUL fp0=fp0,fp1
|
||||
LF fp2=x(r3,8)
|
||||
FMADD fp0=fp0,fp2,fp3
|
||||
STFU x(r3=r3+8)=fp0
|
||||
BC LOOP,CTR>0
|
||||
5
materials/chapter2/ppc_note.txt
Normal file
5
materials/chapter2/ppc_note.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
r3+8指向x
|
||||
r4+8指向y
|
||||
fp1内容为t
|
||||
fp3内容为r
|
||||
CTR内容为512
|
||||
11
materials/chapter2/regnum.csv
Normal file
11
materials/chapter2/regnum.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
指令集,整数通用寄存器数
|
||||
Itanium,128
|
||||
VAX,16
|
||||
ARMv8,31
|
||||
PowerPC,32
|
||||
Alpha,32(包括“zero”)
|
||||
SPARC,32(包括“zero”)
|
||||
MIPS,在mips16模式下为8,在32/64位模式下为32(包括“zero”)
|
||||
ARMv7,在16位Thumb 模式下为7,在32位模式下为14
|
||||
X86,"16/32位时为8, 64位时为16"
|
||||
LoongArch,32(包括“zero”)
|
||||
|
36
materials/chapter2/switch_case.S
Normal file
36
materials/chapter2/switch_case.S
Normal file
@@ -0,0 +1,36 @@
|
||||
st:
|
||||
addi.w $t0,$a0, -10 //a-10
|
||||
sltiu $t1,$t0, 8
|
||||
beqz $t1, default //if (a-10)>=8
|
||||
//goto default
|
||||
la $t2, jr_table
|
||||
alsl.d $t1, $t1, $t2, 3
|
||||
//(a-10)*8+jr_table
|
||||
ld.d $t0, $t1, 0
|
||||
jr $t0
|
||||
default:
|
||||
or $a1,$a0,$r0
|
||||
case_14:
|
||||
or $a0,$a1,$r0
|
||||
jr $ra //return b for case_14,
|
||||
//return a for default
|
||||
case_15:
|
||||
andi $a2,$a1,0xf //b & 0xf
|
||||
case_10:
|
||||
addi.w $a1,$a2,50 //c+50
|
||||
b case_14
|
||||
case_12_17:
|
||||
addi.w $a1,$a1,50 //b+50
|
||||
b case_14
|
||||
# jump table
|
||||
.section .rodata
|
||||
.align 3
|
||||
jr_table:
|
||||
.dword case_10
|
||||
.dword default
|
||||
.dword case_12_17
|
||||
.dword default
|
||||
.dword case_14
|
||||
.dword case_15
|
||||
.dword default
|
||||
.dword case_12_17
|
||||
17
materials/chapter2/switch_case.c
Normal file
17
materials/chapter2/switch_case.c
Normal file
@@ -0,0 +1,17 @@
|
||||
int st(int a, int b, int c)
|
||||
{
|
||||
switch (a) {
|
||||
case 15:
|
||||
c = b & 0xf;
|
||||
case 10:
|
||||
return c + 50;
|
||||
case 12:
|
||||
case 17:
|
||||
return b + 50;
|
||||
case 14:
|
||||
return b;
|
||||
default:
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
26
materials/chapter2/switch_case_chain.S
Normal file
26
materials/chapter2/switch_case_chain.S
Normal file
@@ -0,0 +1,26 @@
|
||||
st:
|
||||
addi.w $t0,$r0,14
|
||||
beq $a0,$t0,.L7 //(a==14)?
|
||||
blt $t0,$a0,.L3 //(a>14)?
|
||||
addi.w $t0,$r0,10
|
||||
beq $a0,$t0,.L4 //(a==10)?
|
||||
addi.w $t0,$r0,12
|
||||
beq $a0,$t0,.L5 //(a==12)?
|
||||
jr $ra //return a
|
||||
.L3:
|
||||
addi.w $t0,$r0,15
|
||||
beq $a0,$t0,.L6 //(a==15)?
|
||||
addi.w $t0,$r0,17
|
||||
beq $a0,$t0,.L5 //(a==17)?
|
||||
jr $ra //return a
|
||||
.L6:
|
||||
andi $a2,$a1,0xf //b & 0xf
|
||||
.L4:
|
||||
addi.w $a0,$a2,50 //c + 50
|
||||
jr $ra
|
||||
.L5:
|
||||
addi.w $a0,$a1,50 //b + 50
|
||||
jr $ra
|
||||
.L7:
|
||||
or $a0,$a1,$r0 //return b
|
||||
jr $ra
|
||||
6
materials/chapter2/vax_addressing.csv
Normal file
6
materials/chapter2/vax_addressing.csv
Normal file
@@ -0,0 +1,6 @@
|
||||
寻址方式,tex,spice,gcc
|
||||
偏移量寻址,32%,55%,40%
|
||||
立即数寻址,43%,17%,39%
|
||||
寄存器间接寻址,24%,3%,11%
|
||||
自增量寻址,0%,16%,6%
|
||||
存储器间接寻址,1%,6%,1%
|
||||
|
47
materials/chapter3/csr.csv
Normal file
47
materials/chapter3/csr.csv
Normal file
@@ -0,0 +1,47 @@
|
||||
助记符,编号,说明
|
||||
CRMD,Ox0,处理器当前运行模式及地址翻译模式、全局中断使能等配置信息。
|
||||
PRMD,0x1,触发当前普通异常的现场的运行模式及全局中断使能等配置信息
|
||||
EUEN,0x2,扩展部件的使能控制
|
||||
MISC,0x3,各权限等级下是否运行使用部分特权指令等杂项配置
|
||||
ECFG,0x4,局部中断使能、异常入口间距等配置信息
|
||||
ESTAT,0x5,记录异常和中断发生原因
|
||||
ERA,0x6,普通异常处理返回地址
|
||||
BADV,0x7,记录触发地址相关异常的访存虚地址
|
||||
BADI,0x8,记录触发异常指令的指令编码
|
||||
EENTRY,0xC,配置普通异常处理程序入口地址
|
||||
TLBIDX,0x10,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
TLBEHI,0x11,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
TLBELO0,0x12,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
TLBELO1,0x13,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
ASID,0x18,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
STLBPS,0x1E,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
PGDL,0x19,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
PGDH,0x1A,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
PGD,0x1B,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
PWCL,0x1C,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
PWCH,0x1D,存储管理(TLB)相关寄存器,将在第3节进行详细介绍
|
||||
SAVEn,0x30+n,保存临时数据
|
||||
TID,0x40,恒定频率计时器和定时器相关寄存器
|
||||
TCFG,0x41,恒定频率计时器和定时器相关寄存器
|
||||
TVAL,0x42,恒定频率计时器和定时器相关寄存器
|
||||
CNTC,0x43,恒定频率计时器和定时器相关寄存器
|
||||
TICLR,0x44,恒定频率计时器和定时器相关寄存器
|
||||
LLBCTL,0x60,LLBit的控制
|
||||
TLBRENTRY,0x88,TLB重填异常处理专用寄存器
|
||||
TLRBBADV,0x89,TLB重填异常处理专用寄存器
|
||||
TLBERA,0x8A,TLB重填异常处理专用寄存器
|
||||
TLBRSAVE,0x8B,TLB重填异常处理专用寄存器
|
||||
TLBRELO0,0x8C,TLB重填异常处理专用寄存器
|
||||
TLBRELO1,0x8D,TLB重填异常处理专用寄存器
|
||||
TLBREHI,0x8E,TLB重填异常处理专用寄存器
|
||||
TLBRPRMD,0x8F,TLB重填异常处理专用寄存器
|
||||
MERRCTL,0x90,由Cache校验错所引发的机器错误异常的相关控制状态寄存器
|
||||
MERRINFO1,0x91,由Cache校验错所引发的机器错误异常的相关控制状态寄存器
|
||||
MERRINFO2,0x92,由Cache校验错所引发的机器错误异常的相关控制状态寄存器
|
||||
MERRENTRY,0x93,由Cache校验错所引发的机器错误异常的相关控制状态寄存器
|
||||
MERRERA,0x94,由Cache校验错所引发的机器错误异常的相关控制状态寄存器
|
||||
MERRSAVE,0x95,由Cache校验错所引发的机器错误异常的相关控制状态寄存器
|
||||
DMW0~DMW3,0x180~0x183,直接映射配置窗口0~3的配置寄存器
|
||||
DBG,0x500,调试相关的控制状态寄存器
|
||||
DERA,0x501,调试相关的控制状态寄存器
|
||||
DSAVE,0x502,调试相关的控制状态寄存器
|
||||
|
26
materials/chapter3/exception.csv
Normal file
26
materials/chapter3/exception.csv
Normal file
@@ -0,0 +1,26 @@
|
||||
异常代号,Ecode,Esubcode,异常说明,所属异常类别
|
||||
PIL,0x1,,load操作页无效异常,地址转换异常
|
||||
PIS,0x2,,store操作页无效异常,地址转换异常
|
||||
PIF,0x3,,取指操作页无效异常,地址转换异常
|
||||
PME,0x4,,页修改异常,地址转换异常
|
||||
PNR,0x5,,页不可读异常,地址转换异常
|
||||
PNX,0x6,,页不可执行异常,地址转换异常
|
||||
PPI,0x7,,页权限等级不合规异常,地址转换异常
|
||||
ADEF,0x8,0x0,取指地址错异常,指令执行中的错误
|
||||
ADEM,0x8,0x1,访存指令地址错异常,指令执行中的错误
|
||||
ALE,0x9,,地址非对齐异常,指令执行中的错误
|
||||
BCE,0xA,,边界约束检查错异常,指令执行中的错误
|
||||
SYS,0xB,,系统调用异常,系统调用和陷入
|
||||
BRK,0xC,,断点异常,系统调用和陷入
|
||||
INE,0xD,,指令不存在异常,指令执行中的错误
|
||||
IPE,0xE,,指令权限等级错异常,指令执行中的错误
|
||||
FPD,0xF,,浮点指令未使能异常,系统调用和陷入
|
||||
SXD,0x10,,128位向量扩展指令未使能异常,系统调用和陷入
|
||||
ASXD,0x11,,256位向量扩展指令未使能异常,系统调用和陷入
|
||||
FPE,0x12,0x0,基础浮点指令异常,需要软件修正的运算
|
||||
VFPE,0x12,0x1,向量浮点指令异常,需要软件修正的运算
|
||||
WPEF,0x13,0x0,取指监测点异常,系统调用和陷入
|
||||
WPEM,0x13,0x1,load/store操作监测点异常,系统调用和陷入
|
||||
INT,,,中断,外部事件
|
||||
TLBR,,,TLB重填异常,地址转换异常
|
||||
MERR,,,机器错误异常,数据完整性问题
|
||||
|
19
materials/chapter4/Makefile
Normal file
19
materials/chapter4/Makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
# 注意:为了保持生成的文件宽度相同,每个源文件最长的行应该都保持为80,不够的可以在某一行末尾添空格
|
||||
# 理论上各种Mono的字体应该都可以满足,但实际测试发现很多字体并不能保证生成的字符宽度一致。
|
||||
|
||||
%.c.png:%.c
|
||||
pygmentize -f png -O encoding=utf8,font_name='SimSun',line_numbers=False $< -o $@
|
||||
# pygmentize -f png -O encoding=utf8,font_name='Noto Sans Mono CJK SC',line_numbers=False $< -o $@
|
||||
|
||||
%.S.png:%.S
|
||||
pygmentize -f png -O encoding=utf8,font_name='SimSun',line_numbers=False $< -o $@
|
||||
# pygmentize -f png -O encoding=utf8,font_name='Noto Sans Mono CJK SC',line_numbers=False $< -o $@
|
||||
|
||||
%.txt.png:%.txt
|
||||
pygmentize -f png -O encoding=utf8,font_name='SimSun',line_numbers=False $< -o $@
|
||||
|
||||
all: fun.c.png fun_mips.S.png fun_la.S.png varg.c.png simple.c.png simple.S.png simple_nofp.S.png normal.c.png normal.S.png dynamic.c.png dynamic.S.png keyboard_interrupt.txt.png syscall_write.S.png
|
||||
@echo 'done'
|
||||
|
||||
clean:
|
||||
rm -f *.png
|
||||
7
materials/chapter4/context_switch.csv
Normal file
7
materials/chapter4/context_switch.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
场景,上下文切换时保存和恢复的内容
|
||||
函数调用,部分寄存器(包括栈帧相关的$sp,$fp)、返回地址
|
||||
中断和异常,(通常情况)全部定点寄存器、异常现场信息、异常相关信息
|
||||
系统调用,部分定点寄存器(包括栈帧相关寄存器)、异常现场信息
|
||||
线程,全部用户态寄存器、TLS、当前PC等相关信息
|
||||
进程,全部用户态寄存器、页表基址等控制寄存器、当前PC等相关信息
|
||||
虚拟机,虚拟CPU状态(寄存器、必要的特权资源等)
|
||||
|
24
materials/chapter4/dynamic.S
Normal file
24
materials/chapter4/dynamic.S
Normal file
@@ -0,0 +1,24 @@
|
||||
dynamic:
|
||||
addi.d $sp,$sp,-32
|
||||
st.d $fp,$sp,16 #保存fp
|
||||
st.d $ra,$sp,24 #保存ra
|
||||
addi.d $fp,$sp,32 # fp指向入口时的sp
|
||||
addi.d $sp,$sp,-64 # alloca
|
||||
addi.d $a0,$sp,16 # 从sp+16到sp+80为分配的alloca空间
|
||||
addi.w $t0,$zero,291 # 0x123
|
||||
stptr.d $t0,$a0,0
|
||||
addi.w $t0,$zero,9 # 0x9
|
||||
stptr.d $t0,$sp,0 # sp到sp+16为调子函数的参数区
|
||||
addi.w $a7,$zero,8 # 0x8
|
||||
addi.w $a6,$zero,7 # 0x7
|
||||
addi.w $a5,$zero,6 # 0x6
|
||||
addi.w $a4,$zero,5 # 0x5
|
||||
addi.w $a3,$zero,4 # 0x4
|
||||
addi.w $a2,$zero,3 # 0x3
|
||||
addi.w $a1,$zero,291 # 0x123
|
||||
bl %plt(nested)
|
||||
addi.d $sp,$fp,-32
|
||||
ld.d $ra,$sp,24
|
||||
ld.d $fp,$sp,16
|
||||
addi.d $sp,$sp,32
|
||||
jr $ra
|
||||
11
materials/chapter4/dynamic.c
Normal file
11
materials/chapter4/dynamic.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <alloca.h>
|
||||
|
||||
extern long
|
||||
nested(long a, long b, long c, long d, long e, long f, long g, long h, long i);
|
||||
|
||||
long dynamic(void){
|
||||
long *p = alloca(64);
|
||||
p[0] = 0x123;
|
||||
|
||||
return nested((long)p, p[0], 3, 4, 5, 6, 7, 8, 9);
|
||||
}
|
||||
8
materials/chapter4/fun.c
Normal file
8
materials/chapter4/fun.c
Normal file
@@ -0,0 +1,8 @@
|
||||
extern void abort(void);
|
||||
int fun(double a1, double a2, double a3, double a4, double a5, double a6,
|
||||
double a7, double a8, double a9, int a10, double a11, int a12)
|
||||
{
|
||||
if (a9 != a11) abort();
|
||||
return 0;
|
||||
}
|
||||
|
||||
12
materials/chapter4/fun_la.S
Normal file
12
materials/chapter4/fun_la.S
Normal file
@@ -0,0 +1,12 @@
|
||||
fun:
|
||||
movgr2fr.d $f0,$a0 # 注意这两行, $f0是参数a9,从$a0获得)
|
||||
movgr2fr.d $f1,$a2 # $f1从$a2获得,即参数a11
|
||||
fcmp.ceq.d $fcc0,$f1,$f0 # 比较a9和a11
|
||||
bceqz $fcc0,.L8
|
||||
move $a0,zero
|
||||
jr $ra
|
||||
.L8:
|
||||
addi.d $sp,$sp,-16
|
||||
st.d $ra,$sp,8
|
||||
bl %plt(abort)
|
||||
ld.d $ra,$sp,8
|
||||
22
materials/chapter4/fun_mips.S
Normal file
22
materials/chapter4/fun_mips.S
Normal file
@@ -0,0 +1,22 @@
|
||||
fun:
|
||||
daddiu $sp,$sp,-16
|
||||
ldc1 $f1,16($sp) #a9从$sp + 16获得
|
||||
ldc1 $f0,32($sp) #a11从$sp + 32获得
|
||||
sd $28,0($sp)
|
||||
lui $28,%hi(%neg(%gp_rel(fun)))
|
||||
c.eq.d $fcc0,$f1,$f0
|
||||
daddiu $28,$28,%lo(%neg(%gp_rel(fun)))
|
||||
sd $31,8($sp)
|
||||
bc1f $fcc0,.L5
|
||||
daddu $28,$28,$25
|
||||
ld $31,8($sp)
|
||||
ld $28,0($sp)
|
||||
move $2,$0
|
||||
jr $31
|
||||
daddiu $sp,$sp,16
|
||||
|
||||
.L5:
|
||||
ld $25,%call16(abort)($28)
|
||||
.reloc 1f,R_MIPS_JALR,abort
|
||||
1: jalr $25
|
||||
nop
|
||||
19
materials/chapter4/keyboard_interrupt.txt
Normal file
19
materials/chapter4/keyboard_interrupt.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
[ 1075.597624] [<9000000000c4b1b0>] input_event+0x30/0xc8
|
||||
[ 1075.597626] [<9000000000ca3ee4>] hidinput_report_event+0x44/0x68
|
||||
[ 1075.597628] [<9000000000ca1e30>] hid_report_raw_event+0x230/0x470
|
||||
[ 1075.597631] [<9000000000ca21a4>] hid_input_report+0x134/0x1b0
|
||||
[ 1075.597632] [<9000000000cb07ac>] hid_irq_in+0x9c/0x280
|
||||
[ 1075.597634] [<9000000000be9cf0>] __usb_hcd_giveback_urb+0xa0/0x120
|
||||
[ 1075.597636] [<9000000000c23a7c>] finish_urb+0xac/0x1c0
|
||||
[ 1075.597638] [<9000000000c24b50>] ohci_work.part.8+0x218/0x550
|
||||
[ 1075.597640] [<9000000000c27f98>] ohci_irq+0x108/0x320
|
||||
[ 1075.597642] [<9000000000be96e8>] usb_hcd_irq+0x28/0x40
|
||||
[ 1075.597644] [<9000000000296430>] __handle_irq_event_percpu+0x70/0x1b8
|
||||
[ 1075.597645] [<9000000000296598>] handle_irq_event_percpu+0x20/0x88
|
||||
[ 1075.597647] [<9000000000296644>] handle_irq_event+0x44/0xa8
|
||||
[ 1075.597648] [<900000000029abfc>] handle_level_irq+0xdc/0x188
|
||||
[ 1075.597651] [<90000000002952a4>] generic_handle_irq+0x24/0x40
|
||||
[ 1075.597652] [<900000000081dc50>] extioi_irq_dispatch+0x178/0x210
|
||||
[ 1075.597654] [<90000000002952a4>] generic_handle_irq+0x24/0x40
|
||||
[ 1075.597656] [<9000000000ee4eb8>] do_IRQ+0x18/0x28
|
||||
[ 1075.597658] [<9000000000203ffc>] except_vec_vi_end+0x94/0xb8
|
||||
11
materials/chapter4/la_reg.csv
Normal file
11
materials/chapter4/la_reg.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
寄存器编号,助记符,使用约定
|
||||
0,zero,总是为0
|
||||
1,ra,子程序返回地址
|
||||
2,tp,Thread Pointer,指向线程私有存储区
|
||||
3,sp,栈指针
|
||||
4~11,a0~a7,子程序的前八个参数
|
||||
4~5,v0~v1,v0/v1是a0/a1的别名,用于表示返回值
|
||||
12~20,t0~t8,不需保存的暂存器
|
||||
21,Reserved,暂时保留不用
|
||||
22,fp,Frame Pointer,栈帧指针
|
||||
23-31,s0~s8,寄存器变量,子程序使用需要保存和恢复
|
||||
|
14
materials/chapter4/mips_reg.csv
Normal file
14
materials/chapter4/mips_reg.csv
Normal file
@@ -0,0 +1,14 @@
|
||||
寄存器编号,O32助记符,N32/N64助记符,使用约定
|
||||
0,zero,zero,总是为0
|
||||
1,at,at,汇编暂存器
|
||||
2~3,"v0,v1","v0,v1",子程序返回值
|
||||
4~7,a0~a3,a0~a3,子程序的前几个参数
|
||||
8~11,t0~t3,a4~a7,N32作为参数,O32作为不需保存的暂存器
|
||||
12~15,t4~t7,t0~t3,不需保存的暂存器,但N32和O32命名不同
|
||||
16~23,s0~s7,s0~s7,寄存器变量,过程调用时需要存储和恢复
|
||||
24~25,"t8,t9","t8,t9",暂存器
|
||||
26~27,"k0,k1","k0,k1",为异常处理保留
|
||||
28,gp,gp,全局指针
|
||||
29,sp,sp,栈指针
|
||||
30,s8/fp,s8/fp,寄存器变量,或作为帧指针
|
||||
31,ra,ra,子程序返回地址
|
||||
|
17
materials/chapter4/normal.S
Normal file
17
materials/chapter4/normal.S
Normal file
@@ -0,0 +1,17 @@
|
||||
normal:
|
||||
addi.d $sp,$sp,-32
|
||||
addi.w $t0,$zero,9 # 0x9
|
||||
stptr.d $t0,$sp,0
|
||||
addi.w $a7,$zero,8 # 0x8
|
||||
addi.w $a6,$zero,7 # 0x7
|
||||
addi.w $a5,$zero,6 # 0x6
|
||||
addi.w $a4,$zero,5 # 0x5
|
||||
addi.w $a3,$zero,4 # 0x4
|
||||
addi.w $a2,$zero,3 # 0x3
|
||||
addi.w $a1,$zero,2 # 0x2
|
||||
addi.w $a0,$zero,1 # 0x1
|
||||
st.d $ra,$sp,24
|
||||
bl %plt(nested)
|
||||
ld.d $ra,$sp,24
|
||||
addi.d $sp,$sp,32
|
||||
jr $ra
|
||||
4
materials/chapter4/normal.c
Normal file
4
materials/chapter4/normal.c
Normal file
@@ -0,0 +1,4 @@
|
||||
extern int nested(int a, int b, int c, int d, int e, int f, int g, int h, int i);
|
||||
int normal(void){
|
||||
return nested(1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
}
|
||||
9
materials/chapter4/simple.S
Normal file
9
materials/chapter4/simple.S
Normal file
@@ -0,0 +1,9 @@
|
||||
simple:
|
||||
addi.d $sp,$sp,-16
|
||||
st.d $fp,$sp,8
|
||||
addi.d $fp,$sp,16
|
||||
ld.d $fp,$sp,8
|
||||
bstrpick.w $a0,$a0,7,0
|
||||
add.w $a0,$a0,$a1
|
||||
addi.d $sp,$sp,16
|
||||
jr $ra
|
||||
3
materials/chapter4/simple.c
Normal file
3
materials/chapter4/simple.c
Normal file
@@ -0,0 +1,3 @@
|
||||
int simple(int a, int b) {
|
||||
return ((a&0xff)+b);
|
||||
}
|
||||
4
materials/chapter4/simple_nofp.S
Normal file
4
materials/chapter4/simple_nofp.S
Normal file
@@ -0,0 +1,4 @@
|
||||
simple:
|
||||
bstrpick.w $a0,$a0,7,0
|
||||
add.w $a0,$a0,$a1
|
||||
jr $ra
|
||||
11
materials/chapter4/syscall.csv
Normal file
11
materials/chapter4/syscall.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
类型,系统调用,调用号,作用
|
||||
进程控制,clone,220,克隆一个进程
|
||||
进程控制,execv,221,执行一个程序
|
||||
文件读写,read,63,读文件
|
||||
文件读写,write,64,写文件
|
||||
文件系统,mkdir,34,创建目录
|
||||
文件系统,mount,40,挂载文件系统
|
||||
系统控制,gettimeofday,169,获取系统时间
|
||||
系统控制,reboot,142,重新启动
|
||||
内存管理,mmap,222,映射虚拟内存页
|
||||
信号量,semctl,191,信号量控制
|
||||
|
15
materials/chapter4/syscall_write.S
Normal file
15
materials/chapter4/syscall_write.S
Normal file
@@ -0,0 +1,15 @@
|
||||
.section .rodata
|
||||
.align 3
|
||||
.hello:
|
||||
.ascii "Hello World!\012\000"
|
||||
|
||||
.text
|
||||
.align 3
|
||||
.global main
|
||||
main:
|
||||
li $a7, 64 #write的系统调用号
|
||||
li $a0, 1 # fd == 1是stdout的文件描述符号
|
||||
la.local $a1, .hello # 字符串地址
|
||||
li $a2, 14 # 字符串长度
|
||||
syscall 0x0
|
||||
jr $ra # 返回
|
||||
1
materials/chapter4/t.S
Normal file
1
materials/chapter4/t.S
Normal file
@@ -0,0 +1 @@
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
|
||||
5
materials/chapter4/t.c
Normal file
5
materials/chapter4/t.c
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
IIIIIIIIII
|
||||
HHHHHHHHHH
|
||||
AAAAATTTTT
|
||||
ATATATATAT
|
||||
8
materials/chapter4/varg.c
Normal file
8
materials/chapter4/varg.c
Normal file
@@ -0,0 +1,8 @@
|
||||
struct Ss {
|
||||
char c1, c2;
|
||||
} a3 = {3, 4};
|
||||
int fun (double a1, ...);
|
||||
int test () {
|
||||
return fun (1, (float) 2, a3, (long double) 5, (float) 6,
|
||||
(short) 7, (int) 8, (float) 9, (int)10);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user