Detect Analog VisualDSP++ compiler version with its id

Decode hex digits from __VISUALDSPVERSION__ to compute the version
number components.  Note that the constant encodes decimal digits as hex
digits (never larger than 9).  We represent them as decimal after
extraction.  See documentation at:

  http://download.analog.com/dsp/tools/VisualDSP_45_Update_6_Release_Note_v4.pdf
  http://www.analog.com/static/imported-files/software_manuals/50_asm_man.rev3.1.pdf

Note that __VISUALDSPVERSION__ was introduced in version 4.5.6.
This commit is contained in:
Brad King 2012-08-22 11:48:07 -04:00
parent cca386b0a0
commit e9bc502fb8
2 changed files with 18 additions and 4 deletions

View File

@ -147,9 +147,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif # endif
/* Analog VisualDSP++ >= 4.5.6 */
#elif defined(__VISUALDSPVERSION__)
# define COMPILER_ID "ADSP"
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
/* Analog VisualDSP++ < 4.5.6 */
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
SHARC (21000) DSPs */
# define COMPILER_ID "ADSP" # define COMPILER_ID "ADSP"
/* IAR Systems compiler for embedded systems. /* IAR Systems compiler for embedded systems.

View File

@ -149,9 +149,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif # endif
/* Analog VisualDSP++ >= 4.5.6 */
#elif defined(__VISUALDSPVERSION__)
# define COMPILER_ID "ADSP"
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
/* Analog VisualDSP++ < 4.5.6 */
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
SHARC (21000) DSPs */
# define COMPILER_ID "ADSP" # define COMPILER_ID "ADSP"
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)