Make improvements

- wcsstr() is now linearly complex
- strstr16() is now linearly complex
- strstr() is now vectorized on aarch64 (10x)
- strstr() now uses KMP on pathological cases
- memmem() is now vectorized on aarch64 (10x)
- memmem() now uses KMP on pathological cases
- Disable shared_ptr::owner_before until fixed
- Make iswlower(), iswupper() consistent with glibc
- Remove figure space from iswspace() implementation
- Include line and paragraph separator in iswcntrl()
- Use Musl wcwidth(), iswalpha(), iswpunct(), towlower(), towupper()
This commit is contained in:
Justine Tunney 2024-09-01 01:14:40 -07:00
parent e1528a71e2
commit 7c83f4abc8
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
67 changed files with 5602 additions and 5165 deletions

View file

@ -16,15 +16,23 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/thread/thread.h"
#ifdef _MSC_VER
#include <intrin.h>
#else
#include <xmmintrin.h>
#endif
/**
* Yields hyperthread.
*/
void pthread_pause_np(void) {
#if defined(__GNUC__) && defined(__aarch64__)
__asm__ volatile("yield");
#elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
__asm__ volatile("pause");
__asm__("yield");
#elif defined(__x86_64__) || defined(__i386__)
_mm_pause();
#elif defined(__GNUC__) && (defined(__PPC__) || defined(__PPC64__))
__asm__("or 27,27,27");
#else
// do nothing
#endif
}