mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Prevent ftrace from misaligning functions
This commit is contained in:
parent
b8a6a989c0
commit
b94b29d79c
2 changed files with 4 additions and 1 deletions
|
@ -471,7 +471,7 @@ ifeq ($(ARCH), x86_64)
|
|||
# jmp -7 # 2 bytes
|
||||
# ...
|
||||
#
|
||||
CONFIG_CCFLAGS += -fpatchable-function-entry=11,9
|
||||
CONFIG_CCFLAGS += -fpatchable-function-entry=18,16
|
||||
endif
|
||||
ifeq ($(ARCH), aarch64)
|
||||
# this flag causes gcc to generate functions like this
|
||||
|
|
3
third_party/ggml/fp16.c
vendored
3
third_party/ggml/fp16.c
vendored
|
@ -26,6 +26,7 @@
|
|||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "third_party/ggml/fp16.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/ggml/fp16.internal.h"
|
||||
#include "third_party/libcxx/math.h"
|
||||
|
@ -124,6 +125,7 @@ inline static float ggml_silu_f32(float x) {
|
|||
|
||||
void ggml_fp16_init(void) {
|
||||
ggml_fp16_t ii;
|
||||
ftrace_enabled(-1);
|
||||
for (int i = 0; i < (1 << 16); ++i) {
|
||||
uint16_t ui = i;
|
||||
memcpy(&ii, &ui, sizeof(ii));
|
||||
|
@ -132,4 +134,5 @@ void ggml_fp16_init(void) {
|
|||
table_silu_f16[i] = GGML_FP32_TO_FP16(ggml_silu_f32(f));
|
||||
table_exp_f16[i] = GGML_FP32_TO_FP16(expf(f));
|
||||
}
|
||||
ftrace_enabled(+1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue