Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 2.91 KB

get-fma3-enable-set-fma3-enable.md

File metadata and controls

56 lines (45 loc) · 2.91 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic apiname apilocation apitype f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
_get_FMA3_enable, _set_FMA3_enable | Microsoft Docs
6/13/2017
cpp-standard-libraries
article
_get_FMA3_enable
_set_FMA3_enable
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-runtime-l1-1-0.dll
DLLExport
_get_FMA3_enable
_set_FMA3_enable
math/_get_FMA3_enable
math/_set_FMA3_enable
C++
_get_FMA3_enable
_set_FMA3_enable
4c1dc4bc-e86b-451b-9211-5a2ba6c98ee4
1
corob-msft
corob
ghogen

_get_FMA3_enable, _set_FMA3_enable

Gets or sets a flag that specifies whether the transcendental math floating-point library functions use FMA3 instructions in code compiled for X64 platforms.

Syntax

int _set_FMA3_enable(int flag);
int _get_FMA3_enable();

Parameters

flag
Set to 1 to enable the FMA3 implementations of the transcendental math floating-point library functions on X64 platforms, or to 0 to use the implementations that do not use FMA3 instructions.

Return Value

A non-zero value if the FMA3 implementations of the transcendental math floating-point library functions are enabled. Otherwise, zero.

Remarks

Use the _set_FMA3_enable function to enable or disable the use of FMA3 instructions in the transcendental math floating-point functions in the CRT library. The return value reflects the implementation in use after the change. If the CPU does not support FMA3 instructions, this function cannot enable them in the library, and the return value is zero. Use _get_FMA3_enable to get the current state of the library. By default, on X64 platforms, the CRT startup code detects whether the CPU supports FMA3 instructions, and enables or disables the FMA3 implementations in the library.

Because the FMA3 implementations use different algorithms, slight differences in the result of computations may be observable when the FMA3 implementations are enabled or disabled, or between computers that do or do not support FMA3. For more information, see Floating-point migration issues.

Requirements

The _set_FMA3_enable and _get_FMA3_enable functions are only available in the X64 versions of the CRT.

Routine Required header
_set_FMA3_enable

_get_FMA3_enable
C: <math.h>

C++: <cmath> or <math.h>

The _set_FMA3_enable and _get_FMA3_enable functions are Microsoft specific. For compatibility information, see Compatibility.

See Also

Floating-point support Floating-point migration issues