Skip to content

Commit 170f470

Browse files
committed
Auto merge of #32231 - ruud-v-a:avx-cmp-blend, r=alexcrichton
Define AVX compare and blend intrinsics This defines the following intrinsics: * `_mm256_blendv_pd` * `_mm256_blendv_ps` * `_mm256_cmp_pd` * `_mm256_cmp_ps` I verified these locally.
2 parents 211296d + a394d50 commit 170f470

File tree

2 files changed

+34
-0
lines changed
  • src

2 files changed

+34
-0
lines changed

src/etc/platform-intrinsics/x86/avx.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,27 @@
88
"ret": "f(32-64)",
99
"args": ["0", "0"]
1010
},
11+
{
12+
"intrinsic": "256_blendv_{0.data_type}",
13+
"width": [256],
14+
"llvm": "blendv.{0.data_type}.256",
15+
"ret": "f(32-64)",
16+
"args": ["0", "0", "0"]
17+
},
1118
{
1219
"intrinsic": "256_broadcast_{0.data_type}",
1320
"width": [256],
1421
"llvm": "vbroadcastf128.{0.data_type}.256",
1522
"ret": "f(32-64)",
1623
"args": ["s8SPc"]
1724
},
25+
{
26+
"intrinsic": "256_cmp_{0.data_type}",
27+
"width": [256],
28+
"llvm": "cmp.{1.data_type}.256",
29+
"ret": "f(32-64)",
30+
"args": ["0", "0", "s8S"]
31+
},
1832
{
1933
"intrinsic": "256_cvtepi32_pd",
2034
"width": [256],

src/librustc_platform_intrinsics/x86.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,16 @@ pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
498498
output: v(f(64), 4),
499499
definition: Named("llvm.x86.avx.addsub.pd.256")
500500
},
501+
"256_blendv_ps" => Intrinsic {
502+
inputs: vec![v(f(32), 8), v(f(32), 8), v(f(32), 8)],
503+
output: v(f(32), 8),
504+
definition: Named("llvm.x86.avx.blendv.ps.256")
505+
},
506+
"256_blendv_pd" => Intrinsic {
507+
inputs: vec![v(f(64), 4), v(f(64), 4), v(f(64), 4)],
508+
output: v(f(64), 4),
509+
definition: Named("llvm.x86.avx.blendv.pd.256")
510+
},
501511
"256_broadcast_ps" => Intrinsic {
502512
inputs: vec![p(true, i(8), None)],
503513
output: v(f(32), 8),
@@ -508,6 +518,16 @@ pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
508518
output: v(f(64), 4),
509519
definition: Named("llvm.x86.avx.vbroadcastf128.pd.256")
510520
},
521+
"256_cmp_ps" => Intrinsic {
522+
inputs: vec![v(f(32), 8), v(f(32), 8), i(8)],
523+
output: v(f(32), 8),
524+
definition: Named("llvm.x86.avx.cmp.ps.256")
525+
},
526+
"256_cmp_pd" => Intrinsic {
527+
inputs: vec![v(f(64), 4), v(f(64), 4), i(8)],
528+
output: v(f(64), 4),
529+
definition: Named("llvm.x86.avx.cmp.pd.256")
530+
},
511531
"256_cvtepi32_pd" => Intrinsic {
512532
inputs: vec![v(i(32), 4)],
513533
output: v(f(64), 4),

0 commit comments

Comments
 (0)