GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • The LLVM C Library

This view

  • Original page
  • New address

GeezerVison is showing libc.llvm.org — Fixed-Point Arithmetic - The LLVM C Library

Fixed-Point Arithmetic#

Standards and Goals#

  • stdfix.h is specified in ISO/IEC TR 18037:2008, C extensions to support embedded processors (publicly available specification).

  • Our goal is to implement a complete set of math functions for fixed-point types, most of which are not included in ISO/IEC TR 18037:2008. Our math functions for fixed-point types are modelled after the C99/C23 math functions for floating-point types.

Source Location#

  • The main source for fixed-point functions is located at libc/src/stdfix, with internal support utilities under libc/src/__support/fixed_point.

Implementation Status#

  • Per-precision function, macro, and type status tables: stdfix.h

Requirements#

  • Building LLVM-libc with fixed-point arithmetic support requires a compiler that supports the native fixed-point types _Fract and _Accum in C++.

  • Consuming the generated stdfix.h header requires compiler support for _Fract and _Accum in C or C++.

  • Compiler support is checked at the top of libc/include/llvm-libc-macros/stdfix-macros.h.

Predefined Macros#

  • LIBC_COMPILER_HAS_FIXED_POINT indicates whether the compiler supports fixed-point types.

  • Predefined precision and range macros from ISO/IEC TR 18037:2008 section 7.18a.3 are defined in libc/include/llvm-libc-macros/stdfix-macros.h using the default typical desktop processor configuration from Annex A.3 when compiler predefined macros are absent.

Formatted I/O#

  • ISO/IEC TR 18037:2008 section 7.18a.6.7 also specifies fixed-point conversion specifiers (r, R, k, K) for the <stdio.h> fprintf and fscanf families (LIBC_CONF_PRINTF_DISABLE_FIXED_POINT controls printf support).

Warnings#

This support is currently a work in progress; its headers, macros, and ABI are still unstable and may change.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.