mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Delete some unintentional code
This commit is contained in:
parent
165c6b37e2
commit
c67faf61df
2 changed files with 0 additions and 71 deletions
|
@ -1,67 +0,0 @@
|
|||
#include <assert.h>
|
||||
#include <cxxabi.h>
|
||||
#include <errno.h>
|
||||
#include <stdckdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/cosmo.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/time.h"
|
||||
|
||||
void nothing(void) {
|
||||
}
|
||||
|
||||
void (*barrier)(void) = nothing;
|
||||
|
||||
struct timespec now(void) {
|
||||
struct timespec ts;
|
||||
timespec_get(&ts, TIME_UTC);
|
||||
return ts;
|
||||
}
|
||||
|
||||
long long tonanos(struct timespec x) {
|
||||
return x.tv_sec * 1000000000ll + x.tv_nsec;
|
||||
}
|
||||
|
||||
struct timespec tub(struct timespec a, struct timespec b) {
|
||||
a.tv_sec -= b.tv_sec;
|
||||
if (a.tv_nsec < b.tv_nsec) {
|
||||
a.tv_nsec += 1000000000;
|
||||
a.tv_sec--;
|
||||
}
|
||||
a.tv_nsec -= b.tv_nsec;
|
||||
return a;
|
||||
}
|
||||
|
||||
#define BENCH(ITERATIONS, WORK_PER_RUN, CODE) \
|
||||
do { \
|
||||
struct timespec start = now(); \
|
||||
for (int i = 0; i < ITERATIONS; ++i) { \
|
||||
barrier(); \
|
||||
CODE; \
|
||||
} \
|
||||
long long work = WORK_PER_RUN * ITERATIONS; \
|
||||
double nanos = (tonanos(tub(now(), start)) + work - 1) / (double)work; \
|
||||
printf("%10g ns %2dx %s\n", nanos, ITERATIONS, #CODE); \
|
||||
} while (0)
|
||||
|
||||
char got[5632];
|
||||
char huge[262144];
|
||||
|
||||
__static_yoink("PrintBacktraceUsingSymbols");
|
||||
__static_yoink("GetSymbolTable");
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
ShowCrashReports();
|
||||
const char *sym =
|
||||
"_ZN12_GLOBAL__N_116tinyBLAS_Q0_AVX2ILi0E10block_q4_010block_"
|
||||
"q8_0fE4gemmILi3ELi2ELi0EEEvllll";
|
||||
__demangle(got, sym, sizeof(got));
|
||||
printf("%s\n", got);
|
||||
BENCH(1000, 1, __demangle(got, sym, sizeof(got)));
|
||||
}
|
|
@ -100,10 +100,6 @@ $(LIBC_STR_A_OBJS): private \
|
|||
-Wframe-larger-than=4096 \
|
||||
-Walloca-larger-than=4096
|
||||
|
||||
o/$(MODE)/libc/str/demangle.o: private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
-ffreestanding
|
||||
|
||||
LIBC_STR_LIBS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)))
|
||||
LIBC_STR_SRCS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)_SRCS))
|
||||
LIBC_STR_HDRS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)_HDRS))
|
||||
|
|
Loading…
Reference in a new issue