%%
%%Thisfilecontainstlccodeforgenerationof
%%fixedpointcasting
%%
%%Copyright1994-2011TheMathWorks,Inc.
%%
 
%%Function:FixPt_Fix2FixAlwaysOutput========================================
%%
%%Abstract:
%%SameasFixPt_Fix2Fixexceptthatconversionisalwaysoutput
%%WithFixPt_Fix2Fix,iftheconversionissimplethentheconversion
%%isreturnedinastringthatcanbeinsertedintodownstreamoperations.
%%Thisisusefulforoptimizations,butmakesuseofthefunctionmore
%%difficultwhentheoptimizationsarenotwanted/needed.
%%
%%CAUTION
%%uLabelmustbea"precedenceimmuneexpression"
%%Topreventanexplosionofunnecessaryparenthesesinthegenerated
%%code,defensiveparentheseswillNOTbewrappedaroundtheinput.
%%Itisthecallersresponsiblilitytoincludeouterparenthesesin
%%uLabelifthereisanyhypotheticalwayfortheexpressiontogive
%%incorrectexecutionorderwheninsertedinalargerexpression.
%%
%function FixPt_Fix2FixAlwaysOutput(yLabel,yDT,uLabel,uDT,roundMode,satMode) Output
    %%
    %<FixPt_WordLengthLimitationCheck(uDT)>/
    %<FixPt_WordLengthLimitationCheck(yDT)>/
    %%
    %assign vecCGIR = FixPt_UnaryOp("Fix2Fix", yLabel, yDT, uLabel, uDT, ...
      roundMode, satMode)
    %%
    %
%endfunction
 
%%Function:FixPt_Fix2Fix==========================================
%%
%%Abstract:
%%FixedPointtoFixedPointConversion
%%
%%Synopsis:
%%FixPt_Fix2Fix(yLabel,yDT,uLabel,uDT,roundMode,satMode)
%%
%%yLabel,yDT=recorddescribingoutput
%%uLabel,uDT=recorddescribinginput
%%roundMode=stringspecifyingroundto"Zero","Nearest",etc.
%%satMode=stringspecifying"Wrap"or"Saturate"onoverflow
%%
%%CAUTION
%%uLabelmustbea"precedenceimmuneexpression"
%%Topreventanexplosionofunnecessaryparenthesesinthegenerated
%%code,defensiveparentheseswillNOTbewrappedaroundtheinput.
%%Itisthecallersresponsiblilitytoincludeouterparenthesesin
%%uLabelifthereisanyhypotheticalwayfortheexpressiontogive
%%incorrectexecutionorderwheninsertedinalargerexpression.
%%
%function FixPt_Fix2Fix(yLabel,yDT,uLabel,uDT,roundMode,satMode) Output
  %%
  %assign uLabel = SLibProcessSafeExpression(Name, uLabel, 1)
  %%
  %% CGIR callback
  %%
  %<FixPt_WordLengthLimitationCheck(uDT)>/
  %<FixPt_WordLengthLimitationCheck(yDT)>/
  %%
  %assign vecCGIR = FixPt_UnaryOp("Fix2Fix", yLabel, yDT, uLabel, uDT, ...
    roundMode, satMode)
  %%
  %if !ISEMPTY(vecCGIR[1])
    %%
    %% expression available
    %%
    %return ["%", "%", "%"]
  %else
    %%
    %% must use statements
    %%
    %
    %return ""
  %endif
%endfunction %% FixPt_Fix2Fix