Skip to content

add a builtin function for every llvm C library intrinsic and bit manipulation instrinsics #767

Description

@andrewrk

http://llvm.org/docs/LangRef.html#standard-c-library-intrinsics
http://llvm.org/docs/LangRef.html#bit-manipulation-intrinsics

LLVM has these because

  • they can sometimes map to hardware instructions (such as sqrt) (see Add hw sqrt for x86_64 #681)
  • LLVM codegen assumes that it can call these functions, which is why we have to provide compiler_rt.o
  • additional optimization awareness and integration with fast-math

This issue is to

  • implement all the intrinsics in std/special/builtin.zig
  • add all the intrinsics as @ builtin functions in zig
  • most std.math.* functions can just call out to the builtin functions

related: #514

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThis proposal is planned.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions