Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2178)

Unified Diff: src/arm/assembler-arm.cc

Issue 2649323012: [ARM] Add Neon saturating add and subtract instructions. (Closed)
Patch Set: Add static_asserts on Widen, Clamp. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/assembler-arm.cc
diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc
index 52213b06ccebc89d64b34939a0ebb730571f6828..ec75b7d07e62b2cb103761ede5e4253d3090b7d7 100644
--- a/src/arm/assembler-arm.cc
+++ b/src/arm/assembler-arm.cc
@@ -4272,7 +4272,19 @@ static Instr EncodeNeonBinOp(FPBinOp op, QwNeonRegister dst,
vm | op_encoding;
}
-enum IntegerBinOp { VADD, VSUB, VMUL, VMIN, VMAX, VTST, VCEQ, VCGE, VCGT };
+enum IntegerBinOp {
+ VADD,
+ VQADD,
+ VSUB,
+ VQSUB,
+ VMUL,
+ VMIN,
+ VMAX,
+ VTST,
+ VCEQ,
+ VCGE,
+ VCGT
+};
static Instr EncodeNeonBinOp(IntegerBinOp op, NeonDataType dt,
const QwNeonRegister dst,
@@ -4283,9 +4295,15 @@ static Instr EncodeNeonBinOp(IntegerBinOp op, NeonDataType dt,
case VADD:
op_encoding = 0x8 * B8;
break;
+ case VQADD:
+ op_encoding = B4;
+ break;
case VSUB:
op_encoding = B24 | 0x8 * B8;
break;
+ case VQSUB:
+ op_encoding = 0x2 * B8 | B4;
+ break;
case VMUL:
op_encoding = 0x9 * B8 | B4;
break;
@@ -4348,6 +4366,14 @@ void Assembler::vadd(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
emit(EncodeNeonBinOp(VADD, size, dst, src1, src2));
}
+void Assembler::vqadd(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
+ QwNeonRegister src2) {
+ DCHECK(IsEnabled(NEON));
+ // Qd = vqadd(Qn, Qm) SIMD integer saturating addition.
+ // Instruction details available in ARM DDI 0406C.b, A8-996.
+ emit(EncodeNeonBinOp(VQADD, dt, dst, src1, src2));
+}
+
void Assembler::vsub(QwNeonRegister dst, QwNeonRegister src1,
QwNeonRegister src2) {
DCHECK(IsEnabled(NEON));
@@ -4364,6 +4390,14 @@ void Assembler::vsub(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
emit(EncodeNeonBinOp(VSUB, size, dst, src1, src2));
}
+void Assembler::vqsub(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
+ QwNeonRegister src2) {
+ DCHECK(IsEnabled(NEON));
+ // Qd = vqsub(Qn, Qm) SIMD integer saturating subtraction.
+ // Instruction details available in ARM DDI 0406C.b, A8-1020.
+ emit(EncodeNeonBinOp(VQSUB, dt, dst, src1, src2));
+}
+
void Assembler::vmul(QwNeonRegister dst, QwNeonRegister src1,
QwNeonRegister src2) {
DCHECK(IsEnabled(NEON));
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698