Giter VIP home page Giter VIP logo

Comments (7)

thiagomacieira avatar thiagomacieira commented on July 2, 2024

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.

smeijer1234 avatar smeijer1234 commented on July 2, 2024

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.

rjmccall avatar rjmccall commented on July 2, 2024

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.

smeijer1234 avatar smeijer1234 commented on July 2, 2024

Many thanks and yes, I will start preparing a patch.

from cxx-abi.

rjmccall avatar rjmccall commented on July 2, 2024

That patch is #22, for the record.

from cxx-abi.

rjmccall avatar rjmccall commented on July 2, 2024

Patch approved. Thanks!

from cxx-abi.

rjmccall avatar rjmccall commented on July 2, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.