cord2.1
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 105 行
1
105 行
.TH cord2 1 RISC.SH Namecord2 \- rearranges basic blocks in an executable file to facilitatebetter cache mapping..SH Syntax.B "cord2 [-v] [-o \fIoutfile]\fB [-c \fIcachewords\fB] [-d] [-b \fIbridge_limit\fB] [-n] [-A \fIaddersfile\fB] [[-C \fIcountsfile\fB] ...] \fIobj\fB".SH DescriptionThe \fBcord2\fR commandextracts basic blocks from a program and deposits them in a newarea in the text, making jumps to and from that area as necessary.By separating the basic blocks, you canreduce instruction cache miss rates. The.B cord2 command takes the output of a pixie profiling run as input (see .MS pixie 1 )..PPThe executable object file has the suffix .I obj.The \fBcord2\fR command only requires one \fIaddersfile\fR; it creates the filenameby appending \fI.Bbaddrs\fR to the \fIobj\fR filename if none is specified with \fB-A\fR. Multiple counts files can be specified from many runs with multiple \fB-C\fR arguments. If none are specified, \fBcord2\fR creates the counts filename by appending \fI.Counts\fR to the \fIobj\fR name..PPMultiple counts files are added together into an internal counts arrayrepresented with C double-type elements. The counts array elements containthe density of a block or cycles/byte. If you specify \fB-n\fR, thenthe counts are normalized so that each counts array entry iscycles/totalcycles. When one counts file is specified, the default is to favorsmall blocks; \fB-n\fR negates that. When many counts files are specified,\fB-n\fR also negates favoring one counts file. This is because its totalcyclesmay exceed the totalcycles of another counts file..PPThe\fBcord2\fR command determines which basic blocks to insert by sorting thecounts array and collecting the blocks with the highest counts that canfit into the new area. The \fBcord2\fR command may skip over huge blocks that do not fit at the end of the new area..PPOnce the blocks are determined, they are inserted into the new area, and theiroriginal location is modified to jump to the new area. At the end ofeach block in the new area, a jump is added back to the original block'ssubsequent or fall-through location, and the branch/jump target(if necessary). Both entering and exiting the new area is optimized to take advantage of other blocks in the new area and jump delay slots..PPOften, there may be one or more fall-through blocks of a block inthe new area which are small, hardly ever used, and not in thenew area. If the block following these fall-through blocks is in thenew area, the fall-through blocks are called bridge blocks. It may bemore costly to generate jumps to and from bridge blocks rather than to simply copy them..PPThe\fBcord2\fR command allows you to specify that bridge blocks be added to the new area if they total less than the \fIbridge_limit\fR instructions between two new-area blocks. You can specify the \fIbridge_limit\fR with \fB-b\fR; the default is zero. Bridge blocks can bump blocks out of the new area that might normally fit into it..PP.NTBecause the \fBcord2\fR command works from profile output, the resulting binary is data dependent. In other words, it may perform well only on the same input data that generated the profile information, and may perform worse than the original binary on other data. Furthermore, if the hot areas in the cache do not fit well into one cachepage, performance can degrade..NE.SH OptionsThe .B cord2command also accepts these options:.TP 5.B -dFill the delay slots with nops only when adding jumps to and from the new area..TP 5.B -vPrint verbose information. This includes statistics about the \fBcord2\fRprocess..TP 5.B "-v -v"Print all of the \fB-v\fR information, but include detailed disassemblies ofthe code moved, changed, and generated by \fBcord2\fR..TP 5.B "-c cachewords"Specify the number of words in the cache of the machine on which youwant to execute. This is actually the size of the new area. The\fIcachesize\fR may be a misnomer, as you can specify a size otherthan your machine's cache size; however, it is probably the correct number..TP 5.B "-o outputfile"Specify the output file. If it is not specified, the default is \fIa.out.cord2\fR..SH RestrictionsThe .B cord2command adds the new area to the end of text so any program using the\fIetext\fR symbol may not work. See .MS ld 1 ..SH See Alsopixie(1), cord(1)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?