Transcription of TMS320C6000 Optimizing Compiler v 7.4 User's …
1 's ++ ++ ++ 's (--silicon_versionOption).. (C6X_C_OPTION).. (C6X_C_DIR).. # PreprocessedListingFile(--preproc_onlyOp tion).. (--preproc_with_compileOption).. PreprocessedListingFileWithComments(--pr eproc_with_commentOption).. PreprocessedListingFileWithLine-ControlI nformation(--preproc_with_lineOption).. MakeUtility(--preproc_dependencyOption). . ListofFilesIncludedWiththe#includeDirect ive(--preproc_includesOption).. ListofMacrosin a File(--preproc_macrosOption).. July2012 SubmitDocumentationFeedbackCopyright 2012 , (--gen_acp_xrefOption).. RawListingFile(--gen_acp_rawOption).. (--interrupt_thresholdOption).. (--disable_software_pipeliningOption).. +,C6740, (--opt_for_space(or-ms)Option).. (--opt_level=3option).. (--std_lib_func_defOptions).. (--gen_opt_infoOption).. (--program_level_compileand--opt_level=3 options).. (--call_assumptionsOption).. ++ (CSV)FileswithWeightedCallGraph(WCG) unordered().. (--auto_inlineOption).. July2012 ContentsSubmitDocumentationFeedbackCopyr ight 2012 , BeingPerformed?
2 (Default).. ++ (-zOption).. (--compile_onlyCompilerOption).. (--gen_func_subsectionsCompilerOption).. ++ ++.. July2012 SubmitDocumentationFeedbackCopyright 2012 , ++ (Linknames).. C (--kr_compatibleOption).. (--strict_ansiand--relaxed_ansiOptions). . ++Mode(--embedded_cppOption).. July2012 ContentsSubmitDocumentationFeedbackCopyr ight 2012 , ++ FunctionMakesa andC++ ++ ++.. ++ ++ andC++ July2012 SubmitDocumentationFeedbackCopyright 2012 , User-DefinedDeviceDriverforC (_register_lock()and_register_unlock()Fu nctions).. ++ ++ ++ ++ July2012 ContentsSubmitDocumentationFeedbackCopyr ight 2012 , July2012 SubmitDocumentationFeedbackCopyright 2012 , July2012 ListofTablesSubmitDocumentationFeedbackC opyright 2012 , ++ ++ ++ ++ ,C6400+,C6740,andC6600C/C++ +,C6740,andC6600C/C++ ,C6700+,C6740,andC6600C/C++ ++ ++ July2012 SubmitDocumentationFeedbackCopyright 2012 ,TexasInstrumentsIncorporatedPreface SPRU187U July2012 ReadThisFirstAboutThisManualTheTMS320C60 00 OptimizingCompilerUser'sGuideexplainshow tousethesecompilertools.
3 Compiler Assemblyoptimizer Librarybuildutility C++namedemanglerThecompileracceptsC andC++codeconformingtotheInternationalOr ganizationforStandardization(ISO) languageandthe1998versionoftheC++ 'sguidediscussesthecharacteristicsoftheC /C++ assumesthatyoualreadyknowhowtowriteC/C++ ProgrammingLanguage(secondedition), ,describesC basedontheISOC (hereafterreferredtoasK&R)bookasa C (asopposedtoISOC)in thismanualrefertotheC languageasdefinedin thefirsteditionofKernighanandRitchie'sTh eC : Programlistings,programexamples,andinter activedisplaysareshownin boldversionofthespecialtypefacetodisting uishcommandsthatyouenterfromitemsthatthe systemdisplays(suchasprompts,commandoutp ut,errormessages,etc.).Hereis a sampleofC code:#include< >main(){printf("hello,cruelworld\n");} Insyntaxdescriptions,theinstruction,comm and,ordirectiveis in aboldtypefaceandparametersarein anitalictypeface. Portionsofa syntaxthatarein boldshouldbeenteredasshown;portionsofasy ntaxthatarein italicsdescribethetypeofinformationthats houldbeentered.
4 Squarebrackets( [ and] ) youuseanoptionalparameter, theboldtypeface, anexampleofa commandthathasanoptionalparameter:cl6x[o ptions] [filenames] [--run_linker[link_options] [objectfiles]] Braces( { and} ) indicatethatyoumustchooseoneoftheparamet erswithinthebraces; anexampleofa commandwithbracesthatarenotincludedin theactualsyntaxbutindicatethatyoumustspe cifyeitherthe--rom_modelor--ram_modelopt ion:cl6x--run_linker{--rom_model| --ram_model}filenames[--output_file= ]--library=libraryname11 SPRU187U July2012 ReadThisFirstSubmitDocumentationFeedback Copyright 2012 , Inassemblersyntaxstatements,column1 is reservedforthefirstcharacterofa thelabelorsymbolis optional,it is it is a requiredparameter,it is shownstartingagainsttheleftmarginofthebo x,asin ,command,directive,orparameter,otherthan a symbolorlabel,canbeginin "sectionname",sizein bytes[,alignment] Somedirectivescanhavea , shownas[, ..,parameter]. TheTMS320C6200 coreis ,C6400,C6400+,C6700,C6700+,C6740, ' ,ProgrammingLanguage- C (Alternateversionofthe1989C Standard), AmericanNationalStandardsInstituteISO/IE C9899:1989,InternationalStandard- ProgrammingLanguages- C (The1989C Standard),InternationalOrganizationforSt andardizationISO/IEC9899:1999,Internatio nalStandard- ProgrammingLanguages- C (TheC Standard),InternationalOrganizationforSt andardizationISO/IEC14882-1998,Internati onalStandard- ProgrammingLanguages- C++(TheC++Standard),InternationalOrganiz ationforStandardizationTheC ProgrammingLanguage(secondedition), ,publishedbyPrentice-Hall,EnglewoodCliff s,NewJersey,1988 TheAnnotatedC++ReferenceManual, ,publishedbyAddison-WesleyPublishingComp any,Reading,Massachusetts,1990C:A ReferenceManual(fourthedition), , ,publishedbyPrenticeHall,EnglewoodCliffs ,NewJerseyProgrammingEmbeddedSystemsinC andC++, byMichaelBarr,AndyOram(Editor),published byO'Reilly& Associates.
5 ISBN:1565923545,February1999 ProgramminginC, ,HaydenBookCompanyTheC++ProgrammingLangu age(secondedition), BjarneStroustrup,publishedbyAddison-Wesl eyPublishingCompany,Reading,Massachusett s,1990 ToolInterfaceStandards(TIS) ,TISC ommittee,1995 DWARFD ebuggingInformationFormatVersion3, DWARFD ebuggingInformationFormatWorkgroup,FreeS tandardsGroup,2005( )12 ReadThisFirstSPRU187U July2012 SubmitDocumentationFeedbackCopyright 2012 , 'sguide:SPRAAB5 TMS320C6000 AssemblyLanguageToolsUser' (assembler,linker,andothertoolsusedtodev elopassemblylanguagecode),assemblerdirec tives,macros,commonobjectfileformat,ands ymbolicdebuggingdirectivesfortheTMS320C6 000platformofdevices(includingtheC64x+an dC67x+generations).SPRU190 (DSPs).SPRU198 TMS320C6000 Programmer' (DSPs).Beforeyouusethismanual, briefdescriptionoftheC6000 DSParchitectureandcodedevelopmentflow,in cludesC codeexamplesanddiscussesoptimizationmeth odsfortheCcode,describesthestructureofas semblycodeandincludesexamplesanddiscusse soptimizationsfortheassemblycode, (DSPs) ,peripherals, TMS320 DSP/BIOSUser' (DSPs) ,pipeline,instructionset,andinterruptsfo rtheTMS320C62xdigitalsignalprocessors(DS Ps) TMS320C64x/C64x+ ,pipeline,instructionset,andinterruptsfo rtheTMS320C64xandTMS320C64x+digitalsigna lprocessors(DSPs) +DSPgenerationcomprisesfixed-pointdevice sin +DSPis TMS320C67x/C67x+ ,pipeline,instructionset,andinterruptsfo rtheTMS320C67xandTMS320C67x+digitalsigna lprocessors(DSPs) +DSPgenerationcomprisesfloating-pointdev icesin +DSPis ,pipeline,instructionset,andinterruptsfo rtheTMS320C66xdigitalsignalprocessors(DS Ps)
6 , July2012 ReadThisFirstSubmitDocumentationFeedback Copyright 2012 ,TexasInstrumentsIncorporatedChapter 1 SPRU187U July2012 IntroductiontotheSoftwareDevelopmentTool sTheTMS320C6000 is supportedbya setofsoftwaredevelopmenttools,whichinclu desanoptimizingC/C++ Compiler , anassemblyoptimizer,anassembler,a linker, ++ discussedinChapter4. Theassemblerandlinkerarediscussedindetai lin theTMS320C6000 AssemblyLanguageToolsUser' ++ July2012 SubmitDocumentationFeedbackCopyright 2012 ,TexasInstrumentsIncorporatedC/C++so urcefilesC/C++compilerAssemblersourceAss emblerExecutableobject fileDebuggingtoolsLibrary-buildutilityRu n-time-supportlibraryArchiverArchiverMac rolibraryAbsolute listerHex-conversionutilityCross-referen celisterObject fileutilitiesC6000 Link stepLinearassemblyAssemblyoptimizerAssem blyoptimizedfileMacrosourcefilesObjectfi lesEPROM programmerLibrary Figure1-1: acceptsassemblycodethathasnotbeenregiste r-allocatedandis ThecompileracceptsC/C++ July2012 IntroductiontotheSoftwareDevelopmentTool sSubmitDocumentationFeedbackCopyright 2012 ,TexasInstrumentsIncorporatedC/C++ 'sGuideexplainshowtousetheassembler.
7 Thelinkercombinesrelocatableobjectfilesi ntoa createstheexecutablefile,it TheTMS320C6000 AssemblyLanguageToolsUser'sGuideprovides a completedescriptionofthelinker. Thearchiverallowsyoutocollecta groupoffilesintoa singlearchivefile, ,thearchiverallowsyoutomodifya librarybydeleting,replacing,extracting, buildinga 'sGuideexplainshowtousethearchiver. Therun-time-supportlibrariescontainthest andardISOC andC++libraryfunctions, Compiler -utilityf unctions,floating-pointarithmeticfunctio ns,andC Sourcecodeforthestandardrun-time-support libraryfunctionsforC andC++areprovidedin 'sGuideexplainshowtousethehexconversionu tilityanddescribesallsupportedformats. listingthatcontainsabsolute,ratherthanre lative, ,producingsucha 'sGuideexplainshowtousetheabsolutelister . Thecross-referencelisterusesobjectfilest oproducea cross-referencelistingshowingsymbols,the irdefinitions,andtheirreferencesin 'sGuideexplainshowtousethecross-referenc eutility. TheC++namedemangleris a debuggingaidthatconvertsnamesmangledbyth ecompilerbacktotheiroriginalnamesasdecla redin theC++ Figure1-1, youcanusetheC++namedemanglerontheassembl yfilethatis outputbythecompiler; 'sGuideexplainshowtousethedisassembler.
8 Themainproductofthisdevelopmentprocessis anexecutableobjectfilethatcanbeexecutedi n : Aninstruction-levelandclock-accuratesoft waresimulator ++ andC++languagefeaturesin thecompilerareimplementedin conformancewiththeseISOstandards: ISO-standardCTheC/C++compilerconformstot heC StandardISO/IEC9889 thesameastheANSIC alsoa 1999versionoftheISOstandard,buttheTIcomp ilerconformstothe1990standard, alsodescribedin thesecondeditionofKernighanandRitchie'sT heC ProgrammingLanguage(K&R). ISO-standardC++TheC/C++compilerconformst otheC++StandardISO/IEC14882 alsodescribedin EllisandStroustrup'sTheAnnotatedC++Refer enceManual(ARM),butthisis notthe16 IntroductiontotheSoftwareDevelopmentTool sSPRU187U July2012 SubmitDocumentationFeedbackCopyright 2012 , ++ ++.Fora descriptionofunsupportedC++features, ++ ,stringmanipulation,dynamicmemoryallocat ion,dataconversion,timekeeping,trigonome try, , , : COFF objectfilesCommonobjectfileformat(COFF)a llowsyoutodefineyoursystem' ++ ELFobjectfilesExecutableandlinkingformat (ELF) : CompilerprogramThecompilertoolsincludea compilerprogram(cl6x)thatyouusetocompile ,optimize,assemble,andlinkprogramsin a , FlexibleassemblylanguageinterfaceThecomp ilerhasstraightforwardcallingconventions ,soyoucanwriteassemblyandC , : , C++namedemanglerTheC++namedemangler(dem6 x)is a debuggingaidthattranslateseachmanglednam eit detectsincompiler-generatedassemblycode, disassemblyoutput,orcompilerdiagnosticme ssagestoitsoriginalnamefoundin theC++ ,seeChapter9.
9 HexconversionutilityForstand-aloneembedd edapplications,thecompilerhastheabilityt oplaceallcodeandinitializationdataintoRO M,allowingC/C++ ,asdescribedintheTMS320C6000 AssemblyLanguageToolsUser' July2012 IntroductiontotheSoftwareDevelopmentTool sSubmitDocumentationFeedbackCopyright 2012 ,TexasInstrumentsIncorporatedChapter 2 SPRU187U July2012 UsingtheC/C++ ,assembled, ++ 's (--gen_acp_xrefOption).. RawListingFile(--gen_acp_rawOption).. (--interrupt_thresholdOption).. ++CompilerSPRU187U July2012 SubmitDocumentationFeedbackCopyright 2012 , ,assemble,andoptionallylinkin : ThecompileracceptsC/C++sourcecodeandasse mblycode, ,C++,andassemblyfilesin a Thelinkercombinesobjectfilestocreatea , :Bydefault, completedescriptionoftheassemblerandthel inker,seetheTMS320C6000 AssemblyLanguageToolsUser' ++CompilerToinvokethecompiler,enter:cl6x [options] [filenames] [--run_linker[link_options]objectfiles]] ++sourcefiles,assemblylanguagesourcefile s,linearassemblyfiles, 's shortformis : Compileroptions Linkoptions FilenamesThe--run_linkeroptionindicatesl inkingis the--run_linkeroptionis used,anycompileroptionsmustprecedethe--r un_linkeroption, ,if ,assemblea , , July2012 UsingtheC/C++CompilerSubmitDocumentation FeedbackCopyright 2012 ,TexasInstrumentsIncorporatedChangin gtheCompiler's 's alsoprovidesdetaileddescriptionsofthemos tfrequentlyusedoptions, helpscreensummaryoftheoptions, : Optionsareprecededbyoneortwohyphens.
10 Optionsarecasesensitive. Optionsareeithersinglelettersorsequences ofcharacters. Individualoptionscannotbecombined. ,theoptiontoundefinea constantcanbeexpressedas--undefine=name. Althoughnotrecommended,youcanseparatethe optionandtheparameterwithorwithouta space,asin --undefinenameor-undefinename. ,theoptiontospecifythemaximumamountofopt imizationcanbeexpressedas-O= ,youcanspecifytheparameterdirectlyaftert heoption,asin allowedbetweentheoptionandtheoptionalpar ameter,so-O3 is notaccepted. Filesandoptionsexceptthe--run_linkeropti oncanoccurin , (includinglinkoptions).Usethereferencesi n {coffabi|eabi} (1)OptionAliasEffectSection--opt_level= (default) (0,1,2,and3) (1)Note:Machine-specificoptions(seeTable 2-11) notsupportedforC6400+orC674x, ++CompilerSPRU187U July2012 SubmitDocumentationFeedbackCopyright 2012 , 's (continued)OptionAliasEffectSection-- notsupportedforC6400+orC674x, (defaultbehavior)--disable_push_popDisab lespush-popoptimization----optimize_with _debug-mnReenablesoptimizationsdisabledw ith-- :dwarf_version=2| # (negates--run_linker) (onthestandardoutputdevice)a :keep_all_typesKeepunreferencedtypeinfor mation(defaultforELFwithdebug) C extensionasC++ ++ ++ functionstopropagateexceptions(EABI only) comments, (but--opt_level=3(or-O3) ) July2012 UsingtheC/C++CompilerSubmitDocumentation FeedbackCopyright 2012 ,TexasInstrumentsIncorporatedChangin gtheCompiler's (continued)OptionAliasEffectSection--pch _dir=.
