unfinished :p
___ss 32 x 1 F3 0F OP ...
___sd 64 x 1 F2 0F OP ...
___ps 32 x 4 0F OP ...
___pd 64 x 2 66 0F OP ...
| // I tried not doing anything too non-portable so it should be possible to run | |
| // this on Mac or Linux... probably... even then, you can't use the obj files there | |
| // | |
| // once you have the obj file you should be able to do: | |
| // link YOUROBJ.obj /defaultlib:libcmt | |
| // ^^^^^^^^^^^^^^^^^^ | |
| // linking against crt | |
| #define _CRT_SECURE_NO_WARNINGS | |
| #include <stdint.h> | |
| #include <stdlib.h> |
| #include <stdio.h> | |
| static const char* find_char(const char* s, int ch) { | |
| while (*s && *s != ch) s++; | |
| return *s == ch ? s + 1 : s; | |
| } | |
| #define BALLER(start, end, text) \ | |
| for (const char* start = text, *end; \ | |
| end = find_char(start, ' '), (end-start) > 1; \ |
| #include <cstdlib> | |
| #include <string> | |
| #include <numeric> | |
| #include <execution> | |
| // enable modern c++ if you're a cool enterprise person | |
| #if MODERN_CPP | |
| bool is_word_beginning(char l, char r) { return std::isspace(l) && !std::isspace(r); } | |
| std::size_t word_count(std::string_view s) { |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #define INITIAL_CAP 64 | |
| typedef struct ArrayHeader { | |
| // honestly storing the type size is kinda weird | |
| size_t size, capacity; |
| // MIT License | |
| // | |
| // Copyright (c) 2021 Yasser Arguelles Snape | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <x86intrin.h> | |
| static const char keywords[][16] = { | |
| "auto", | |
| "break", | |
| "case", |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <stdatomic.h> | |
| #include <threads.h> | |
| #define NUM_THREADS 8 | |
| static _Atomic size_t tasks_reserved; | |
| static _Atomic size_t tasks_complete; |