Skip to content

Commit

Permalink
Fix portable-simd tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jan 21, 2024
1 parent 60ef392 commit 24361a1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/intrinsics/llvm_aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,20 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
}

// FIXME generalize vector types
"llvm.aarch64.neon.tbl1.v8i8" => {
intrinsic_args!(fx, args => (t, idx); intrinsic);

let zero = fx.bcx.ins().iconst(types::I8, 0);
for i in 0..8 {
let idx_lane = idx.value_lane(fx, i).load_scalar(fx);
let is_zero =
fx.bcx.ins().icmp_imm(IntCC::UnsignedGreaterThanOrEqual, idx_lane, 16);
let t_idx = fx.bcx.ins().uextend(fx.pointer_type, idx_lane);
let t_lane = t.value_lane_dyn(fx, t_idx).load_scalar(fx);
let res = fx.bcx.ins().select(is_zero, zero, t_lane);
ret.place_lane(fx, i).to_ptr().store(fx, res, MemFlags::trusted());
}
}
"llvm.aarch64.neon.tbl1.v16i8" => {
intrinsic_args!(fx, args => (t, idx); intrinsic);

Expand Down

0 comments on commit 24361a1

Please sign in to comment.