RealView® Compilation Tools Libraries and Floating Point Support Guide

Version 3.1

Table of Contents

About this book
Intended audience
Using this book
Typographical conventions
Further reading
Feedback on RealView Compilation Tools
Feedback on this book
1. Introduction
1.1. About the runtime libraries
1.1.1. ABI for the ARM Architecture compliance
1.1.2. Library directory structure
1.1.3. Build options and library variants
1.1.4. Using the VFP support libraries
1.1.5. Thumb C libraries
1.2. About floating‑point support
2. The C and C++ Libraries
2.1. About the C and C++ libraries
2.1.1. Features of the C and C++ libraries
2.1.2. Namespaces
2.2. Writing reentrant and thread‑safe code
2.2.1. Introduction to reentrancy and thread‑safety
2.2.2. Use of static data in the C libraries
2.2.3. The __user_libspace static data area
2.2.4. Managing locks in multithreaded applications
2.2.5. Using the ARM C libraries with a multithreaded application
2.2.6. Thread‑safety in the ARM C libraries
2.2.7. Thread‑safety in the ARM C++ libraries
2.3. Building an application with the C library
2.3.1. Using the libraries with an application
2.3.2. Building an application for a semihosted environment
2.3.3. Building an application for a non semihosting environment
2.4. Building an application without the C library
2.4.1. Integer and FP helper functions
2.4.2. Bare machine integer C
2.4.3. Bare machine C with floating‑point
2.4.4. Exploiting the C library
2.4.5. The standalone C library functions
2.5. Tailoring the C library to a new execution environment
2.5.1. How C and C++ programs use the library functions
2.5.2. __rt_entry
2.5.3. Exiting from the program
2.5.4. __rt_exit()
2.5.5. __rt_lib_init()
2.5.6. __rt_lib_shutdown()
2.6. Tailoring static data access
2.7. Tailoring locale and CTYPE using assembler macros
2.7.1. Selecting locale at link time
2.7.2. Selecting locale at runtime
2.7.3. Defining a locale block
2.7.4. LC_CTYPE data block
2.7.5. LC_COLLATE data block
2.7.6. LC_MONETARY data block
2.7.7. LC_NUMERIC data block
2.7.8. LC_TIME data block
2.7.9. _get_lconv()
2.7.10. localeconv()
2.7.11. setlocale()
2.7.12. _findlocale()
2.7.13. The lconv structure
2.8. Tailoring locale and CTYPE using C macros
2.8.1. Selecting locale at link time
2.8.2. Selecting locale at runtime
2.8.3. Macros and utility functions
2.8.4. _get_lc_ctype()
2.8.5. _get_lc_collate()
2.8.6. _get_lc_monetary()
2.8.7. _get_lc_numeric()
2.8.8. _get_lc_time()
2.8.9. _get_lconv()
2.8.10. localeconv()
2.8.11. setlocale()
2.8.12. _findlocale()
2.8.13. __LC_CTYPE_DEF
2.8.14. __LC_COLLATE_DEF
2.8.15. __LC_TIME_DEF
2.8.16. __LC_NUMERIC_DEF
2.8.18. __LC_INDEX_END
2.8.19. The lconv structure
2.9. Tailoring error signaling, error handling, and program exit
2.9.1. _sys_exit()
2.9.2. errno
2.9.3. __rt_errno_addr()
2.9.4. __raise()
2.9.5. __rt_raise()
2.9.6. __default_signal_handler()
2.9.7. _ttywrch()
2.9.8. __rt_fp_status_addr()
2.10. Tailoring storage management
2.10.1. Avoiding the ARM‑supplied heap and heap‑using functions
2.10.2. Support for malloc
2.11. Tailoring the runtime memory model
2.11.1. The memory models
2.11.2. Controlling the runtime memory model
2.11.3. Writing your own memory model
2.11.4. __user_initial_stackheap()
2.11.5. __user_setup_stackheap()
2.11.6. __user_heap_extend()
2.11.7. __user_heap_extent()
2.11.8. __user_stack_cleanup_space()
2.11.9. __rt_heap_extend()
2.11.10. __rt_stack_postlongjmp()
2.12. Tailoring the input/output functions
2.12.1. Dependencies on low‑level functions
2.12.2. Target‑dependent input/output support functions
2.12.3. _sys_open()
2.12.4. _sys_close()
2.12.5. _sys_read()
2.12.6. _sys_write()
2.12.7. _sys_ensure()
2.12.8. _sys_flen()
2.12.9. _sys_seek()
2.12.10. _sys_istty()
2.12.11. _sys_tmpnam()
2.12.12. _sys_command_string()
2.12.13. #pragma import(_main_redirection)
2.13. Tailoring other C library functions
2.13.1. clock()
2.13.2. _clock_init()
2.13.3. time()
2.13.4. remove()
2.13.5. rename()
2.13.6. system()
2.13.7. getenv()
2.13.8. _getenv_init()
2.14. Selecting real‑time division
2.15. ISO implementation definition
2.15.1. ISO C library implementation definition
2.15.2. Standard C++ library implementation definition
2.16. C library extensions
2.16.1. atoll()
2.16.2. strtoll()
2.16.3. strtoull()
2.16.4. printf()
2.16.5. snprintf()
2.16.6. vsnprintf()
2.16.7. lldiv()
2.16.8. llabs()
2.16.9. wcstombs()
2.16.10. alloca()
2.16.11. strlcpy()
2.16.12. strlcat()
2.16.13. _fisatty()
2.16.14. __heapstats()
2.16.15. __heapvalid()
2.17. Library naming conventions
2.17.1. Placing ARM libraries
2.17.2. Helper libraries
2.17.3. Identifying library variants
3. The C Micro-library
3.1. About microlib
3.1.1. Differences from the default C library
3.2. Building an application with microlib
3.3. Using microlib
3.3.1. Creating the stack
3.3.2. Creating the heap
3.3.3. Entering and exiting your program
3.4. Tailoring the microlib input/output functions
3.5. ISO C features missing from microlib
4. Floating‑point Support
4.1. The software floating‑point library, fplib
4.1.1. Features of the floating‑point library, fplib
4.1.2. Arithmetic on numbers in a particular format
4.1.3. Conversions between floats, doubles, and ints
4.1.4. Conversions between long longs and other number formats
4.1.5. Floating‑point comparisons
4.1.6. C99 functions
4.2. Controlling the floating‑point environment
4.2.1. __ieee_status()
4.2.2. __fp_status()
4.2.3. __vfp_status()
4.2.4. Microsoft compatibility functions
4.2.5. C99 compatible functions
4.2.6. ARM compiler extensions to the C99 interface
4.3. The math library, mathlib
4.3.1. Range reduction in mathlib
4.3.2. Determine the type of a floating‑point number (fpclassify)
4.3.3. Determine if a number is finite (isfinite)
4.3.4. Determine if a number is infinite (isinf)
4.3.5. Determine if a number is a NaN (isnan)
4.3.6. Determine if a number is normal (isnormal)
4.3.7. Return the sign bit of a number (signbit)
4.3.8. Copy sign functions (copysign, copysignf)
4.3.9. Comparison macros (isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered)
4.3.10. Inverse hyperbolic functions (acosh, asinh, atanh)
4.3.11. Cube root (cbrt)
4.3.12. Error functions (erf, erfc)
4.3.13. One less than exp(x) (expm1)
4.3.14. Gamma function (gamma, gamma_r)
4.3.15. Hypotenuse function (hypot)
4.3.16. Bessel functions of the first kind (j0, j1, jn)
4.3.17. The logarithm of the gamma function
4.3.18. Logarithm of one more than x (log1p)
4.3.19. IEEE 754 remainder function (remainder)
4.3.20. IEEE round‑to‑integer operation (rint)
4.3.21. Return the fraction part of a number (significand)
4.3.22. Bessel functions of the second kind (y0, y1, yn)
4.3.23. Legacy, Exponent of a number (ilogb, ilogbf, ilogbl)
4.3.24. Legacy, Determine if a number is finite (finite)
4.3.25. Legacy, Determine if a number is a NaN (isnan)
4.4. IEEE 754 arithmetic
4.4.1. Basic data types
4.4.2. Arithmetic and rounding
4.4.3. Exceptions

Proprietary Notice

Words and logos marked with® or ™ are registered trademarks or trademarks owned by ARM Limited. Other brands and names mentioned herein may be the trademarks of their respective owners.

Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder.

The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.

This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.

Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.

Some material in this document is based on IEEE 754 - 1985 IEEE Standard for Binary Floating-Point Arithmetic. The IEEE disclaims any responsibility or liability resulting from the placement and use in the described manner.

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.

Product Status

The information in this document is final, that is for a developed product.

Revision History
Revision AMarch 2007Release 3.1 for RVDS v3.1
Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0349A