Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

armv5 target #379

Closed
ghost opened this issue Jul 17, 2015 · 1 comment
Closed

armv5 target #379

ghost opened this issue Jul 17, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 17, 2015

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

    inline int lsb32(uint32_t v) {
      __asm__("rbit %0, %1" : "=r"(v) : "r"(v));
      return __builtin_clz(v);
    }

With

    inline int lsb32(uint32_t v) {
      return __builtin_ctz(v);
    }
  1. update Makefile

a) add configuration for armv5 target somewhere near the similar armv7 conf

            ifeq ($(ARCH),armv5)
                    arch = armv5
                    prefetch = yes
                    bsfq = yes
            endif

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"

  1. build

make profile-build ARCH=armv5

@zamar
Copy link

zamar commented Dec 18, 2015

I suspect that hardly anyone would be using armv5 target. At least no one has shown interest in this.

Thus I'm closing this issue. Feel free to reopen if there is a genuine interest in this target.

@zamar zamar closed this as completed Dec 18, 2015
niklasf pushed a commit to niklasf/Stockfish that referenced this issue Jul 13, 2017
Tweak mobility bonus of minor pieces in crazyhouse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant