'embeded/ARM'에 해당되는 글 105건

  1. 2022.08.26 arm asm rbit(비트 뒤집기)
  2. 2022.01.23 vfp, neon cycle
  3. 2021.06.21 cortex-a9 neon
  4. 2021.06.21 EIM (external interface module)
  5. 2021.05.15 ARMv9 SVE2
  6. 2021.03.18 cortex-a9 하드웨어 Divider가 없어?!
  7. 2021.01.13 gcc 버전 차이?
  8. 2021.01.13 vfp
  9. 2021.01.12 NEON 강제활성화?
  10. 2020.12.10 softfp와 hardfp
embeded/ARM2022. 8. 26. 18:25

왜 찾게 되었냐면.. 알고 싶지 않았습니다.. -_-

[링크 : https://stackoverflow.com/questions/20436466/lsb-to-msb-bit-reversal-on-arm]

 

RBIT
Reverse the bit order in a 32-bit word.

Syntax
RBIT{cond} Rd, Rn

[링크 : https://developer.arm.com/documentation/dui0473/m/arm-and-thumb-instructions/rbit]

 

REV
Reverse the byte order in a word.

Syntax
REV{cond} Rd, Rnn

[링크 : https://developer.arm.com/documentation/dui0473/m/arm-and-thumb-instructions/rev]

'embeded > ARM' 카테고리의 다른 글

i.mx8m plus arm trust zone  (0) 2023.02.24
ampere altra / 기가바이트 R272-P30 / 우분투  (0) 2023.02.03
vfp, neon cycle  (0) 2022.01.23
cortex-a9 neon  (0) 2021.06.21
EIM (external interface module)  (0) 2021.06.21
Posted by 구차니
embeded/ARM2022. 1. 23. 18:08

부동 소수점 +,-,*는 그래도 1사이클에 끝나지만 /는 10사이클 소요됨.

[링크 : https://developer.arm.com/documentation/ddi0409/f/instruction-timing/instruction-specific-scheduling/vfp-instruction-timing]

[링크 : https://developer.arm.com/documentation/ddi0409/g/Instruction-Timing/Instruction-specific-scheduling/Instruction-timing-tables]

 

VFP에 vector가 들어간다고 해도 NEON 수준의 병렬성은 제공하지 않음

The VFP architecture was intended to support execution of short "vector mode" instructions but these operated on each vector element sequentially and thus did not offer the performance of true single instruction, multiple data (SIMD) vector parallelism.

[링크 : https://en.wikipedia.org/wiki/ARM_architecture#VFP]

'embeded > ARM' 카테고리의 다른 글

ampere altra / 기가바이트 R272-P30 / 우분투  (0) 2023.02.03
arm asm rbit(비트 뒤집기)  (0) 2022.08.26
cortex-a9 neon  (0) 2021.06.21
EIM (external interface module)  (0) 2021.06.21
ARMv9 SVE2  (0) 2021.05.15
Posted by 구차니
embeded/ARM2021. 6. 21. 18:55

NEON은 다 동일하다는데

Cortex-A9만 2개씩 밖에 못해서 느리다고 하는데 어느말이 맞는걸까?

 

[링크 : https://stackoverflow.com/questions/12420050/neon-float-multiplication-is-slower-than-expected]

'embeded > ARM' 카테고리의 다른 글

arm asm rbit(비트 뒤집기)  (0) 2022.08.26
vfp, neon cycle  (0) 2022.01.23
EIM (external interface module)  (0) 2021.06.21
ARMv9 SVE2  (0) 2021.05.15
cortex-a9 하드웨어 Divider가 없어?!  (0) 2021.03.18
Posted by 구차니
embeded/ARM2021. 6. 21. 13:54

NXP/freescale i.mx6 전용인진 모르겠지만 SRAM이나 FLASH 그리고 기타 외부장치와 인터페이싱을 제공하는 모듈

(ISA 와 호환성을 가진다고도 하시는데 공식적인 내용은 좀 더 찾아봐야 할 듯)

 

[링크 : https://www.nxp.com/docs/en/application-note/AN2934.pdf]

[링크 : https://www.nxp.com/docs/en/application-note/AN2680.pdf]

 

+

위의 문서에서 MAC7100이 언급되서 찾아보는중.

ARM7TDMI-S 계열의 32bit MCU 이니 ARMv5 계열이려나?

[링크 : https://www.nxp.com/docs/en/data-sheet/MAC7100EC.pdf]

'embeded > ARM' 카테고리의 다른 글

vfp, neon cycle  (0) 2022.01.23
cortex-a9 neon  (0) 2021.06.21
ARMv9 SVE2  (0) 2021.05.15
cortex-a9 하드웨어 Divider가 없어?!  (0) 2021.03.18
gcc 버전 차이?  (0) 2021.01.13
Posted by 구차니
embeded/ARM2021. 5. 15. 09:56

ARMv9이 이번에 발표했는데 관심이 없다가 다시 관심이 가서 검색해보는데

가장 큰 포인트는 요즘 추세에 맞게(?) 인공지능 관련 가속인듯

 

Armv9은 지난 2011년 출시한 ARM 최초의 64비트 지원 아키텍처 'Armv8'의 뒤를 잇는 차세대 반도체 IP다. 이는 슈퍼컴퓨터용 명령어 세트인 '스케일러블 벡터 익스텐션2(SVE2)'을 지원해 Armv8 아키텍처 보다 빠른 머신러닝(ML)과 DSP 성능을 구현한다.

[링크 : https://zdnet.co.kr/view/?no=20210331194029#_enliple ]

 

SVE는 다음의 약자고 v2 이듯 SVE도 존재하는데

Scalable Vector Extension version two

[링크 : https://developer.arm.com/.../sve/sve-vs-sve2/introduction-to-sve2]

 

 

SVE는 neon의 확장이 아는 별개의 instructino 이라고.

Scalable Vector Extension (SVE) is the next-generation SIMD extension of the Arm v8-A AArch64 instruction set. SVE is not an extension of Neon, but a new set of vector instructions that are developed to target HPC workloads. SVE enables vectorization of loops which would either be impossible or not beneficial to vectorize with Neon .

Unlike other SIMD architectures, SVE can be Vector Length Agnostic (VLA). SVE does not fix the size of the vector registers which allows hardware implementors to choose the size that is best for their workloads.

[링크 : https://developer.arm.com/documentation/101726/.../What-is-the-Scalable-Vector-Extension-]

 

갑자기 vfp와 neon과 sve의 연관이 궁금해지네

 

+

2021.05.16

ARMv8.2-A의 선택사양? 아무튼 SVE2가 중요한게 아니라 SVE가 머냐가 문제인가..

The Scalable Vector Extension (SVE) is "an optional extension to the ARMv8.2-A architecture and newer" developed specifically for vectorization of high-performance computing scientific workloads.

[링크 : https://en.wikipedia.org/wiki/AArch64#Scalable_Vector_Extension_(SVE)]

'embeded > ARM' 카테고리의 다른 글

cortex-a9 neon  (0) 2021.06.21
EIM (external interface module)  (0) 2021.06.21
cortex-a9 하드웨어 Divider가 없어?!  (0) 2021.03.18
gcc 버전 차이?  (0) 2021.01.13
vfp  (0) 2021.01.13
Posted by 구차니
embeded/ARM2021. 3. 18. 19:20

공식적으로 없다 있다는 못 찾고, arm 자체 커뮤니티 글에 의하면 없다고 한다.

그나저나 MUL이 있음 DIV도 줘야 하는거 아냐? ㅠㅠ

 

[링크 : https://community.arm.com/.../processors-ip-blog/posts/divide-and-conquer]

 

+

참고로 A7이 A9 이후에 나온거

'embeded > ARM' 카테고리의 다른 글

EIM (external interface module)  (0) 2021.06.21
ARMv9 SVE2  (0) 2021.05.15
gcc 버전 차이?  (0) 2021.01.13
vfp  (0) 2021.01.13
NEON 강제활성화?  (0) 2021.01.12
Posted by 구차니
embeded/ARM2021. 1. 13. 14:47

라즈베리파이 내장(?) arm-arm 컴파일러

$ gcc --version 
gcc (Raspbian 8.3.0-6+rpi1) 8.3.0 
Copyright (C) 2018 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions.  There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[링크 : https://gcc.gnu.org/gcc-8/]

 

i.mx6 용 크로스컴파일러

$ arm-linux-gcc --version 
arm-linux-gcc.br_real (Buildroot 2018.02.5-gee769a6) 6.4.0 
Copyright (C) 2017 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions.  There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[링크 : https://gcc.gnu.org/gcc-6/]

 

시기적으로 크게 차이나는건 아니지만 상위 버전이 6.x와 8.x 차이로 커서 arm neon 관련 지원이 다른걸려나?

[링크 : https://gcc.gnu.org/releases.html]

 

+

gcc changelog 를 뒤져도 아직 발견은 못했는데...

6.x 와 8.x 의 NEON 지원에 무슨 차이가 있는게 아닐까 혹은 vertorized 관련 옵션 구현에 차이가 있나 생각이 든다.

i.mx6용으로 빌드하니 neon 옵션줘도 성능 향상이 없었는데

라즈베리용으로 빌드하니 i.mx6에서 돌릴때 성능 향상이 발생했다.

'embeded > ARM' 카테고리의 다른 글

ARMv9 SVE2  (0) 2021.05.15
cortex-a9 하드웨어 Divider가 없어?!  (0) 2021.03.18
vfp  (0) 2021.01.13
NEON 강제활성화?  (0) 2021.01.12
softfp와 hardfp  (0) 2020.12.10
Posted by 구차니
embeded/ARM2021. 1. 13. 13:48

vfp

뒤에 붙는 D32 D16 F16은 다시 자세히 보니

Double / Float 와 몇개의 레지스터를 가지나 숫자를 표현한 듯?

 

VFPv1
Obsolete
VFPv2
An optional extension to the ARM instruction set in the ARMv5TE, ARMv5TEJ and ARMv6 architectures. VFPv2 has 16 64bit FPU registers.
VFPv3 or VFPv3-D32
Implemented on most Cortex-A8 and A9 ARMv7 processors. It is backwards compatible with VFPv2, except that it cannot trap floating-point exceptions. VFPv3 has 32 64bit FPU registers as standard, adds VCVT instructions to convert between scalar, float and double, adds immediate mode to VMOV such that constants can be loaded into FPU registers.
VFPv3-D16
As above, but with only 16 64-bit FPU registers. Implemented on Cortex-R4 and R5 processors and the Tegra 2 (Cortex-A9).
VFPv3-F16
Uncommon; it supports IEEE754-2008 half-precision (16-bit) floating point as a storage format.
VFPv4 or VFPv4-D32
Implemented on Cortex-A12 and A15 ARMv7 processors, Cortex-A7 optionally has VFPv4-D32 in the case of an FPU with Neon.[110] VFPv4 has 32 64-bit FPU registers as standard, adds both half-precision support as a storage format and fused multiply-accumulate instructions to the features of VFPv3.
VFPv4-D16
As above, but it has only 16 64-bit FPU registers. Implemented on Cortex-A5 and A7 processors in the case of an FPU without Neon.[110]
VFPv5-D16-M
Implemented on Cortex-M7 when single and double-precision floating-point core option exists.

[링크 : https://en.wikipedia.org/wiki/ARM_architecture]

[링크 : https://wiki.debian.org/ArmHardFloatPort/VfpComparison]

 

+

 

[링크 : https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/arm-cortex-a-processors-and-gcc-command-lines]

'embeded > ARM' 카테고리의 다른 글

cortex-a9 하드웨어 Divider가 없어?!  (0) 2021.03.18
gcc 버전 차이?  (0) 2021.01.13
NEON 강제활성화?  (0) 2021.01.12
softfp와 hardfp  (0) 2020.12.10
ampere altra  (0) 2020.11.23
Posted by 구차니
embeded/ARM2021. 1. 12. 17:09

 

[리읔: https://developer.arm.com/documentation/dui0472/i/compiler-coding-practices/enabling-neon-and-fpu-for-bare-metal]

'embeded > ARM' 카테고리의 다른 글

gcc 버전 차이?  (0) 2021.01.13
vfp  (0) 2021.01.13
softfp와 hardfp  (0) 2020.12.10
ampere altra  (0) 2020.11.23
arm cl  (0) 2020.10.29
Posted by 구차니
embeded/ARM2020. 12. 10. 11:41

softfp 로 빌드된 라이브러리를 hardfp 에서 돌릴수 있냐? 라는 것으로 검색중..

아무튼 ld-linux-armhf.so.3 가 있는 시스템에서 ld-linux.so.3를 요청하는 것을 보면

hf(hard float)가 아니라 soft float 시스템용 라이브러리로 빌드 된 것으로 보이는데

 

ld-linux.so.3를 검색한 결과로는 ln을 통해 ld-linux-armhf.so.3를 ld-linux.so.3로 심볼릭 링크하라는 말들이 나온다.

[링크 : https://forum.lazarus.freepascal.org/index.php?topic=15108.0]

[링크 : https://unix.stackexchange.com/questions/553743/correct-way-to-add-lib-ld-linux-so-3-in-debian]

 

아래는 ld-linux-armhf.so가 된 이유?

[링크 : https://lists.linaro.org/pipermail/cross-distro/2012-April/000261.html]

 

 

빌드 시에는 아래와 같이 에러가 난다고 하는데

ln -s 로 해주면 일단은 우회는 되지만

warning: ld-linux.so.3, needed by libidontknow.so, not found (try using -rpath or -rpath-link)

 

정작 실행했을 경우 해결이 되지 않고 특정 라이브러리를 불러오는데 에러가 발생을 했다고만 간략하게 나온다.

./sample: error while loading shared libraries: libidontknow.so: internal error

 

무슨 문제가 있나 곰곰히 고민을 해보니 softfp와 hardfp의 차이인것 같아서 검색해보니

ABI가 달라서 두개를 혼용할 수 없는게 문제인 것으로 보이는데

그렇게 따지면.. ld-linux.so.3를 찾아서 넣는게 오히려 빠른 해결 책이 아닐까 생각이 된다.

좀 더 근원적으로는, 사용하려는 libidontknow.so를 softfp가 아닌 hardfp로 빌드하는게 가장 좋긴 하겠지만 말이다.

 

+

호출 규약이 다르다..

soft : floating-point 연산을 위한 라이브러리 콜을 포함하도록 gcc 가 컴파일 결과를 만들어낸다.
softfp : hardware floating-point instruction 을 생성하도록 하지만, 여전히 soft-float 호출 규약(calling convention)을 사용한다.
hard : floating-point instructions 을 생성하고 FPU 특화된 호출 규약(calling convention)을 사용한다.

[링크 : https://pinocc.tistory.com/127]

 

ABI 컨벤션이 다르다..

Applications, which are built under “hardfp” option, cannot work under Linux, that was compiled under “softfp” – because different ABI conventions; function parameters transfer are different : the soft float conventions assume passing floats through general purpose (integer) registers, but “hardfp” uses the floating point register.

[링크 : https://community.nxp.com/t5/i-MX-Processors/imx6q-hard-float-or-soft-float/m-p/209848]

 

armhf는 이름대로 hard-float용이고 없는 녀석은 soft-float 용.

arm
hard-float ABI, BE32: /lib/ld-linux-armhf.so.3
hard-float ABI, BE8: /lib/ld-linux-armhf.so.3
hard-float ABI, LE: /lib/ld-linux-armhf.so.3
soft-float ABI, BE32: /lib/ld-linux.so.3
soft-float ABI, BE8: /lib/ld-linux.so.3
soft-float ABI, LE: /lib/ld-linux.so.3
(The ARM soft-float ABI can be used with both hard and soft-float code. ARM supports two variants of big-endian operation, (on newer processors) BE8 and (on older processors) BE32, which are the same at .o level but incompatible for linked executables and shared libraries.)

[링크 : https://sourceware.org/glibc/wiki/ABIList]

 

+

[링크 : https://talkingaboutme.tistory.com/entry/Linux-floating-point-관련-삽질중]

 

+

아래와 같은 항목이 보이는 걸 봐서는 mfloat-abi는 softfp 방식으로 abi를 선언할 뿐

실제 연산은 mfpu로 선언된 neon을 통해서 구현이 되도록 설정이 가능한 것으로 보인다.

export CC="arm-linux-gnueabi-gcc  -march=armv7-a     -mthumb-interwork -mfloat-abi=softfp -mfpu=neon  --sysroot=/home/eric/src/imx6/opt/ESX/imx6/sysroots/armv7a-vfp-neon-linux-gnueabi"

[링크 : https://gist.github.com/ericbutters/6049429b834edfaa0d2d]

 

 

그러니까 soft는 순수하게 software float point 계산

hard는  hardware float point 계산

softfp는 hardware float point 를 사용하지만 함수 호출 방식은 soft 방식을 쓴다고 보면 될 듯?

-mfloat-abi=name
Specifies which floating-point ABI to use. Permissible values are: ‘soft’, ‘softfp’ and ‘hard’.

Specifying ‘soft’ causes GCC to generate output containing library calls for floating-point operations. ‘softfp’ allows the generation of code using hardware floating-point instructions, but still uses the soft-float calling conventions. ‘hard’ allows generation of floating-point instructions and uses FPU-specific calling conventions.

The default depends on the specific target configuration. Note that the hard-float and soft-float ABIs are not link-compatible; you must compile your entire program with the same ABI, and link with a compatible set of libraries.

[링크 : https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html]

 

 

+

예전에 한참 고생하게 만들었던 gcc multilib이 이럴때 언급될줄이야..

아무튼 컴파일러가 multilib을 지원하면 softfp를 쓰라는데 반대로 multilib을 지원하지 않으면 soft, hard만 지원한다는 건가?

If the compiler has multilib enabled (you can tell with -print-multi-lib) then you can use -mfloat-abi=softfp, but if not then that option won't help you much: gcc will happily generate softfp code, but then there'll be no compatible libgcc to link against.

[링크 : https://stackoverflow.com/questions/9753749/]

  [링크 : https://stackoverflow.com/questions/48224372/]

 

 

+

 

[링크 : https://www.gurucoding.com/rpi_cross_compiler/2012/04_diff_hardfp_softfp/]

'embeded > ARM' 카테고리의 다른 글

vfp  (0) 2021.01.13
NEON 강제활성화?  (0) 2021.01.12
ampere altra  (0) 2020.11.23
arm cl  (0) 2020.10.29
arm64 server sysbench  (0) 2020.09.23
Posted by 구차니