-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #34412 - gnzlbg:document_platform_intrinsics_generate, …
…r=alexcrichton Add x86 intrinsics for bit manipulation (BMI 1.0, BMI 2.0, and TBM). This PR adds the LLVM x86 intrinsics for the bit manipulation instruction sets (BMI 1.0, BMI 2.0, and TBM). The objective of this pull-request is to allow building a library that implements all the algorithms offered by those instruction sets, using compiler intrinsics for the targets that support them (by means of `target_feature`). The target features added are: - `bmi`: Bit Manipulation Instruction Set 1.0, available in Intel >= Haswell and AMD's >= Jaguar/Piledriver, - `bmi2`: Bit Manipulation Instruction Set 2.0, available in Intel >= Haswell and AMD's >= Excavator, - `tbm`: Trailing Bit Manipulation, available only in AMD's Piledriver (won't be available in newer CPUs). The intrinsics added are: - BMI 1.0: - `bextr`: Bit field extract (with register). - BMI 2.0: - `bzhi`: Zero high bits starting with specified bit position. - `pdep`: Parallel bits deposit. - `pext`: Parallel bits extract. - TBM: - `bextri`: Bit field extract (with immediate).
- Loading branch information
Showing
18 changed files
with
1,012 additions
and
862 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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.avx.", | ||
"intrinsics": [ | ||
{ | ||
|
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,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.avx2.", | ||
"intrinsics": [ | ||
{ | ||
|
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,13 @@ | ||
{ | ||
"intrinsic_prefix": "_bmi", | ||
"llvm_prefix": "llvm.x86.bmi.", | ||
"intrinsics": [ | ||
{ | ||
"intrinsic": "_bextr_{0.bitwidth}", | ||
"width": ["0"], | ||
"llvm": "bextr.{0.bitwidth}", | ||
"ret": "S(32-64)u", | ||
"args": ["0", "0"] | ||
} | ||
] | ||
} |
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,27 @@ | ||
{ | ||
"intrinsic_prefix": "_bmi2", | ||
"llvm_prefix": "llvm.x86.bmi.", | ||
"intrinsics": [ | ||
{ | ||
"intrinsic": "_bzhi_{0.bitwidth}", | ||
"width": ["0"], | ||
"llvm": "bzhi.{0.bitwidth}", | ||
"ret": "S(32-64)u", | ||
"args": ["0", "0"] | ||
}, | ||
{ | ||
"intrinsic": "_pdep_{0.bitwidth}", | ||
"width": ["0"], | ||
"llvm": "pdep.{0.bitwidth}", | ||
"ret": "S(32-64)u", | ||
"args": ["0", "0"] | ||
}, | ||
{ | ||
"intrinsic": "_pext_{0.bitwidth}", | ||
"width": ["0"], | ||
"llvm": "pext.{0.bitwidth}", | ||
"ret": "S(32-64)u", | ||
"args": ["0", "0"] | ||
} | ||
] | ||
} |
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,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.fma.", | ||
"intrinsics": [ | ||
{ | ||
|
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.sse.", | ||
"intrinsics": [ | ||
{ | ||
|
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,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.sse2.", | ||
"intrinsics": [ | ||
{ | ||
|
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,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.sse3.", | ||
"intrinsics": [ | ||
{ | ||
|
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,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.sse41.", | ||
"intrinsics": [ | ||
{ | ||
|
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,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.sse42.", | ||
"intrinsics": [ | ||
{ | ||
|
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,4 +1,5 @@ | ||
{ | ||
"intrinsic_prefix": "_mm", | ||
"llvm_prefix": "llvm.x86.ssse3.", | ||
"intrinsics": [ | ||
{ | ||
|
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,13 @@ | ||
{ | ||
"intrinsic_prefix": "_tbm", | ||
"llvm_prefix": "llvm.x86.tbm.", | ||
"intrinsics": [ | ||
{ | ||
"intrinsic": "_bextri_u{0.bitwidth}", | ||
"width": ["0"], | ||
"llvm": "bextri.u{0.bitwidth}", | ||
"ret": "S(32-64)u", | ||
"args": ["0", "0"] | ||
} | ||
] | ||
} |
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.