-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a builtin function for every llvm C library intrinsic and bit manipulation instrinsics #767
Comments
I like the idea of std library functions calling directly into intrinsics when possible, but that makes me wonder why the intrinsic would be available to user space at all, or at least why it would look the same as the other built-ins. The number of potential |
The standard library is user space. The other built-ins are very similar. These are no different than
It's not that large. We're talking about adding 25 functions, and there are no name collisions, and we already use |
Fair enough, but at the least it would help to group them in the documentation at some point, I think. |
* add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
* bitreverse - give bswap behavior * bitreverse, comptime_ints, negative values still not working? * bitreverse working for negative comptime ints * Finished bitreverse test cases * Undo exporting a bigint function. @bitreverse test name includes ampersand * added docs entry for @bitreverse
Standard C Library Intrinsics
Bit Manipulation Intrinsics
|
This requires adding a libm implementation to zig,(which i started here #2709) as llvm generates libcalls to libm. Also, once this is complete, I want to move implementations into |
Does LLVM also have a Would this be considered to be added for this too, or should that be a seperate issue? |
That one is a little tricky to do (if llvm already exports it which it
probably does) so I think you should open another issue.
El lun., 2 sept. 2019 14:23, Tetralux <[email protected]> escribió:
… Does LLVM also have a pause intrinsic?
https://www.felixcloutier.com/x86/pause
Would this be considered to be added for this too, or should that be a
seperate issue?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#767?email_source=notifications&email_token=AAD4W4SNQSQ7PWCGCGZWPP3QHVR4NA5CNFSM4EQCJ7RKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5WN5BA#issuecomment-527228548>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD4W4VDTT3ODCLK2DYF76LQHVR4NANCNFSM4EQCJ7RA>
.
|
semi-related to #1290, ie for powi |
std/special/builtin.zig no longer exists. Can I get a summary of where the intrinsics are implemented, and how they are exposed as |
mainly here |
http://llvm.org/docs/LangRef.html#standard-c-library-intrinsics
http://llvm.org/docs/LangRef.html#bit-manipulation-intrinsics
LLVM has these because
This issue is to
@
builtin functions in zigrelated: #514
The text was updated successfully, but these errors were encountered: