[llvm-commits] [llvm] r79620 - in /llvm/trunk/lib/Target/ARM: ARMISelLowering.cpp ARMInstrNEON.td
Anton Korobeynikov
asl at math.spbu.ru
Fri Aug 21 05:40:21 PDT 2009
Author: asl
Date: Fri Aug 21 07:40:21 2009
New Revision: 79620
URL: http://llvm.org/viewvc/llvm-project?rev=79620&view=rev
Log:
Provide vext.{16,32}
Modified:
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/ARM/ARMInstrNEON.td
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=79620&r1=79619&r2=79620&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Fri Aug 21 07:40:21 2009
@@ -2371,9 +2371,6 @@
if (ReverseVEXT)
Imm -= NumElts;
- // VEXT only handles 8-bit elements so scale the index for larger elements.
- Imm *= VT.getVectorElementType().getSizeInBits() / 8;
-
return true;
}
Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=79620&r1=79619&r2=79620&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Fri Aug 21 07:40:21 2009
@@ -1949,16 +1949,29 @@
// VEXT : Vector Extract
-def VEXTd : N3V<0,1,0b11,0b0000,0,0, (outs DPR:$dst),
- (ins DPR:$lhs, DPR:$rhs, i32imm:$index), NoItinerary,
- "vext.8\t$dst, $lhs, $rhs, $index", "",
- [(set DPR:$dst, (v8i8 (NEONvext (v8i8 DPR:$lhs),
- (v8i8 DPR:$rhs), imm:$index)))]>;
-def VEXTq : N3V<0,1,0b11,0b0000,1,0, (outs QPR:$dst),
- (ins QPR:$lhs, QPR:$rhs, i32imm:$index), NoItinerary,
- "vext.8\t$dst, $lhs, $rhs, $index", "",
- [(set QPR:$dst, (v16i8 (NEONvext (v16i8 QPR:$lhs),
- (v16i8 QPR:$rhs), imm:$index)))]>;
+class VEXTd<string OpcodeStr, ValueType Ty>
+ : N3V<0,1,0b11,0b0000,0,0, (outs DPR:$dst),
+ (ins DPR:$lhs, DPR:$rhs, i32imm:$index), NoItinerary,
+ !strconcat(OpcodeStr, "\t$dst, $lhs, $rhs, $index"), "",
+ [(set DPR:$dst, (Ty (NEONvext (Ty DPR:$lhs),
+ (Ty DPR:$rhs), imm:$index)))]>;
+
+class VEXTq<string OpcodeStr, ValueType Ty>
+ : N3V<0,1,0b11,0b0000,1,0, (outs QPR:$dst),
+ (ins QPR:$lhs, QPR:$rhs, i32imm:$index), NoItinerary,
+ !strconcat(OpcodeStr, "\t$dst, $lhs, $rhs, $index"), "",
+ [(set QPR:$dst, (Ty (NEONvext (Ty QPR:$lhs),
+ (Ty QPR:$rhs), imm:$index)))]>;
+
+def VEXTd8 : VEXTd<"vext.8", v8i8>;
+def VEXTd16 : VEXTd<"vext.16", v4i16>;
+def VEXTd32 : VEXTd<"vext.32", v2i32>;
+def VEXTdf : VEXTd<"vext.32", v2f32>;
+
+def VEXTq8 : VEXTq<"vext.8", v16i8>;
+def VEXTq16 : VEXTq<"vext.16", v8i16>;
+def VEXTq32 : VEXTq<"vext.32", v4i32>;
+def VEXTqf : VEXTq<"vext.32", v4f32>;
// VTRN : Vector Transpose
More information about the llvm-commits
mailing list