I wanted to propose adding an armv5 target. Maybe nobody uses this except me, so I'm not sure how important this is. Anyway, here are the steps I use to compile stockfish on my kirkwood devices (armv5te).
Regarding step 1, I think that replacement might be preferable even for armv7. Recent gcc is smart enough to perform that optimization when it encounters __builtin_ctz(), so there should be no need to add the asm and subsequent clz call. This also applies to MIPS. But I don't want to hurt any armv7 performance if I'm wrong... Mostly I suggest checking this out and (probably) switching for all ARM.
Step 2.b is quite specific to the hardware I run and also (less so) to the gcc version I use. (I use 4.8.x and greater) So 2.b is probably not recommended to be added in its entirety. Perhaps -mtune=armv5 would be best here. Probably -fno-caller-saves is universally useful too. I don't think PIE matters for armv5 which is why you don't see that anywhere.
So here's the steps I take when compiling for kirkwood:
b) armv5 CXXFLAGS specific to this device and gcc version
ifeq ($(arch),armv5)
CXXFLAGS += -pipe -march=armv5te -mtune=xscale -fweb -fno-caller-saves -frename-registers -fomit-frame-pointer
endif
c) add armv5 target to the help section near armv7
@echo "armv5 > ARMv5 32-bit"
d) include armv5 in the sanity check
@test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "armv7" || test "$(arch)" = "armv5"
I wanted to propose adding an armv5 target. Maybe nobody uses this except me, so I'm not sure how important this is. Anyway, here are the steps I use to compile stockfish on my kirkwood devices (armv5te).
Regarding step 1, I think that replacement might be preferable even for armv7. Recent gcc is smart enough to perform that optimization when it encounters __builtin_ctz(), so there should be no need to add the asm and subsequent clz call. This also applies to MIPS. But I don't want to hurt any armv7 performance if I'm wrong... Mostly I suggest checking this out and (probably) switching for all ARM.
Step 2.b is quite specific to the hardware I run and also (less so) to the gcc version I use. (I use 4.8.x and greater) So 2.b is probably not recommended to be added in its entirety. Perhaps -mtune=armv5 would be best here. Probably -fno-caller-saves is universally useful too. I don't think PIE matters for armv5 which is why you don't see that anywhere.
So here's the steps I take when compiling for kirkwood:
1) update bitboard.h
Replace
With
2) update Makefile
a) add configuration for armv5 target somewhere near the similar armv7 conf
b) armv5 CXXFLAGS specific to this device and gcc version ifeq ($(arch),armv5) CXXFLAGS += -pipe -march=armv5te -mtune=xscale -fweb -fno-caller-saves -frename-registers -fomit-frame-pointer endif
c) add armv5 target to the help section near armv7
d) include armv5 in the sanity check @test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "armv7" || test "$(arch)" = "armv5"
3) build
make profile-build ARCH=armv5