Skip to content

[Clang] Add __builtin_bswapg #160266

@philnik777

Description

@philnik777

Currently Clang has __builtin_bswap{16,32,64}. It would be great if there was a __builtin_bswapg that works on any integral types that has a multiple of 16 bits as well as a single byte, which would simply be the identity. This would avoid a long if constexpr chain when implementing std::byteswap, which uses the same codegen path in the end anyways. It would also make it trivial to add support for _BitInt as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:bytecodeIssues for the clang bytecode constexpr interpreterclang:frontendLanguage frontend issues, e.g. anything involving "Sema"enhancementImproving things as opposed to bug fixing, e.g. new or missing featuregood first issuehttps://github.com/llvm/llvm-project/contribute

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions