Make improvements

- Introduce portable sched_getcpu() api
- Support GCC's __target_clones__ feature
- Make fma() go faster on x86 in default mode
- Remove some asan checks from core libraries
- WinMain() now ensures $HOME and $USER are defined
This commit is contained in:
Justine Tunney 2024-02-01 03:39:46 -08:00
parent d5225a693b
commit 2ab9e9f7fd
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
192 changed files with 2809 additions and 932 deletions

View file

@ -17,7 +17,6 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/dce.h"
#include "libc/intrin/asan.internal.h"
#include "libc/limits.h"
#include "libc/nexgen32e/x86feature.h"
#include "libc/stdckdint.h"
@ -38,7 +37,7 @@ static inline const wchar_t *wmemrchr_pure(const wchar_t *s, wchar_t c,
#if defined(__x86_64__) && !defined(__chibicc__)
static inline const wchar_t *wmemrchr_sse(const wchar_t *s, wchar_t c,
size_t n) {
size_t n) {
size_t i;
unsigned m;
xmm_t v, t = {c, c, c, c};
@ -68,16 +67,9 @@ static inline const wchar_t *wmemrchr_sse(const wchar_t *s, wchar_t c,
* @return is pointer to first instance of c or NULL if not found
* @asyncsignalsafe
*/
void *wmemrchr(const wchar_t *s, wchar_t c, size_t n) {
__vex void *wmemrchr(const wchar_t *s, wchar_t c, size_t n) {
#if defined(__x86_64__) && !defined(__chibicc__)
size_t bytes;
const void *r;
if (IsAsan()) {
if (ckd_mul(&bytes, n, sizeof(wchar_t))) bytes = -1;
__asan_verify(s, bytes);
}
r = wmemrchr_sse(s, c, n);
return (void *)r;
return (void *)wmemrchr_sse(s, c, n);
#else
return (void *)wmemrchr_pure(s, c, n);
#endif