Is there a C implementation for GNU ARM NEON intrinsics? [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm not looking for a portable SIMD implementation.
All I need is: a bit-accurate implementation. Performance doesn't matter very much as long as it's not extremely slow.
I want to use it for early stage developing and testing, so that I can compile and run on a host computer for the first 10+ iterations. Then cross-compile and fine tune performance on the ARM target.
I'm pretty used to this development cycle when I work with TI DSP like described here . I want to carry this on when I move to ARM NEON.
Is this already done, or do I need to invent the wheel?

Intel has a useful set of macros, neon2sse.h which translate NEON intrinsics to SSE. This enables you to build and test your C/C++ code with NEON intrinsics on an x86 platform.

Related

Is it beneficial to use glibc's strlen()/strcmp() or roll your own based on SSE4.2? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
According to "Schema Validation with Intel® Streaming SIMD Extensions 4 (Intel® SSE4)" (Intel, 2008) [they] added instructions to assist in character searches and comparison on two operands of 16 bytes at a time. I wrote some basic strlen() and strcmp() functions in C, but they seem slower than glibc.
I would like to maybe experiment with using inline assembly to see how my project behaves with inputting/outputting XML.
I've read (on here) that using SMID on things like strlen() is rife with potential problems (memory alignment), so I'm a little concerned about using it in production code.
glibc's implementations will be hard to beat. These functions are carefully optimized and include pieces hand written in assembly. Here is glibc's x86_64 implementation of strcmp, using AVX2 instructions. Be warned, it is 800 lines:
https://github.com/lattera/glibc/blob/master/sysdeps/x86_64/multiarch/strcmp-avx2.S
For more detail, read also Peter Codes' fantastic explanation about glibc's implementation.

Automatic use of multi-threading in Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have following problem:
I work on powerful Intel CPU (8 cores). For this target I compile from source an old in-house C application using gcc. It's single-threded application, so created binary doesn't take any advantage from having multi-core cpu and single core runs at nearly 100% load. Is there some way to utilize other cores without changing source code?
How do I prompt gcc to automatically parallelize the program without explicit multithreaded programming? What hints can I give the compiler in the program?
You could try the gcc flags to auto-parallelize loops (-floop-parallelize-all -ftree-parallelize-loops=8) which uses pthreads. You have to be careful how you write your code of course, the compiler has to know there's no dependance between each iteration of your loop in order to be able to parallelize it.
But to be honest, you get nothing for free, unless your code is designed for multiple processors then you will never gain much.

small c compiler for educational purpose [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Is there any small c compiler which follows ansi c extensions and still it has less than 10,000 LOC. Basically 'm trying to port such small compiler to one of such educational OS kernel known as xv6. Thanks.
I don't think that's possible. You might try something like https://github.com/alexfru/SmallerC , a very small compiler for a subset of C. (See the wiki for the language)
Or look at pcc, but that is significantly larger.
It turns out xv6 badly needs several improvements in order to host a decent C compiler or just an assembler and a linker:
larger maximum file size (currently capped at around 64KB)
lseek
FPU state saving/restoring on context switches
A few other minor improvements may be needed.
Links:
Increasing the filesystem block size in the xv6 OS
system calls & toolchains
The smallest one I know is TCC http://bellard.org/tcc/ which has around 30 000 LOC.

Looking for Simple C Implementation of AES-128 and DES [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I need C versions of AES-128 and DES to run on an embedded SPARC processor. I'm trying to measure the electrical power of these algorithms in software and hardware. Is there a website where I could find software implementations? Currently I can compile C code with my cross-compiler so any language implementations other than C would not be useful.
I have implemented DES in hardware before. How much work would people estimate (hours/lines of code) to implement a software version?
Does anybody know how to use the aes_generic.c and des_generic.c built into the Linux kernel in the crypto directory?
You may want to see if LibTomCrypt will meet your needs
Wikipedia has a list of AES implementations. Simple googling also found a DES implementation in C; you'll have to see if it fits your requirements.

Seeking C unit test system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
It has been a few years since I coded any C (or C++) and now I have to code an application to run on a micro-controller. Development will be on a Windows 7, 64-bit PC, which is where the unit tests will run.
Last time out I was using CppUnit, but am not sure of what might have changegd in the past few years and Wikipedia offers so many choices that I might spend weeks trying them all out.
What meets this wish-list?
can handle plain C (gcc under Cygwin)
quick learning curve
good documentation, including examples, and support (forums)
can generate stubs (mocks?) from header files
I am using NetBeans as IDE if that makes any difference
Integrates with Hudson is a bonus
a GUI might be nice, all other things being equal
I am slowly coming round to TDD, if that makes any difference
Plus anything else you can think of. Thanks in advance

Resources