Skip to content

Commit 062e9f3

Browse files
committed
simd_reduce_min/max: remove float support
1 parent af8efe2 commit 062e9f3

2 files changed

Lines changed: 3 additions & 61 deletions

File tree

src/builder.rs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,67 +2313,10 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
23132313
self.vector_extremum(a, b, ExtremumOperation::Min)
23142314
}
23152315

2316-
#[cfg(feature = "master")]
2317-
pub fn vector_reduce_fmin(&mut self, src: RValue<'gcc>) -> RValue<'gcc> {
2318-
let vector_type = src.get_type().unqualified().dyncast_vector().expect("vector type");
2319-
let element_count = vector_type.get_num_units();
2320-
let mut acc = self
2321-
.context
2322-
.new_vector_access(self.location, src, self.context.new_rvalue_zero(self.int_type))
2323-
.to_rvalue();
2324-
for i in 1..element_count {
2325-
let elem = self
2326-
.context
2327-
.new_vector_access(
2328-
self.location,
2329-
src,
2330-
self.context.new_rvalue_from_int(self.int_type, i as _),
2331-
)
2332-
.to_rvalue();
2333-
let cmp = self.context.new_comparison(self.location, ComparisonOp::LessThan, acc, elem);
2334-
acc = self.select(cmp, acc, elem);
2335-
}
2336-
acc
2337-
}
2338-
2339-
#[cfg(not(feature = "master"))]
2340-
pub fn vector_reduce_fmin(&mut self, _src: RValue<'gcc>) -> RValue<'gcc> {
2341-
unimplemented!();
2342-
}
2343-
23442316
pub fn vector_maximum_number_nsz(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
23452317
self.vector_extremum(a, b, ExtremumOperation::Max)
23462318
}
23472319

2348-
#[cfg(feature = "master")]
2349-
pub fn vector_reduce_fmax(&mut self, src: RValue<'gcc>) -> RValue<'gcc> {
2350-
let vector_type = src.get_type().unqualified().dyncast_vector().expect("vector type");
2351-
let element_count = vector_type.get_num_units();
2352-
let mut acc = self
2353-
.context
2354-
.new_vector_access(self.location, src, self.context.new_rvalue_zero(self.int_type))
2355-
.to_rvalue();
2356-
for i in 1..element_count {
2357-
let elem = self
2358-
.context
2359-
.new_vector_access(
2360-
self.location,
2361-
src,
2362-
self.context.new_rvalue_from_int(self.int_type, i as _),
2363-
)
2364-
.to_rvalue();
2365-
let cmp =
2366-
self.context.new_comparison(self.location, ComparisonOp::GreaterThan, acc, elem);
2367-
acc = self.select(cmp, acc, elem);
2368-
}
2369-
acc
2370-
}
2371-
2372-
#[cfg(not(feature = "master"))]
2373-
pub fn vector_reduce_fmax(&mut self, _src: RValue<'gcc>) -> RValue<'gcc> {
2374-
unimplemented!();
2375-
}
2376-
23772320
pub fn vector_select(
23782321
&mut self,
23792322
cond: RValue<'gcc>,

src/intrinsic/simd.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,15 +1422,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
14221422
);
14231423

14241424
macro_rules! minmax_red {
1425-
($name:ident: $int_red:ident, $float_red:ident) => {
1425+
($name:ident: $int_red:ident) => {
14261426
if name == sym::$name {
14271427
require!(
14281428
ret_ty == in_elem,
14291429
InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty }
14301430
);
14311431
return match *in_elem.kind() {
14321432
ty::Int(_) | ty::Uint(_) => Ok(bx.$int_red(args[0].immediate())),
1433-
ty::Float(_) => Ok(bx.$float_red(args[0].immediate())),
14341433
_ => return_error!(InvalidMonomorphization::UnsupportedSymbol {
14351434
span,
14361435
name,
@@ -1444,8 +1443,8 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
14441443
};
14451444
}
14461445

1447-
minmax_red!(simd_reduce_min: vector_reduce_min, vector_reduce_fmin);
1448-
minmax_red!(simd_reduce_max: vector_reduce_max, vector_reduce_fmax);
1446+
minmax_red!(simd_reduce_min: vector_reduce_min);
1447+
minmax_red!(simd_reduce_max: vector_reduce_max);
14491448

14501449
macro_rules! bitwise_red {
14511450
($name:ident : $op:expr, $boolean:expr) => {

0 commit comments

Comments
 (0)