mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-23 00:36:42 -10:00
retro_half_to_float and retro_float_to_half convert IEEE 754 binary16 to and from binary32 with integer arithmetic only, so flush-to-zero and denormals-are-zero modes change nothing. Narrowing rounds to nearest, ties to even, as F16C and GPUs do; subnormal halves, signed zeros, infinities and NaNs are kept (a signalling NaN comes back quiet). The Direct3D and Vulkan HDR screenshot paths each had a private copy of the widening; both use the header now. float16_test checks every half against its value and its round trip, the floats in and near the half range of both signs against F16C's VCVTPS2PH (a stride elsewhere), a stride against the nearest half by search, and the same again with FTZ and DAZ set.
41 lines
768 B
Makefile
41 lines
768 B
Makefile
include ../../sample_objdir.mk
|
|
|
|
TARGET := float16_test
|
|
|
|
LIBRETRO_COMM_DIR := ../../..
|
|
|
|
SOURCES := float16_test.c
|
|
|
|
OBJS := $(call sample_objs,$(SOURCES:.c=.o))
|
|
|
|
CFLAGS += -Wall -pedantic -std=gnu99 -g1 -O2 -I$(LIBRETRO_COMM_DIR)/include
|
|
|
|
ifneq ($(findstring mingw,$(CC)),)
|
|
EXE := .exe
|
|
endif
|
|
|
|
ifneq ($(SANITIZER),)
|
|
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
|
|
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
|
endif
|
|
|
|
LDLIBS += -lm
|
|
|
|
all: $(TARGET)$(EXE)
|
|
|
|
%.o: %.c
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
|
|
@mkdir -p $(@D)
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
$(TARGET)$(EXE): $(OBJS)
|
|
$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
|
|
|
|
clean:
|
|
rm -rf $(SAMPLE_OBJDIR)
|
|
rm -f $(TARGET) $(TARGET).exe $(OBJS)
|
|
|
|
.PHONY: all clean
|