Skip to content

Documentation: std::intrinsics::cttz does not specify the handling of zero. #34381

Closed
@gnzlbg

Description

@gnzlbg

The llvm docs for `llvm.cttz.iX(value, flag) specifies that a flag can be passed to control whether zero provides a defined result or not.

Whether std::intrinsics::cttz provides a defined result for zero or not should be specified in the documentation, since if not some code might require if x == 0 { mem::sizeof(x) * 8 } else { std::intrinsics::cttz(x) } to be used (instead of just std::intrinsics::cttz(x)).

See the LLVM documentation: http://llvm.org/docs/LangRef.html#llvm-cttz-intrinsic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions