Skip to content

Builtin DFP types for C++ using __attribute__((mode(SD/DD/TD))) #16

@tahonermann

Description

@tahonermann

The DFP support defined for C++ via ISO/IEC TR 24733:2011 does not include support for builtin DFP types or the _Decimal32, _Decimal64, and _Decimal128 keywords; support for DFP types is instead relegated to the standard library. Gcc implements the specified std::decimal::decimalNN types as light wrappers around builtin types that are equivalent to the _DecimalNN types but that lack keyword names. These types are instead named using type attributes as follows:

  • float __attribute__((mode(SD))) # _Decimal32
  • float __attribute__((mode(DD))) # _Decimal64
  • float __attribute__((mode(TD))) # _Decimal128

This issue tracks doing the following:

  • Adding support for the above type specifier attribute syntax and mapping it to the builtin types added via issue ​AST representation for builtin types #4.
  • Disabling the _DecimalNN keywords when compiling as C++ (in clang/include/clang/Basic/TokenKinds.def, the _DecimalNN keywords are defined with KEYALL; this should be KEYNOCXX).

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions