Main Content

target.FloatingPointDataType class

Package: target

Describe floating point data type implemented by compiler for target hardware

Description

Use a target.FloatingPointDataType object to describe a floating point data type that is implemented by the target hardware compiler but is not specified by a C language standard.

To create a target.FloatingPointDataType object, use the target.create function.

The target.FloatingPointDataType class is a handle class.

Properties

expand all

Size of the data type, specified in bits.

Attributes:

GetAccess
public
SetAccess
public

Name of floating point data type.

Attributes:

GetAccess
public
SetAccess
public

Describe the suffix appended to numeric literal in C or C++ code, which indicates data type. For example, some ARM® compilers support the use of the literal suffix f16 for the _Float16 data type, which allows the specification of literals of the data type in C or C++ code, say, 1.23f16.

Attributes:

GetAccess
public
SetAccess
public

For the data type, specify the include files that are required in the C or C++ translation unit.

Attributes:

GetAccess
public
SetAccess
public

For the data type, specify the system include files that are required in the C or C++ translation unit.

Attributes:

GetAccess
public
SetAccess
public

Identifier for data type description.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

Specify a 16-bit floating point ARM data type.

languageImplementation = target.create('LanguageImplementation', ...
                                       'Name', 'ARM with half', ...
                                       'Copy', 'ARM Compatible-ARM Cortex');
 
customHalf = target.create('FloatingPointDataType', ...
                           'Name', 'ARM Half Float', ...
                           'TypeName', '_Float16', ...
                           'LiteralSuffix', 'f16', ...
                           'Size', 16, ...
                           'SystemIncludes', "arm_fp16.h");
languageImplementation.DataTypes.NonStandardDataTypes = [customHalf];

target.add(languageImplementation);
Introduced in R2021b