Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zchrissirhcz/neon_sim
NEON intrinsics reference implementation in naive C
https://github.com/zchrissirhcz/neon_sim
arm intrinsics neon simulation
Last synced: 2 months ago
JSON representation
NEON intrinsics reference implementation in naive C
- Host: GitHub
- URL: https://github.com/zchrissirhcz/neon_sim
- Owner: zchrissirhcz
- License: mit
- Created: 2022-03-20T16:13:01.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-06T09:21:42.000Z (10 months ago)
- Last Synced: 2024-04-06T10:25:14.126Z (10 months ago)
- Topics: arm, intrinsics, neon, simulation
- Language: C
- Homepage:
- Size: 517 KB
- Stars: 20
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# neon_sim
ARM NEON Intrinsics implementation in C, for accurate understanding of each "neon function".
## Usage
Replace
```cpp
#if __ARM_NEON
#include
#endif // __ARM_NEON
```
with
```cpp
#include "neon_sim.h"
```## Features
- Real cross-platform
- 100% in C/C++, no SSE stuffs
- "Debuggable inside the intrinsics"
- Closer to native neon usage
- Support initializer list
```cpp
int8x8_t a = { 1, -2, 3, 4, 5, 6, 7, 8 };
```
- Support compile time vector type checking
```cpp
uint8_t b[4] = { 5, 6, 7, 8 };
uint16x4_t v_b = vld1_u16(b);
```
- Support same-length-different-type conversion(require `-flax-vector-conversions` sometimes)## Known issues
1. The correctness of the simulation implementation is not guaranteed.
2. However, the accuracy can be improved by adding examples and continuously verifying.
3. Not support inline assembly, i.e. `asm volatile("...")` stuffs.
4. `vgetq_lane_f32(sum_vec, 4)` failed to check-and-report index out of bounds of `[0, 3]` in compile time.