Developer Central
China  |  India
  • Home
  • Tools & SDKs
  • Resources
  • Community
  • Partners
  • Support
  • Home
  • Tools & SDKs
  • Resources
  • Community
  • Partners
  • Support
  • Home
  • Tools & SDKs
  • Resources
  • Community
  • Partners
  • Support
  • Home
  • Tools & SDKs
  • Resources
  • Community
  • Partners
  • Support

Tools & SDKs

  • Heterogeneous Computing
    • Aparapi
    • APP Kernel Analyzer
    • APP Profiler
      • Getting Started
        • System Requirements
        • Installation
        • Successful Installation
        • Using The Visual Studio Plugin
        • Using the Command Line Interface
        • Known Issues
        • Support
      • User Guide
        • APP Profiler Session Explorer
        • APP Profiler Session
        • APP Profiler Timeline
        • APP Profiler Summary Pages
        • APP Profiler Code Viewer
        • APP Profiler Kernel Occupancy Viewer
        • APP Profiler Settings
        • APP Profiler Session Parameters
        • Description of Configuration Files
        • APP Profiler Kernel Occupancy
        • CLPerfMarkerAMD Library
    • Accelerated Parallel Processing (APP) SDK
      • Downloads
        • Download Archive
      • System Requirements & Driver Compatibility
      • Documentation
      • Bolt C++ Template Library
        • AMD Bolt Sample Code Contest Official Rules
      • Samples & Demos
      • Compute System Recommendations
      • Intro OpenCL Tutorial
      • Open Source Libraries
      • Support
    • Accelerated Parallel Processing Math Libraries (APPML)
    • CodeAnalyst Performance Analyzer
      • CodeAnalyst for Linux®
      • CodeAnalyst for Windows®
      • PMU Extension Driver
      • CodeAnalyst Archive
    • CodeXL
    • gDEBugger
      • gDEBugger User Guide
        • Getting started with gDEBugger
        • Toolbars
        • Views
        • Dialogs
        • How Do I…
        • FAQ
        • Supported Extensions
        • System Requirements & Installation
        • Legal Information
        • Contact Information
  • CPU Development
    • Advanced Platform Management Link (APML)
    • Core Math Library (ACML)
      • Downloads & Resources
        • Building with ACML
        • How to use ACML with different versions of GCC/GFORTRAN
      • Archive Downloads
      • Product Features
      • Redistribution Agreements
    • LibM
      • ACML_MV
      • LibM Functions
    • Open64 SDK
      • Building with ACML
    • SimNow™ Simulator
    • Tools for DMTF DASH
    • x86 Open64 Compiler Suite
      • Developer Guide
      • Apps & Libraries Built by x86 Open64
      • Inactive Files
  • Graphics Development
    • Display Library (ADL) SDK
    • ATI GPU Services (AGS) Library
    • GPU PerfStudio 2
      • API Trace
      • Frame Debugger
      • Frame Profiler
      • Shader Debugger
      • Shader Editor
      • Previous versions
    • GPU ShaderAnalyzer
    • GPUPerfAPI
    • OpenGL ES SDK
    • Quad-Buffer SDK
    • FirePro SDK
      • FirePro News & Events
    • Radeon™ SDK
  • Open Source
    • GCC & GNU Toolchains
    • OpenCL™ Emulator-Debugger
    • Tapper

Home > Tools & SDKs > CPU Development > LibM

LibM

Overview

AMD LibM is a software library containing a collection of basic math functions optimized for x86-64 processor based machines. It provides many routines from the list of standard C99 math functions.

AMD LibM is a C library, which users can link in to their applications to replace compiler-provided math functions. Generally, programmers access basic math functions through their compiler. But those who want better accuracy or performance than their compiler’s math functions can use this library to help improve their applications.

Users can also take advantage of the vector functions in this library. The vector variants can be used to speed up loops and perform math operations on multiple elements conveniently.

AMD LibM 3.0 is the most current version of the library.

Go to Downloads

What is New in V3.0

  • Key functions optimized to take advantage of instructions in the new AMD Opteron Family 15h processor
  • Performance optimizations in scalar and vector routines
  • Dynamic dispatch mechanism, with no run-time overhead, to automatically select functions optimized for new AMD Opteron Family 15h processors or functions with SSE2 optimizations, based on system CPU.
  • Bug fixes

A few example programs are included to illustrate usage of AMD LibM functions.

Functions

There are 112 C99 functions in this library. Here is a simple table that lists the function categories and the number of functions in each of them.

Trigonometric – 16 Remainder – 6
Hyperbolic – 12 Manipulation – 10
Exp & Log – 30 Max & Min & Diff – 6
Power & Absolute – 12 Nearest integer – 20

There are also 6 non-C99 functions. These functions are closely related to some of the C99 functions and are provided for convenience.

Refer to AMD LibM Functions for a full list of functions.

List of functions optimized to take advantage of new AMD Opteron Family 15h processor instructions.

Scalar functions AVX/FMA4/XOP code path, 26 functions cbrt, cbrtf,
exp10, exp10f, exp2, exp2f, exp, expf, expm1, expm1f,
fma, fmaf, log10,
log10f, log1p, log1pf, log2, log2f, log, logf,
sin, sinf, tan, tanf cos, cosf
Vector functions AVX/FMA4/XOP code path 32 functions vrd2_cbrt, vrs4_cbrtf,
vrd2_exp10, vrd2_exp2, vrd2_exp,
vrd2_expm1,
vrd2_log10, vrd2_log1p, vrd2_log2, vrd2_log,
vrd2_cos, vrd2_sin, vrd2_tan,
vrda_exp, vrda_exp2, vrda_expm1, vrda_exp10,
vrs4_exp10f, vrs4_exp2f, vrs4_expf, vrs4_expm1f,
vrsa_exp10f, vrsa_exp2f, vrsa_expf, vrsa_expm1f,
vrs4_log10f, vrs4_log1pf, vrs4_log2f, vrs4_logf,
vrs4_sinf, vrs4_cosf, vrs4_tanf

Accuracy & Performance

The accuracy of a math function is estimated in terms of maximum error (measured in ULP (unit in the last place)) between the obtained answer and the ideal infinite-precision answer, over that function’s range. The accuracy of AMD LibM functions in certain categories (absolute, nearest integer, remainder, manipulation, maximum, minimum, difference) is either 0 or 0.5 ULP. In these cases, the functions either produce exact answers or wherever applicable within the practical limits of correct rounding. In the remaining categories (trigonometric, hyperbolic, exponential, logarithmic, and power), the estimated accuracy is better than 1.0 ULP.

Many of the scalar and vector functions in AMD LibM are very well optimized for performance. Significant effort was put in optimizing the performance of trigonometric, exponential and logarithmic category of functions. Many functions in the power and remainder categories also have good optimizations. Applications that make significant use of math functions can benefit from this library.

LibM 3.0 has two optimized code paths, one is SSE2 optimized and the other is AVX+XOP+FMA4 optimized for the new AMD Opteron Family 15h processor. Based on the features supported by the system processor, one of these paths is taken. The dispatch happens at library load time to ensure very little overhead in subsequent calls to the LibM functions.

System Requirements

  • x86-64 processor based machine
  • Linux 64 or Windows 64
  • GCC 4.1.1 or later for Linux libraries
  • Microsoft Visual Studio 2005 or later for Windows libraries

Related Resources

  • C99 standard
  • IEEE 754-2008 standard
  • ACML main page
  • ACML: acml_mv user guide page
  • AMD Libraries blog

Note: The ‘acml_mv’, used to be a component of the ACML library. AMD LibM is an effort to provide those functions in a stand-alone library and also significantly expand on the number of functions. ACML no longer ships the acml_mv component, starting from the latest release ACML 5.0. These routines will be provided by LibM3.0, instead.

Downloads

*Please note: Read Software License Agreement before downloading.

File Name Version Size Launch Date OS Bitness Description
Linux – SLES 11 SP1, RHEL6 etc. (GLIBC v2.10.1-10.4 and above)
amdlibm3.0.2lin64.tar.gz 3.0.2 935 KB 02/29/2012 64-bit AMD LibM Library for Linux®. Built with GCC 4.6.0
Windows®
amdlibm3.0.2win64.zip 3.0.2 10 MB 02/29/2012 64-bit AMD LibM Library for Windows®. Built with Microsoft® Visual Studio® 2010.

Get the hcNewsFlash.

Your email address:

No SPAM.
Easy unsubscribe.

HSA is going to rock your world.

Learn more about Heterogeneous System Architecture.

Got Questions?

Ask the Developer Forums Community. They’ve got answers.

Tools & SDKs

  • Heterogeneous Computing
    • Aparapi
    • APP Kernel Analyzer
    • APP Profiler
      • Getting Started
        • System Requirements
        • Installation
        • Successful Installation
        • Using The Visual Studio Plugin
        • Using the Command Line Interface
        • Known Issues
        • Support
      • User Guide
        • APP Profiler Session Explorer
        • APP Profiler Session
        • APP Profiler Timeline
        • APP Profiler Summary Pages
        • APP Profiler Code Viewer
        • APP Profiler Kernel Occupancy Viewer
        • APP Profiler Settings
        • APP Profiler Session Parameters
        • Description of Configuration Files
        • APP Profiler Kernel Occupancy
        • CLPerfMarkerAMD Library
    • Accelerated Parallel Processing (APP) SDK
      • Downloads
        • Download Archive
      • System Requirements & Driver Compatibility
      • Documentation
      • Bolt C++ Template Library
        • AMD Bolt Sample Code Contest Official Rules
      • Samples & Demos
      • Compute System Recommendations
      • Intro OpenCL Tutorial
      • Open Source Libraries
      • Support
    • Accelerated Parallel Processing Math Libraries (APPML)
    • CodeAnalyst Performance Analyzer
      • CodeAnalyst for Linux®
      • CodeAnalyst for Windows®
      • PMU Extension Driver
      • CodeAnalyst Archive
    • CodeXL
    • gDEBugger
      • gDEBugger User Guide
        • Getting started with gDEBugger
        • Toolbars
        • Views
        • Dialogs
        • How Do I…
        • FAQ
        • Supported Extensions
        • System Requirements & Installation
        • Legal Information
        • Contact Information
  • CPU Development
    • Advanced Platform Management Link (APML)
    • Core Math Library (ACML)
      • Downloads & Resources
        • Building with ACML
        • How to use ACML with different versions of GCC/GFORTRAN
      • Archive Downloads
      • Product Features
      • Redistribution Agreements
    • LibM
      • ACML_MV
      • LibM Functions
    • Open64 SDK
      • Building with ACML
    • SimNow™ Simulator
    • Tools for DMTF DASH
    • x86 Open64 Compiler Suite
      • Developer Guide
      • Apps & Libraries Built by x86 Open64
      • Inactive Files
  • Graphics Development
    • Display Library (ADL) SDK
    • ATI GPU Services (AGS) Library
    • GPU PerfStudio 2
      • API Trace
      • Frame Debugger
      • Frame Profiler
      • Shader Debugger
      • Shader Editor
      • Previous versions
    • GPU ShaderAnalyzer
    • GPUPerfAPI
    • OpenGL ES SDK
    • Quad-Buffer SDK
    • FirePro SDK
      • FirePro News & Events
    • Radeon™ SDK
  • Open Source
    • GCC & GNU Toolchains
    • OpenCL™ Emulator-Debugger
    • Tapper

©2013 Advanced Micro Devices, Inc. OpenCL and the OpenCL logo are trademarks of Apple, Inc., used with permission by Khronos.

  • Contact Us
  • |
  • Careers
  • |
  • Site Map
  • |
  • Terms and Conditions
  • |
  • Privacy
  • |
  • Trademarks