-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ccxiaop/master
add avx2neon project
- Loading branch information
Showing
12 changed files
with
13,435 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,64 @@ | ||
# AvxToNeon | ||
# AVX TO NEON | ||
|
||
- [Overview](#Overview) | ||
- [License](#License) | ||
- [Requirements](#requirements) | ||
- [Guidelines](#Guidelines) | ||
- [Test](#Test) | ||
- [More Information](#more-information) | ||
- [Copyright](#copyright) | ||
|
||
## Overview | ||
|
||
When applications using Intel intrinsic instructions are ported from the x86 architecture to the Kunpeng architecture, the instructions need to be further developed because the Arm64 instruction names and functions are different from that of x86. As a result, huge porting workloads are caused. In this project, the frequently used AVX instructions are encapsulated as independent modules to reduce repeated development workload. The AVX instructions are replaced with related NEON SIMD instructions, while the instruction names and functions remain unchanged. Users can invoke the corresponding instructions by importing related header files into the application software. | ||
|
||
## License | ||
|
||
It is licensed under the [APACHE LICENSE, VERSION 2.0](https://www.apache.org/licenses/LICENSE-2.0). For more information, see the license file.. | ||
|
||
## Requirements | ||
|
||
- CPU: Kunpeng 920 | ||
|
||
## Guidelines | ||
|
||
In the source code directory, the source directory contains the function implementation files. The avx512intrin.h, avxintrin.h, and emmintrin.h files implement instruction translation, and the avx2neon.h file contains the header files of them. Users can execute the instructions if the application software contains avx2neon.h. | ||
Users need to add compilation options, for example, ARCH_CFLAGS = -march=armv8-a+fp+simd+crc, when using the header file. | ||
|
||
## Test | ||
|
||
This project also provides interface test cases for developers. The logic implementation code of test cases is located in the tests directory, and the input data and expected output of the test cases are in the data directory. Use the following commands to perform test cases: | ||
|
||
``` | ||
(1) cd tests | ||
(2) make | ||
(3) ./test | ||
``` | ||
|
||
After the **test** command is executed, information similar to the following is displayed on the console: | ||
|
||
``` | ||
Running Test MM512_CASTPS128_PS512 | ||
... | ||
Running Test MM256_SET_EPI32 | ||
AVX2NEONTest Complete: Passed 265 tests: Failed 0 | ||
``` | ||
|
||
All the instructions provided in this project have been verified on CentOS Linux release 7.6.1810 (AltArch) and EulerOS V2.0SP8, and GCC 7.3, GCC 4.8.5, and GCC 9.2.0. | ||
|
||
## More Information | ||
|
||
For more information, visit | ||
|
||
<https://www.huaweicloud.com/kunpeng/software.html> | ||
|
||
If you have questions or comments, we encourage you to create an issue on Github. If you wish to contact the huawei team directly, you can send email to | ||
|
||
[[email protected]](mailto:[email protected]). | ||
|
||
## Copyright | ||
|
||
Copyright © 2020 Huawei Corporation. All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef AVX2NEON_H | ||
#define AVX2NEON_H | ||
|
||
#include <arm_neon.h> | ||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <assert.h> | ||
|
||
#include "emmintrin.h" | ||
#include "avxintrin.h" | ||
#include "avx512intrin.h" | ||
|
||
#endif |
Oops, something went wrong.