Skip to content

Commit

Permalink
add llvm bug for reductions on aarch64 (rust-lang#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg authored and alexcrichton committed Mar 19, 2018
1 parent ca770fd commit 8a0889c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coresimd/ppsv/api/arithmetic_reductions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ macro_rules! impl_arithmetic_reductions {
#[inline]
pub fn sum(self) -> $elem_ty {
// FIXME: broken on AArch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
let mut x = self.extract(0) as $elem_ty;
for i in 1..$id::lanes() {
x += self.extract(i) as $elem_ty;
Expand Down Expand Up @@ -55,6 +56,7 @@ macro_rules! impl_arithmetic_reductions {
#[inline]
pub fn product(self) -> $elem_ty {
// FIXME: broken on AArch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
let mut x = self.extract(0) as $elem_ty;
for i in 1..$id::lanes() {
x *= self.extract(i) as $elem_ty;
Expand Down
6 changes: 6 additions & 0 deletions coresimd/ppsv/api/bitwise_reductions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ macro_rules! impl_bitwise_reductions {
#[inline]
pub fn and(self) -> $elem_ty {
// FIXME: broken on aarch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
let mut x = self.extract(0) as $elem_ty;
for i in 1..$id::lanes() {
x &= self.extract(i) as $elem_ty;
Expand All @@ -39,6 +40,7 @@ macro_rules! impl_bitwise_reductions {
#[inline]
pub fn or(self) -> $elem_ty {
// FIXME: broken on aarch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
let mut x = self.extract(0) as $elem_ty;
for i in 1..$id::lanes() {
x |= self.extract(i) as $elem_ty;
Expand All @@ -60,6 +62,7 @@ macro_rules! impl_bitwise_reductions {
#[inline]
pub fn xor(self) -> $elem_ty {
// FIXME: broken on aarch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
let mut x = self.extract(0) as $elem_ty;
for i in 1..$id::lanes() {
x ^= self.extract(i) as $elem_ty;
Expand Down Expand Up @@ -88,6 +91,7 @@ macro_rules! impl_bool_bitwise_reductions {
#[inline]
pub fn and(self) -> $elem_ty {
// FIXME: broken on aarch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
let mut x = self.extract(0) as $elem_ty;
for i in 1..$id::lanes() {
x &= self.extract(i) as $elem_ty;
Expand All @@ -110,6 +114,7 @@ macro_rules! impl_bool_bitwise_reductions {
#[inline]
pub fn or(self) -> $elem_ty {
// FIXME: broken on aarch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
let mut x = self.extract(0) as $elem_ty;
for i in 1..$id::lanes() {
x |= self.extract(i) as $elem_ty;
Expand All @@ -132,6 +137,7 @@ macro_rules! impl_bool_bitwise_reductions {
#[inline]
pub fn xor(self) -> $elem_ty {
// FIXME: broken on aarch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
let mut x = self.extract(0) as $elem_ty;
for i in 1..$id::lanes() {
x ^= self.extract(i) as $elem_ty;
Expand Down
2 changes: 2 additions & 0 deletions coresimd/ppsv/api/boolean_reductions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ macro_rules! impl_bool_reductions {
#[inline]
pub fn all(self) -> bool {
// FIXME: Broken on AArch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
self.and()
}

Expand All @@ -35,6 +36,7 @@ macro_rules! impl_bool_reductions {
#[inline]
pub fn any(self) -> bool {
// FIXME: Broken on AArch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
self.or()
}

Expand Down
2 changes: 2 additions & 0 deletions coresimd/ppsv/api/minmax_reductions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ macro_rules! impl_minmax_reductions {
#[inline]
pub fn max(self) -> $elem_ty {
// FIXME: broken on AArch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
use ::num::Float;
use ::cmp::Ord;
let mut x = self.extract(0);
Expand Down Expand Up @@ -51,6 +52,7 @@ macro_rules! impl_minmax_reductions {
#[inline]
pub fn min(self) -> $elem_ty {
// FIXME: broken on AArch64
// https://bugs.llvm.org/show_bug.cgi?id=36796
use ::num::Float;
use ::cmp::Ord;
let mut x = self.extract(0);
Expand Down

0 comments on commit 8a0889c

Please sign in to comment.