📄 cord.1
字号:
.TH cord 1 RISC.SH Namecord \- rearranges procedures in an executable to facilitate better cache mapping..SH Syntax.B cord [.B \-c .I cachesize] [.B \-f] [.B \-o.I outfile] [.B \-p .I maxphases] [.B \-v].I obj reorder.SH DescriptionThe .PN cordcommandrearranges procedures in an executable object to maximize efficiency ina machine's cache. By rearranging the procedures properly, the instruction cache miss rate is reduced. The .PN cord command does not attempt todetermine the correct ordering, but is given a .I reorder file containingthe desired procedure order. The .I reorder file is generated by the .PN ftocprogram which in turn generates a .I reorder file from a set ofprofile feedback files (see .MS prof 1)..NXR "cord command".PPProcessed lines in the .I reorder file are called procedure lines.Each procedure line must be on a separate source line. Each procedure line must contain thesource name of the file, followed by a blank followed by a qualifiedprocedure name (nested procedures need to be qualified x.y where x isthe outer procedure). A newline or blank can follow the procedure name:.EXfoo.c bar >>i ignore this stuff<<.EE.PPLines beginning with a pound sign (#) are comments. Lines beginning with a dollar sign ($) areconsidered.PN corddirective lines. The only directive currently understoodis .BR $phase . This directive will consider the rest of the file (until theend of file or next .BR $phase ) as a new phase of the program and will orderthe procedures accordingly. Procedures may appear in more than one phase, resulting in more than one copy of it in the final binary. The.PN cord command will try torelocate references to a procedure to a copy in the requesting phase'slist of procedures first and then a random copy if one is not found..PPYou should use the .B \-cordoption to a compiler driver like .PN ccrather than execute cord directly. Options to .PN cord can be specifiedwith .B \-Wz,\fIcordarg0,cordarg1,...\fP. If you have to run .PN cord manually, you should run it once with the driver using the .B \-vflag on asimple program to see the exact passes and their arguments involved inusing .PN cord ..PPThe.I objargument is an executable object with its relocation information intact. Thiscan be achieved by passing the .B \-r \-z \-doptions to the linker, .PN ld .The .B \-r linker option maintains relocation information in the object, but will not make it a ZMAGIC file (hence .BR \-z )nor will it allocate common variables (hence .BR \-d )as it would without the option..SH Options.IP "\-c \fIcachesize\fP" 15Specify the cachesize of the machine you want to execute on in bytes. Thisonly affects the .B \-f option. If not specified 65536 is used..IP \-fFlip the first cachepage size procedures. The assumption when .PN cordwas written was that procedures would be reordered by proceduredensity (cycles/byte). This option ensures that the densest part of eachpage following the first cachepage would conflict with least dense part of the first cachepage..IP "\-o \fIoutputfile\fP"specifies the output file. If not specified, a.out is used..IP "\-p \fIphasemax\fP"Specifies the maximum number of phases allowed. The default is 20..IP \-vPrints verbose information. This includes listing those procedures consideredpart of other procedures and cannot be rearranged (these are basicallyassembler procedures that may contain relative branches to other proceduresrather than relocatable ones). The listing also list those proceduresin the flipped area (if any) and a mapping of old location to new..SH RestrictionsSince .PN cordworks from an input list of procedures generated fromprofile output, the resulting binary is data dependent. In other words, itmay only perform well on the same input data that generated the profileinformation and may perform worse than the original binary on other data. Furthermore, if the hot areas in the cache don't fit well intoone cachepage, performance can degrade..SH See Alsocc(1), ftoc(1), ld(1), prof(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -