GithubHelp home page GithubHelp logo

precompile for armv6? about tflite_beam HOT 3 CLOSED

cocoa-xu avatar cocoa-xu commented on May 19, 2024
precompile for armv6?

from tflite_beam.

Comments (3)

cocoa-xu avatar cocoa-xu commented on May 19, 2024 1

Hi @petermm, precompiled version for armv6 is available now as in v0.3.5. I'm going to close this issue, but please free feel to reopen it if it doesn't work 😃

from tflite_beam.

cocoa-xu avatar cocoa-xu commented on May 19, 2024

Ah yes, that one is specific to RPi (using armv6-nerves-linux-gnueabihf-gcc with its own optimisation args). I'm hesitating if it's worth to invest in this right now, given that most armv6 devices are relatively old and not that powerful. But for sure, this can be one of the todos for this project.

from tflite_beam.

cocoa-xu avatar cocoa-xu commented on May 19, 2024

The other problem is using armv6-nerves-linux-gnueabihf-gcc for rpi with flags specified in nerves_system_rpi, it will generate binaries for armv6kz, which is the one for RPi.

$ readelf -A libedgetpu.so.1.0
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6KZ"
  Tag_CPU_arch: v6KZ
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv2
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6
  Tag_ABI_FP_16bit_format: IEEE 754
  Tag_Virtualization_use: TrustZone

However, when using arm-linux-gnueabihf-gcc from the default apt repos

apt install gcc-arm-linux-gnueabihf

with the same flags from nerves_system_rpi

-mabi=aapcs-linux -mfpu=vfp -marm -fstack-protector-strong -mfloat-abi=hard -mcpu=arm1176jzf-s -fPIE -pie -Wl,-z,now -Wl,-z,relro

the binary it outputs is compiled for armv7a.

$ /usr/bin/arm-linux-gnueabihf-gcc -mabi=aapcs-linux -mfpu=vfp -marm -fstack-protector-strong -mfloat-abi=hard -mcpu=arm1176jzf-s -fPIE -pie -Wl,-z,now -Wl,-z,relro 1.c
$ readelf -A a.out
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3-D16
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_rounding: Needed
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6
  Tag_Virtualization_use: TrustZone

Although I can just download the nerves toolchain, but it is essentially specific for the arm1176jzf CPU, i.e., Raspberry Pi (or perhaps we can even further relax it to any armv6kz CPU), but it's still not for any armv6 CPU.

I'm not an expert in compiler and compiler options, so if anyone has any idea/suggestion/comments on this, please feel free to reply.

from tflite_beam.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.