llvm-capstone/libc/include/llvm-libc-macros
Joseph Huber ef169f5707
[libc] Improve the implementation of the rand() function (#66131)
Summary:
This patch improves the implementation of the standard `rand()` function
by implementing it in terms of the xorshift64star pRNG as described in
https://en.wikipedia.org/wiki/Xorshift#xorshift*. This is a good,
general purpose random number generator that is sufficient for most
applications that do not require an extremely long period. This patch
also correctly initializes the seed to be `1` as described by the
standard. We also increase the `RAND_MAX` value to be `INT_MAX` as the
standard only specifies that it can be larger than 32768.
2023-09-12 16:52:20 -05:00
..
gpu [libc] Implement the 'clock()' function on the GPU 2023-08-30 16:16:34 -05:00
linux [libc] Add support to compile some syscalls on 32 bit platform 2023-08-03 10:08:01 -03:00
CMakeLists.txt [libc] Remove hard dependencies on linux from macros headers 2023-08-29 11:38:34 -05:00
fcntl-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
fenv-macros.h [libc] Enable hermetic floating point tests again. 2023-06-14 10:53:35 -04:00
file-seek-macros.h [libc] Add implementation of POSIX lseek function. 2022-03-15 16:24:48 +00:00
generic-error-number-macros.h [libc] Make ErrnoSetterMatcher handle logging floating point values. 2023-05-26 06:24:51 +00:00
math-macros.h [libc] Move math.h and fenv.h macro definitions to llvm-libc-macros. 2023-03-07 18:08:52 +00:00
null-macro.h [libc][NFC] Simplify how the definiton of NULL macro is added to string.h. 2022-12-20 19:14:27 +00:00
sched-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
signal-macros.h [libc] Re-enable functions from signal.h and re-enable abort. 2022-09-30 07:31:50 +00:00
stdio-macros.h [libc] Add definitions of a few missing macros and types. 2022-11-02 07:17:33 +00:00
stdlib-macros.h [libc] Improve the implementation of the rand() function (#66131) 2023-09-12 16:52:20 -05:00
sys-auxv-macros.h [libc] add headers sys/auxv sys/prctl and sys/time 2022-10-12 13:19:50 -07:00
sys-ioctl-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
sys-mman-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
sys-random-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
sys-resource-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
sys-select-macros.h [libc] Add select.h and the implementation of the select function for Linux. 2022-10-22 03:17:48 +00:00
sys-socket-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
sys-stat-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
sys-time-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
sys-wait-macros.h [libc] Add a minimal implementation of the POSIX fork function. 2022-10-04 19:12:08 +00:00
termios-macros.h [libc] Add termios.h and the implementation of functions declared in it. 2022-10-18 20:53:00 +00:00
time-macros.h [libc] Fix 'clock()' testing on the GPU 2023-08-30 16:58:11 -05:00
unistd-macros.h [libc] Correct usage of __unix__ and __linux__ 2023-07-03 01:08:15 +01:00
wchar-macros.h [libc] add basic wide char functions 2023-03-20 16:36:21 -07:00