Changed some optimizations for Raspi.

pull/1/head
Holger Wirtz 8 years ago
parent 4603fbe056
commit 7634ad2e2c
  1. 33
      src/Makefile
  2. 6
      src/dexed.cpp

@ -8,15 +8,42 @@ LDFLAGS=-L/usr/local/lib -llvtk_plugin2
ifeq ($(ARCH),)
ARCH := $(shell uname -m)
endif
machine = $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
ifneq ($(findstring armv7,$(ARCH)),)
CXXFLAGS += -mfpu=neon -march=armv7-a -marm
# Raspberry Pi B+, Zero, etc
ifneq (,$(findstring armv6l,$(machine)))
CPU = -mcpu=arm1176jzf-s
FPU = -mfpu=vfp
endif
# Raspberry Pi 2 and 3
ifneq (,$(findstring armv7l,$(machine)))
model = $(shell sh -c 'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown')
ifneq (,$(findstring 3,$(model)))
CPU = -mcpu=cortex-a53
FPU = -mfpu=neon-fp-armv8
else
CPU = -mcpu=cortex-a7 -mthumb
FPU = -mfpu=neon-vfpv4
endif
FPU += -mneon-for-64bits
endif
# ARM A64
ifneq (,$(findstring aarch64,$(machine)))
CPU = -mcpu=cortex-a53
PLATFORM += -mabi=lp64 -mcmodel=tiny
endif
ifneq ($(findstring arm,$(ARCH)),)
CXXFLAGS += -DRASPI
endif
ifeq ($(DEBUG), 1)
CXXFLAGS += -DDEBUG $(CFLAGS)
else
CXXFLAGS += -Ofast $(CFLAGS)
#CXXFLAGS += -Ofast $(CFLAGS) -DRASPI
CXXFLAGS += -Ofast $(CFLAGS) $(CPU) $(FPU)
endif
all: $(BUNDLE) Makefile

@ -372,8 +372,12 @@ void Dexed::GetSamples(uint32_t n_samples, float* buffer)
voices[note].dx7_note->compute(audiobuf.get(), lfovalue, lfodelay, &controllers);
for (uint32_t j=0; j < N; ++j) {
int32_t val = audiobuf.get()[j];
#ifndef RASPI
val = val >> 4;
#else
//val*=2;
val=val<<2; // hope this is an arithmetic shift!
#endif
int32_t clip_val = val < -(1 << 24) ? 0x8000 : val >= (1 << 24) ? 0x7fff : val >> 9;
float f = float(clip_val) / float(0x8000);
if(f>1.0)

Loading…
Cancel
Save