-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compute fletcher 4 with avx instructions
Detect if the running CPU supports AVX instruction, and evaluate Fletcher-4 computation througput and choose the fastest one. Signed-off-by: Jinshan Xiong <[email protected]>
- Loading branch information
Jinshan Xiong
committed
Feb 25, 2016
1 parent
19a47cb
commit 151633e
Showing
6 changed files
with
413 additions
and
38 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
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,46 @@ | ||
/* | ||
* CDDL HEADER START | ||
* | ||
* The contents of this file are subject to the terms of the | ||
* Common Development and Distribution License (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* | ||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
* or http://www.opensolaris.org/os/licensing. | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
* | ||
* When distributing Covered Code, include this CDDL HEADER in each | ||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
* If applicable, add the following below this CDDL HEADER, with the | ||
* fields enclosed by brackets "[]" replaced with your own identifying | ||
* information: Portions Copyright [yyyy] [name of copyright owner] | ||
* | ||
* CDDL HEADER END | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2015 Intel Corporation. | ||
*/ | ||
|
||
#ifndef _ZFS_CPU_COMPAT_H | ||
#define _ZFS_CPU_COMPAT_H | ||
|
||
#include <sys/disp.h> | ||
|
||
#ifdef __linux__ | ||
#include <asm/cpufeature.h> | ||
|
||
#ifdef cpu_has_avx2 | ||
#include <asm/i387.h> | ||
|
||
#define HAVE_KERNEL_CPU_AVX2 1 | ||
#endif /* cpu_has_avx2 */ | ||
|
||
|
||
#define kernel_cpu_relax() cpu_relax() | ||
#define kernel_fpu_save() kernel_fpu_begin() | ||
#define kernel_fpu_restore() kernel_fpu_end() | ||
#endif /* __linux__ */ | ||
|
||
#endif /* _ZFS_CPU_COMPAT_H */ |
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
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
Oops, something went wrong.