www.ti.com
5.2UseofFloatingPoint
5.3TMS320C6xxxRulesandGuidelines
5.3.1EndianByteOrdering
5.3.2DataModels
5.3.3ProgramModel
UseofFloatingPoint
Itisimportanttonotethattheuseofglobalregistersbyalgorithmsispermitted.However,like
self-modifyingcode,theirusemustbeinvisibletoclients.Thiscanbeaccomplishedbyeithernever
modifyingglobalregistersorbydisablinginterruptsaroundthosesectionsthatmodifyandrestoreglobal
registers.
ReferencingthefloatdatatypeinanalgorithmonafixedpointDSPcausesalargefloatingpointsupport
librarytobeincludedinanyapplicationthatusesthealgorithm.
Guideline11
Algorithmsshouldavoidtheuseofthefloatdatatype.
ThissectiondescribestherulesandguidelinesthatarespecifictotheTMS320C6000familyofDSPs.
TheC6xfamilysupportsbothbigandlittleendiandataformats.Thissupporttakestheformof"boottime"
configuration.TheDSPisconfiguredatboottimetoaccessmemoryeitherasbigendianorlittleendian
andthissettingremainsfixedforthelifetimeoftheapplication.
Thechoiceofwhichdataformattouseisoftendecidedbasedonthepresenceofotherprocessorsinthe
system;thedataformatoftheotherprocessors(whichmaynotbeconfigurable)determinesthesettingof
theC6xdataformat.Thus,itisnotpossibletosimplychooseasingledataformatforall
eXpressDSP-compliantalgorithms
Rule25
AllC6xalgorithmsmustbesuppliedinlittleendianformat.
Guideline12
AllC6xalgorithmsshouldbesuppliedinbothlittleandbigendianformats.
TheC6xCcompilersupportsavarietyofdatamodels;onesmallmodelandmultiplelargemodelmodes.
Fortunately,itisrelativelyeasytomixthevariousdatamemorymodelsinasingleapplication
Programswillachieveoptimalperformanceusingsmallmodelcompilation.Thismodellimits,however,the
totalsizeofthedirectlyaccesseddatainanapplicationto32Kbytes(intheworstcase).Sincealgorithms
areintendedforuseinverylargeapplications,alldatareferencesshouldbefarreferences.
Rule26
AllC6xalgorithmsmustaccessallstaticandglobaldataasfardata.
Rule27
C6xalgorithmsmustneverassumeplacementinon-chipprogrammemory;i.e.,theymustproperly
operatewithprogrammemoryoperatedincachemode.
SPRU352G–June2005–RevisedFebruary2007DSP-SpecificGuidelines47
SubmitDocumentationFeedback