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

Unified Diff: src/IceInstARM32.cpp

Issue 1652173002: Implements the vector add instructions in the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 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
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index c32fcaa55c795bcd29fead5eb3d0c6716b25b671..aaa0253298eba84b02c753c3a1472139150feb5b 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -499,8 +499,7 @@ template <> void InstARM32Adc::emitIAS(const Cfg *Func) const {
template <> void InstARM32Add::emitIAS(const Cfg *Func) const {
auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
Asm->add(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate());
- if (Asm->needsTextFixup())
- emitUsingTextFixup(Func);
+ assert(!Asm->needsTextFixup());
}
template <> void InstARM32And::emitIAS(const Cfg *Func) const {
@@ -606,20 +605,37 @@ template <> void InstARM32Udiv::emitIAS(const Cfg *Func) const {
template <> void InstARM32Vadd::emitIAS(const Cfg *Func) const {
auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
const Variable *Dest = getDest();
- switch (Dest->getType()) {
- default:
- // TODO(kschimpf) Figure if more cases are needed.
- emitUsingTextFixup(Func);
+ Type DestTy = Dest->getType();
+ switch (DestTy) {
+ case IceType_void:
+ case IceType_i1:
+ case IceType_i8:
+ case IceType_i16:
+ case IceType_i32:
+ case IceType_i64:
+ case IceType_v4i1:
+ case IceType_v8i1:
+ case IceType_v16i1:
+ case IceType_NUM:
+ llvm::report_fatal_error(std::string("Vadd not defined on type ") +
+ typeString(DestTy));
+ break;
+ case IceType_v16i8:
+ case IceType_v8i16:
+ case IceType_v4i32:
+ Asm->vaddqi(typeElementType(DestTy), Dest, getSrc(0), getSrc(1));
+ break;
+ case IceType_v4f32:
+ Asm->vaddqf(Dest, getSrc(0), getSrc(1));
break;
case IceType_f32:
Asm->vadds(getDest(), getSrc(0), getSrc(1), CondARM32::AL);
- assert(!Asm->needsTextFixup());
break;
case IceType_f64:
Asm->vaddd(getDest(), getSrc(0), getSrc(1), CondARM32::AL);
- assert(!Asm->needsTextFixup());
break;
}
+ assert(!Asm->needsTextFixup());
}
template <> void InstARM32Vand::emitIAS(const Cfg *Func) const {

Powered by Google App Engine
This is Rietveld 408576698