User avatar
ValterFukuoka
Posts: 102
Joined: Sat Oct 01, 2011 11:39 pm
Location: Japan

RPIZero arm1176jzf-s machine code...

Fri Sep 13, 2019 12:23 am

Hi, I am compiling NodeJS module WebRTC (node-wrtc) from source to target the armv6zk (arm1176jzf-s), the RPIZero CPU.
As part of the compilation, it is necessary to compile WebRTC code itself to target the armv6zk.
Both codes, the NodeJS module and WebRTC, are compiled with flags/arguments march="armv6zk" and mtune"arm1176jzf-s"...

The WebRTC compilation toolkit provides a compiler which accept the flag "use_neon=false", that I am using to invoke the compilation...

I tested the result on a RPIZero, it works OK!
The code is also working on a RPI3, which is expected...

On the RPIZero, I am ONLY interested in using WebRTC DataChannel, which is a small part of the whole, and don't have any intention of using audio or video streaming... so, the generated code is working on the RPIZero from the DataChannel function point of view...

I found a "concern", and this is the topic of the present message...

Inside the WebRTC code, out of 2871 generated binaries, 12 of them (listed below) have VFPv3 and NEON machine code!?!?


The following is the output from "readelf -A":

Code: Select all

./third_party/boringssl/boringssl_asm/sha512-armv4.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/boringssl/boringssl_asm/ghashv8-armx32.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/boringssl/boringssl_asm/sha1-armv4-large.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/boringssl/boringssl_asm/x25519-asm-arm.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/boringssl/boringssl_asm/ghash-armv4.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/boringssl/boringssl_asm/aesv8-armx32.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/boringssl/boringssl_asm/bsaes-armv7.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/boringssl/boringssl_asm/armv4-mont.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone

  
  ./third_party/boringssl/boringssl_asm/chacha-armv4.o
  Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone
  
  
  ./third_party/boringssl/boringssl_asm/poly1305_arm_asm.o
  Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/boringssl/boringssl_asm/sha256-armv4.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone


./third_party/opus/opus/celt_pitch_xcorr_arm_gnu.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "arm1176jzf-s"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_CPU_unaligned_access: None
  Tag_Virtualization_use: TrustZone



Looking at the names of the files, the "asm" part probably implicates that these are assembly instructions targeting VFPv3 and NEONv1 machine code...

My question is:
Does the arm1176jzf-s (Raspi Zero) have the ability to run (emulate) VFPv3 and NEONv1?

What happens when these specifics portion of the code is called (in a RPIZero)?

Is there any other way to interpret the abouve output of readelf utility?

Does anybody have any experience with similar situation?

Thanks in advance,
Valter

User avatar
ValterFukuoka
Posts: 102
Joined: Sat Oct 01, 2011 11:39 pm
Location: Japan

Re: RPIZero arm1176jzf-s machine code...

Fri Sep 13, 2019 6:46 pm

Looking at Chromium inside a Buster RaspberryPI Zero, there seems to be 2 versions; one is probably the v6 version, and the other is marked v7...

The v6 version, also, gives the same result that I am talking about above...
"VFPv3" and "NEONv1" instructions... while the v7 shows arm-v7 cpu-name/arch...

Code: Select all

[email protected]:/usr/lib/chromium-browser $ readelf -A chromium-browser
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6"
  Tag_CPU_arch: v6
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_ABI_PCS_GOT_use: GOT-indirect
  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_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


[email protected]:/usr/lib/chromium-browser $ readelf -A chromium-browser-v7 
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "ARM v7"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv4
  Tag_Advanced_SIMD_arch: NEONv1 with Fused-MAC
  Tag_ABI_PCS_GOT_use: GOT-indirect
  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_enum_size: int
  Tag_ABI_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6
  Tag_ABI_FP_16bit_format: IEEE 754
So, what is the meaning of this last piece of information?
Is the RPIZero arm1176jzf-s able to run "VFPv3" and "NEONv1" instruction, native or by emulation?

Or, the current Buster Chromium compilation for RPIZero is getting the same results that I am describing on the first post? On the same pieces of code (borinssl related)?


For reference, below is the readelf -A result for the galculator...

Code: Select all

[email protected]:/usr/bin $ readelf -A galculator 
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv2
  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_HardFP_use: Deprecated
  Tag_ABI_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6

Also, current Buster Firefox-esr readelf -A output...

Code: Select all

[email protected]:/usr/lib/firefox-esr $ readelf -A firefox-esr
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv2
  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
Firefox-esr and Chromium shows different data... Firefox shows "VFPv2" and DOES NOT show "NEONv1"...

Thanks,
Valter

Return to “Advanced users”