Comments (7)
Is _Float16 the same as __fp16, which already supported on some architectures? If so, should the two types be the same?
And if so, please remember there may already be code that uses __fp16 in mangled contexts, using mangling "Dh".
$ clang -target aarch64-linux -O2 -S -o - -xc++ - <<<'void f(const __fp16 &) {}'
.text
.file "-"
.globl _Z1fRKDh // -- Begin function _Z1fRKDh
.p2align 2
.type _Z1fRKDh,@function
_Z1fRKDh: // @_Z1fRKDh
// BB#0:
ret
.Lfunc_end0:
.size _Z1fRKDh, .Lfunc_end0-_Z1fRKDh
// -- End function
.ident "openSUSE Linux clang version 5.0.0 (trunk 307005) (based on LLVM 5.0.0)"
.section ".note.GNU-stack","",@progbits
PS: __float128 is also already mangled as "g"
from cxx-abi.
No, they are really different types: __fp16 is a storage-only type (arithmetic is performed in single precision, the result truncated and stored in half precision), and _Float16 is a "native" type with arithmetic in half precision. As they are different types with different semantics, they should be mangled differently.
from cxx-abi.
If TS 18661 considers them different types, then the C++ ABI should provide new manglings for them unless we have some compelling reason to reject ever using that extension in C++, which seems unlikely. I would recommend:
<builtin-type> ::= 'DF' <number> '_' # ISO/IEC TS 18661 _FloatN
Would you mind submitting a pull request?
from cxx-abi.
Many thanks and yes, I will start preparing a patch.
from cxx-abi.
That patch is #22, for the record.
from cxx-abi.
Patch approved. Thanks!
from cxx-abi.
@smeijer1234 Are you aware of any implementations that currently use this mangling? The Clang folks are uncertain whether it was intended to not make these manglings substitution candidates. If we're bound by ABI compatibility for them, then so be it, but if we added this as a forward-looking change and are just now introducing implementations that use it, maybe we can still allow these to be substituted.
from cxx-abi.
Related Issues (20)
- "Deducing this" mangling HOT 14
- Should std::rethrow_exception be covered by the EH ABI? HOT 2
- Emergency EH buffer is overspecified HOT 6
- Where is the most recent ABI document? HOT 1
- Add `[[trivial_abi]]` attribute
- Lambda POD for the purposes of layout? HOT 2
- Mangling the name of an externally visible lambda in a static data member of a class HOT 1
- Proposal: Include an optional specification for mangling names that reference anonymous symbols HOT 4
- Is it possible to form a pointer-to-data-member with offset -1 using explicit derived-to-base conversions without UB? HOT 3
- unnecessary `E`s after <expression> and mangling collisions between <expression> and <number> HOT 1
- need mangling for lambdas appearing in unevaluated operands within a class body HOT 3
- What does "forbidding the use of function templates" mean? HOT 2
- [C++20] [Modules] Do we need the concept of `key function` for class defined in module purview? HOT 25
- Missing HTML encoding in 2.3.1 Data Member Pointers HOT 2
- Proposal: document or somehow notice __cxa_init_primary_exception HOT 3
- Mangling for C++ pack indexing HOT 1
- Function and function pointer types with vendor calling conventions HOT 2
- Ambiguity in mangling grammar around type qualifiers HOT 8
- Question about section 2.9.4 HOT 4
- Questions About Non-POD Types Data Layout HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cxx-abi.