MSP430 C/C++ CODE GENERATION TOOLS 4.1.2 Release Notes August 2012 =============================================================================== Contents =============================================================================== 1) Features new to version 4.1.0 1.1) Ultra-Low-Power (ULP) Advisor 1.2) Vector initialization warning 1.3) Improved hardware multiply support 1.4) printf_support extended for scanf 2) Support for MSP430 EABI 2.1) Features 2.2) Usage 2.3) 64-bit "double" 2.4) Table-Driven Exception Handling 2.5) Compiler Version 3.3.0 Compatibility 2.6) Migration from COFF to ELF 3) Support for 64-bit "long long int" 4) Support for C99 floating-point functions 5) Support for C++ 6) Support for packed data types 7) Support for #pragma location 8) Support for noinit and persistent objects 9) Improved use of hardware multiply 10) More aggressive optimization by default 11) Fewer pre-built libraries, automatic library building 12) Customer Support Information 12.1) Defect History 12.2) Compiler Wiki 12.3) Compiler Documentation Errata 12.4) TI E2E Community 12.5) Defect Tracking Database ------------------------------------------------------------------------------- 1) Features new in version 4.1.0 ------------------------------------------------------------------------------- 1.1) Ultra-Low-Power (ULP) Advisor ---------------------------------- The MSP430 compiler supports a new feature, ULP Advisor, that emits remarks for power improvements. To emit power advice, use below shell option (or in CCS choose "Advanced Options > ULP Advisor"): > cl430 --advice:power=all -z -l ULP Advisor highlights: - Checks your code against an MSP430 ULP Checklist. - Rules have been created and verified by industry low power experts. - The ULP Advisor wiki includes a description of each rule, proposed remedies, code examples & links to related e2e online forum posts. - More details at: www.ti.com/ulpadvisor 1.2) Interrupt sub-routine (ISR) vector initialization warning -------------------------------------------------------------- The MSP430 linker will now emit a warning for any ISR vectors that have not been initialized. 1.3) Improved hardware multiply support ---------------------------------------- Some multiplications will be more efficient when hardware multiply support is enabled. The following multipication operations are now more efficient than they were with compiler version 4.0.x: When 16-bit multiply hardware is used: U32xU32->64 When 16-bit or 32-bit multiply hardware is used: 64x64->64 1.4) printf_support extended for scanf --------------------------------------- The --printf_support compiler option, which formerly applied only to all members of the printf family of library functions, will now also apply to all members of the scanf family. This greatly reduces the code size of scanf when --printf_support is used. This is a compatibility issue if there is any project which uses both printf and scanf and uses the --printf_support option to reduce the capability of the printf format specifiers, but relies on those same format specifiers for scanf. With this change, when using scanf and --printf_support, you are restricted to only the subset of formats allowed by the --printf_support mode you select. The valid values are: - full: Supports all format specifiers. This is the default. - nofloat: Excludes support for printing/scanning floating point values. Supports all format specifiers except %f, %F, %g, %G, %e, %E. - minimal: Supports the printing/scanning of integer, char, or string values without width or precision flags. Specifically, only these format specifiers are supported: %%, %d, %o, %c, %s, %x ------------------------------------------------------------------------------- 2) Support for MSP430 EABI (Embedded Application Binary Interface) ------------------------------------------------------------------------------- Starting with the MSP430 4.0.0 compiler supports a new ABI (Application Binary Interface), MSP430 EABI, in addition to the current COFFABI. 2.1) Features ------------- MSP430 EABI is an ABI for the MSP430 architecture based on the ELF object file format. The major features are: - ELF object format - DWARF3 debug format - Improved "GPP parity" The advantage of EABI is that it provides a modern, well-documented ABI that is well-supported. Many newer C++ language features, such as template instantiation and "extern inline," can be implemented more effectively. Future development of TI's MSP430 compiler will be primarily implemented within EABI. We encourage users to consider switching to EABI at their earliest convenience. 2.2) Usage ---------- To compile using EABI, use the shell option --abi=eabi. Compile: > cl430 --abi=eabi Compile and link: > cl430 --abi=eabi -z -l When no RTS library is specified in the command line, the linker will choose the right RTS library, provided the RTS library search path environment variable (MSP430_C_DIR) is set. 2.3) 64-bit "double" -------------------- In EABI mode, the C standard type "double" is 64 bits. In COFF ABI mode, the "double" type remains 32 bits. Because the C standard requires the compiler to treat unsuffixed floating-point constants as type "double," the compiler is required use double-precision arithmetic for expressions involving such constants. Programs which use such constants may run a little slower in EABI. This performance can be reclaimed by changing the constants to have the suffix "f". 2.4) Table-Driven Exception Handling ------------------------------------ MSP430 compiler version 4.0.0 supports table-driven exception handling for ELF executables. Table-driven exception handling is more time-efficient than setjmp/longjmp support when exceptions are not thrown. The user interface is almost entirely the same as the COFFABI support; use the option --exceptions and link with an RTS which has exception handling enabled. For EABI only, if you have any 'extern "C"' functions which need to throw exceptions, you must use the option "--extern_c_can_throw". The underlying implementation is very different. No support will be provided for migrating assembly files generated using the COFF scheme to the EABI environment; such files should be recompiled from the original C++ files. 2.5) Compiler Version 3.3.0 Compatibility ----------------------------------------- MSP430 compiler version 4.0.0's COFFABI support is compatible with MSP430 compiler version 3.3.0. Projects currently using version 3.3.0 can update to version 4.0.0 without any issues, except as noted in section 2, 'Support for 64-bit "long long int"'. The version 4.0.0 compiler generates COFFABI by default, which is compatible with the version 3.3.0 compiler. 2.6) Migration from COFF to ELF ------------------------------- To take advantage of MSP430 EABI, users must explicitly request it using the "--abi=eabi" command-line option. Object files generated with this option will not be compatible with object files generated for COFFABI. However, most C source files will not require modification, and most assembly source files will require only trivial modification. The major differences between EABI and COFFABI are: - Different name mangling - C++ names are mangled using IA64 name mangling scheme - Different C auto-initialization However, there are many more details. Review the MSP430 EABI Migration document for these migration details. Users need to take specific steps to migrate their projects to EABI: - COFF objects and libraries are not compatible with EABI objects; programs and libraries must be recompiled from source. There is no COFF to ELF conversion utility. Please refer to the MSP430 EABI Migration document for details. ------------------------------------------------------------------------------- 3) Support for 64-bit "long long int" ------------------------------------------------------------------------------- The C99 type "long long int", which is a 64-bit integer type, is now supported as a language extension (the compiler supports C89). All of the necessary library functions are supported, including the printf format specifier "%lld". Because this type represents a new largest integer type, the stdint.h types intmax_t and uintmax_t, and the corresponding MAX and MIN macros, have different values. Any object file compiled from C sources which used these identifiers will not be compatible with object files compiled with the newer compiler. Recompile these object files. ------------------------------------------------------------------------------- 4) Support for C99 floating-point functions ------------------------------------------------------------------------------- The MSP430 library now provides more C99 library functions as extensions. The following macros are now supported: INFINITY NAN FP_INFINITE FP_NAN FP_NORMAL FP_SUBNORMAL FP_ZERO FP_ILOGB0 FP_ILOGBNAN MATH_ERREXCEPT MATH_ERRNO math_errhandling The following function-like macros are now supported: fpclassify isfinite isinf isnan isnormal signbit isgreater isgreaterequal isless islessequal islessgreater isunordered The following C99 float and long double versions of existing C89 functions are now supported: acosf acosl asinf asinl atanf atanl atan2f atan2l cosf cosl sinf sinl tanf tanl coshf coshl sinhf sinhl tanhf tanhl expf expl frexpf frexpl ldexpf ldexpl logf logl log10f log10l modff modfl fabsf fabsl powf powl sqrtf sqrtl ceilf ceill floorf floorl fmodf fmodl The following entirely new C99 functions are now supported: acosh acoshf acoshl asinh asinhf asinhl atanh atanhf atanhl exp2 exp2f exp2l expm1 expm1f expm1l ilogb ilogbf ilogbl log1p log1pf log1pl log2 log2f log2l logb logbf logbl scalbn scalbnf scalbnl scalbln scalblnf scalblnl cbrt cbrtf cbrtl hypot hypotf hypotl erf erff erfl erfc erfcf erfcl lgamma lgammaf lgammal tgamma tgammaf tgammal nearbyint nearbyintf nearbyintl rint rintf rintl lrint lrintf lrintl llrint llrintf llrintl round roundf roundl lround lroundf lroundl llround llroundf llroundl trunc truncf truncl remainder remainderf remainderl remquo remquof remquol copysign copysignf copysignl nan nanf nanl nextafter nextafterf nextafterl nexttoward nexttowardf nexttowardl fdim fdimf fdiml fmax fmaxf fmaxl fmin fminf fminl fma fmaf fmal ------------------------------------------------------------------------------- 5) Support for C++ ------------------------------------------------------------------------------- The C++ header file , which supports complex arithmetic, is now supported. C99 complex floating-point types are not supported. ------------------------------------------------------------------------------- 6) Support for packed data types ------------------------------------------------------------------------------- The GCC type attribute "packed" is now supported on structs and unions when the --gcc language option is used. This attribute minimizes the data requirement for structures by eliminating padding after unaligned members. For more information, see: http://processors.wiki.ti.com/index.php/GCC_Extensions_in_TI_Compilers http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html ------------------------------------------------------------------------------- 7) Support for #pragma location ------------------------------------------------------------------------------- The compiler supports the ability to specify the runtime address of a variable at the source level. This can be accomplished with the new location pragma or attribute. Location support is only available in EABI. Syntax: TI C style pragma: #pragma LOCATION(x, address) int x; TI C++ style pragma: #pragma LOCATION(address) int x; IAR style pragma: #pragma location=address int x; GCC attribute: int x __attribute__((location(address))); ------------------------------------------------------------------------------- 8) Support for noinit and persistent objects ------------------------------------------------------------------------------- When using EABI, global and static variables will be zero-initialized. However, in applications using non-volatile memory, it may be desirable to have variables that are not initialized. Noinit variables are global or static variables that are not zero-initialized at startup or reset. The noinit pragma may be used in conjunction with the location pragma to map variables to special memory locations, like memory-mapped registers, without generating unwanted writes. Noinit variables cannot have an initializer. However, statically-initialized variables may be declared "persistent" to disable startup initialization. Persistent variables are given an initial value when the code is loaded, but are never again initialized. Persistent and noinit variables behave identically with the exception of whether or not they are initialized at load time. Syntax: C style pragma: #pragma NOINIT(x) int x; C++ style pragma: #pragma NOINIT int x; GCC attribute: int x __attribute__((noinit)); C style pragma: #pragma PERSISTENT(x) int x=10; C++ style pragma: #pragma PERSISTENT int x=10; GCC attribute: int x=0; __attribute__((persistent)); ------------------------------------------------------------------------------- 9) Improved use of hardware multiply ------------------------------------------------------------------------------- The compiler is better able to detect situations where the 16x16->32 hardware could be used instead of resorting to the more expensive 32x32->32 software function. The compiler will recognize the following idiom and generate a call to the 16x16->32 library function, which will be handled using the hardware multiply if the user uses the --use_hw_mpy compiler option. #include int16_t x,y; int32_t z = (int32_t)x * (int32_t)y; The same is done for 32x32->64 multiply expressions. ------------------------------------------------------------------------------- 10) More aggressive optimization by default ------------------------------------------------------------------------------- Starting with version 4.0.0, the compiler will be more aggressive about the most basic optimizations, such as using registers for variables. ------------------------------------------------------------------------------- 11) Fewer pre-built libraries, automatic library building ------------------------------------------------------------------------------- This release provides fewer pre-built compiler run-time support libraries, which makes the CCS package download size much smaller, reducing download time. Users are expected to build less-commonly used libraries as needed. The RTS source code is provided in each compiler release, which allows the user to build libraries with custom command-line options, and it also allows the linker to automatically build missing libraries. Users with shared or read-only installation directories need to take special action to build (at installation time) libraries that will be needed. More details about the mechanism behind rebuilding libraries can be found at the TI Embedded Processors Wiki http://processors.wiki.ti.com/index.php/Mklib ------------------------------------------------------------------------------- 12) Customer Support Information ------------------------------------------------------------------------------- 12.1) Defect History ------------------- The list of defects fixed in this release as well as known issues can be found in the file DefectHistory.txt. 12.2) Compiler Wiki ------------------ A Wiki has been established to assist developers in using TI Embedded Processor Software and Tools. Developers are encouraged to read and contribute to the articles. Registered users can update missing or incorrect information. There is a large section of compiler-related material. Please visit: http://tiexpressdsp.com/wiki/index.php?title=Category:CGT 12.3) Compiler Documentation Errata ---------------------------------- Errata for the "MSP430 Optimizing Compiler User's Guide" and the "MSP430 Assembly Language User's Guide" is available online at the Texas Instruments Embedded Processors CG Wiki: http://tiexpressdsp.com/wiki/index.php?title=Category:CGT under the 'Compiler Documentation Errata' link. 12.4) TI E2E Community --------------------- Questions concerning TI Code Generation Tools can be posted to the TI E2E Community forums. The "Development Tools" forum can be found at: http://e2e.ti.com/support/development_tools/f/default.aspx 12.5) Defect Tracking Database ----------------------------- Compiler defect reports can be tracked at the Development Tools bug database, SDOWP. The login page for SDOWP, as well as a link to create an account with the defect tracking database is found at: https://cqweb.ext.ti.com/pages/SDO-Web.html A my.ti.com account is required to access this page. To find an issue in SDOWP, enter your bug id in the "Find Record ID" box once logged in. To find tables of all compiler issues click the queries under the folder: "Public Queries" -> "Development Tools" -> "TI C-C++ Compiler" With your SDOWP account you can save your own queries in your "Personal Queries" folder. -- End Of File --