Skip to content

Commit

Permalink
fix tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed May 8, 2018
1 parent 66d94bd commit 0068f40
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/librustc_trans/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,12 @@ fn generic_simd_intrinsic<'a, 'tcx>(
return Ok(bx.select(m_i1s, args[1].immediate(), args[2].immediate()));
}

fn simd_simple_float_intrinsic<'a, 'tcx>(name: &str, in_elem: &::rustc::ty::TyS, in_ty: &::rustc::ty::TyS,
in_len: usize, bx: &Builder<'a, 'tcx>, span: Span,
fn simd_simple_float_intrinsic<'a, 'tcx>(name: &str,
in_elem: &::rustc::ty::TyS,
in_ty: &::rustc::ty::TyS,
in_len: usize,
bx: &Builder<'a, 'tcx>,
span: Span,
args: &[OperandRef<'tcx>])
-> Result<ValueRef, ()> {
macro_rules! emit_error {
Expand All @@ -1207,14 +1211,17 @@ fn generic_simd_intrinsic<'a, 'tcx>(
let ety = match in_elem.sty {
ty::TyFloat(f) if f.bit_width() == 32 => {
if in_len < 2 || in_len > 16 {
return_error!("unsupported floating-point vector `{}` with length `{}` out-of-range [2, 16]",
in_ty, in_len);
return_error!(
"unsupported floating-point vector `{}` with length `{}` \
out-of-range [2, 16]",
in_ty, in_len);
}
"f32"
},
ty::TyFloat(f) if f.bit_width() == 64 => {
if in_len < 2 || in_len > 8 {
return_error!("unsupported floating-point vector `{}` with length `{}` out-of-range [2, 8]",
return_error!("unsupported floating-point vector `{}` with length `{}` \
out-of-range [2, 8]",
in_ty, in_len);
}
"f64"
Expand Down Expand Up @@ -1544,7 +1551,10 @@ fn generic_simd_intrinsic<'a, 'tcx>(
let llvm_intrinsic = format!("llvm.masked.scatter.{}.{}",
llvm_elem_vec_str, llvm_pointer_vec_str);
let f = declare::declare_cfn(bx.cx, &llvm_intrinsic,
Type::func(&[llvm_elem_vec_ty, llvm_pointer_vec_ty, alignment_ty, mask_ty], &ret_t));
Type::func(&[llvm_elem_vec_ty,
llvm_pointer_vec_ty,
alignment_ty,
mask_ty], &ret_t));
llvm::SetUnnamedAddr(f, false);
let v = bx.call(f, &[args[0].immediate(), args[1].immediate(), alignment, mask],
None);
Expand Down
1 change: 1 addition & 0 deletions src/test/codegen/simd-intrinsic-generic-gather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

// ignore-emscripten
// ignore-tidy-linelength

// compile-flags: -C no-prepopulate-passes

Expand Down
1 change: 1 addition & 0 deletions src/test/codegen/simd-intrinsic-generic-scatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

// ignore-emscripten
// ignore-tidy-linelength

// compile-flags: -C no-prepopulate-passes

Expand Down

0 comments on commit 0068f40

Please sign in to comment.