Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

warning: 'assume_aligned' attribute directive ignored #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions butteraugli/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
LDLIBS += -lpng -ljpeg
CXXFLAGS += -std=c++11 -I..
LINK.o = $(LINK.cc)
CFLAGS += $(echo 'void* my_alloc1() __attribute__((assume_aligned(16)));' | gcc -x c - -c -o /dev/null -Werror && echo -DHAS_ASSUME_ALIGNED)

all: butteraugli.o butteraugli_main.o butteraugli

Expand Down
7 changes: 4 additions & 3 deletions butteraugli/butteraugli.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ bool ButteraugliAdaptiveQuantization(size_t xsize, size_t ysize,
#define BUTTERAUGLI_RESTRICT __restrict__
#endif

#ifdef _MSC_VER
#define BUTTERAUGLI_CACHE_ALIGNED_RETURN /* not supported */
#else

#ifdef HAS_ASSUME_ALIGNED
#define BUTTERAUGLI_CACHE_ALIGNED_RETURN __attribute__((assume_aligned(64)))
#else
#define BUTTERAUGLI_CACHE_ALIGNED_RETURN /* not supported */
#endif

// Alias for unchangeable, non-aliased pointers. T is a pointer type,
Expand Down