Commit 601c489d authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd][liftoff][arm][arm64] Implement neg

Bug: v8:9909
Change-Id: I38e3a8d8915148107b7ff810e1e28c97351da65a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2145237Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67131}
parent c867d9dc
......@@ -1656,7 +1656,8 @@ void LiftoffAssembler::emit_f64x2_abs(LiftoffRegister dst,
void LiftoffAssembler::emit_f64x2_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "f64x2neg");
vneg(dst.low_fp(), src.low_fp());
vneg(dst.high_fp(), src.high_fp());
}
void LiftoffAssembler::emit_f64x2_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1705,7 +1706,7 @@ void LiftoffAssembler::emit_f32x4_abs(LiftoffRegister dst,
void LiftoffAssembler::emit_f32x4_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "f32x4neg");
vneg(liftoff::GetSimd128Register(dst), liftoff::GetSimd128Register(src));
}
void LiftoffAssembler::emit_f32x4_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1756,7 +1757,12 @@ void LiftoffAssembler::emit_i64x2_replace_lane(LiftoffRegister dst,
void LiftoffAssembler::emit_i64x2_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i64x2neg");
UseScratchRegisterScope temps(this);
QwNeonRegister zero =
dst == src ? temps.AcquireQ() : liftoff::GetSimd128Register(dst);
vmov(zero, uint64_t{0});
vqsub(NeonS64, liftoff::GetSimd128Register(dst), zero,
liftoff::GetSimd128Register(src));
}
void LiftoffAssembler::emit_i64x2_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1837,7 +1843,8 @@ void LiftoffAssembler::emit_i32x4_replace_lane(LiftoffRegister dst,
void LiftoffAssembler::emit_i32x4_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i32x4neg");
vneg(Neon32, liftoff::GetSimd128Register(dst),
liftoff::GetSimd128Register(src));
}
void LiftoffAssembler::emit_i32x4_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1893,7 +1900,8 @@ void LiftoffAssembler::emit_i16x8_splat(LiftoffRegister dst,
void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i16x8neg");
vneg(Neon16, liftoff::GetSimd128Register(dst),
liftoff::GetSimd128Register(src));
}
void LiftoffAssembler::emit_i16x8_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -2019,7 +2027,8 @@ void LiftoffAssembler::emit_i8x16_replace_lane(LiftoffRegister dst,
void LiftoffAssembler::emit_i8x16_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i8x16neg");
vneg(Neon8, liftoff::GetSimd128Register(dst),
liftoff::GetSimd128Register(src));
}
void LiftoffAssembler::emit_i8x16_add(LiftoffRegister dst, LiftoffRegister lhs,
......
......@@ -1112,7 +1112,7 @@ void LiftoffAssembler::emit_f64x2_abs(LiftoffRegister dst,
void LiftoffAssembler::emit_f64x2_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "f64x2neg");
Fneg(dst.fp().V2D(), src.fp().V2D());
}
void LiftoffAssembler::emit_f64x2_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1158,7 +1158,7 @@ void LiftoffAssembler::emit_f32x4_abs(LiftoffRegister dst,
void LiftoffAssembler::emit_f32x4_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "f32x4neg");
Fneg(dst.fp().V4S(), src.fp().V4S());
}
void LiftoffAssembler::emit_f32x4_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1199,7 +1199,7 @@ void LiftoffAssembler::emit_i64x2_replace_lane(LiftoffRegister dst,
void LiftoffAssembler::emit_i64x2_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i64x2neg");
Neg(dst.fp().V2D(), src.fp().V2D());
}
void LiftoffAssembler::emit_i64x2_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1256,7 +1256,7 @@ void LiftoffAssembler::emit_i32x4_replace_lane(LiftoffRegister dst,
void LiftoffAssembler::emit_i32x4_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i32x4neg");
Neg(dst.fp().V4S(), src.fp().V4S());
}
void LiftoffAssembler::emit_i32x4_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1327,7 +1327,7 @@ void LiftoffAssembler::emit_i16x8_replace_lane(LiftoffRegister dst,
void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i16x8neg");
Neg(dst.fp().V8H(), src.fp().V8H());
}
void LiftoffAssembler::emit_i16x8_add(LiftoffRegister dst, LiftoffRegister lhs,
......@@ -1422,7 +1422,7 @@ void LiftoffAssembler::emit_i8x16_replace_lane(LiftoffRegister dst,
void LiftoffAssembler::emit_i8x16_neg(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i8x16neg");
Neg(dst.fp().V16B(), src.fp().V16B());
}
void LiftoffAssembler::emit_i8x16_add(LiftoffRegister dst, LiftoffRegister lhs,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment