f0 = float r11 by 31;
gives Syntax Error at "31".
f0 = float r11 by -31;
gives Syntax Error at "-".
f0=float r11 by r13;
Assember version is SHARC Family Assembler 188.8.131.52
Command line is:
"C:\Analog Devices\CrossCore Embedded Studio 2.8.1"\easm21k.exe -proc ADSP-SC589 -si-revision 1.0 -g -W1130 -l Build\converter_fix_to_float_with_DC_offset_filter_multi_channel_.l -save-temps -D_DEBUG -D_INCLUDE_LEGACY_SYSREG_NAMES -iC:\SVN\3.0.0_graham_dev\NionDSP\pion_dsp\algos -iC:\SVN\3.0.0_graham_dev\NionDSP\pion_dsp -i"C:\Analog Devices\CrossCore Embedded Studio 2.8.1"\SHARC\include -nwc -char-size-32 ..\algos\converter_fix_to_float_with_DC_offset_filter_multi_channel_.asm -o Build\converter_fix_to_float_with_DC_offset_filter_multi_channel_.doj
I have found out that a constant scale factor is not supported depite there being an example using a constant in the SHARC assembler manual.
Immediate operands are supported in shifter operations such as LSHIFT, ROT or BTGL, but not in ALU floating-point operations such as FLOAT. In which section of the manual did you see the incorrect example?
Document: SHARC+ Core Programming Reference
Revision: Revision 1.2, August 2019
Section: Fixed-to-Float Conversion Instructions with Scaling
Fixed-to-Float Conversion Instructions with Scaling
The ALU supports conversion between floating- and fixed-point by using a scaling factor as shown in the following example.
Fn = FLOAT Rx by 31; /* floating-point [-1.0 to 1.0] */
Rn = FIX Fx by 31 /* fixed-point 1.31 format */
Thank you very much for the report. It looks like there's another mistake there in that the scaling factor for the FLOAT operation needs to be -31 to scale into range [-1.0..1.0)