Skip to content

Commit 24361a1

Browse files
committed
Fix portable-simd tests
1 parent 60ef392 commit 24361a1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/intrinsics/llvm_aarch64.rs

+14
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,20 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
243243
}
244244

245245
// FIXME generalize vector types
246+
"llvm.aarch64.neon.tbl1.v8i8" => {
247+
intrinsic_args!(fx, args => (t, idx); intrinsic);
248+
249+
let zero = fx.bcx.ins().iconst(types::I8, 0);
250+
for i in 0..8 {
251+
let idx_lane = idx.value_lane(fx, i).load_scalar(fx);
252+
let is_zero =
253+
fx.bcx.ins().icmp_imm(IntCC::UnsignedGreaterThanOrEqual, idx_lane, 16);
254+
let t_idx = fx.bcx.ins().uextend(fx.pointer_type, idx_lane);
255+
let t_lane = t.value_lane_dyn(fx, t_idx).load_scalar(fx);
256+
let res = fx.bcx.ins().select(is_zero, zero, t_lane);
257+
ret.place_lane(fx, i).to_ptr().store(fx, res, MemFlags::trusted());
258+
}
259+
}
246260
"llvm.aarch64.neon.tbl1.v16i8" => {
247261
intrinsic_args!(fx, args => (t, idx); intrinsic);
248262

0 commit comments

Comments
 (0)