[llvm-branch-commits] [llvm-branch] r195612 - Merging r195330:

Bill Wendling isanbard at gmail.com
Sun Nov 24 21:38:48 PST 2013


Author: void
Date: Sun Nov 24 23:38:48 2013
New Revision: 195612

URL: http://llvm.org/viewvc/llvm-project?rev=195612&view=rev
Log:
Merging r195330:
------------------------------------------------------------------------
r195330 | apazos | 2013-11-21 00:16:15 -0800 (Thu, 21 Nov 2013) | 5 lines

Implemented Neon scalar vdup_lane intrinsics.

Fixed scalar dup alias and added test case.


------------------------------------------------------------------------

Added:
    llvm/branches/release_34/test/CodeGen/AArch64/neon-scalar-copy.ll
      - copied unchanged from r195330, llvm/trunk/test/CodeGen/AArch64/neon-scalar-copy.ll
Modified:
    llvm/branches/release_34/   (props changed)
    llvm/branches/release_34/lib/Target/AArch64/AArch64InstrNEON.td
    llvm/branches/release_34/test/MC/AArch64/neon-scalar-dup.s

Propchange: llvm/branches/release_34/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Nov 24 23:38:48 2013
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,195092-195094,195100,195102-195103,195118,195129,195138,195152,195156-195157,195161-195162,195193,195272,195317-195318,195327,195333,195339,195355,195397-195399,195421,195423,195432,195439,195476-195477,195479,195491-195493,195514,195528,195567,195599
+/llvm/trunk:155241,195092-195094,195100,195102-195103,195118,195129,195138,195152,195156-195157,195161-195162,195193,195272,195317-195318,195327,195330,195333,195339,195355,195397-195399,195421,195423,195432,195439,195476-195477,195479,195491-195493,195514,195528,195567,195599

Modified: llvm/branches/release_34/lib/Target/AArch64/AArch64InstrNEON.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/lib/Target/AArch64/AArch64InstrNEON.td?rev=195612&r1=195611&r2=195612&view=diff
==============================================================================
--- llvm/branches/release_34/lib/Target/AArch64/AArch64InstrNEON.td (original)
+++ llvm/branches/release_34/lib/Target/AArch64/AArch64InstrNEON.td Sun Nov 24 23:38:48 2013
@@ -5883,16 +5883,37 @@ defm : NeonI_SDUP<Neon_low2D, Neon_High2
 defm : NeonI_SDUP<Neon_low4f, Neon_High4f, v2f32, v4f32>;
 defm : NeonI_SDUP<Neon_low2d, Neon_High2d, v1f64, v2f64>;
 
-// Patterns  for vector extract of FP data using scalar DUP instructions
+// Patterns for vector extract of FP data using scalar DUP instructions
 defm : NeonI_Scalar_DUP_Elt_pattern<DUPsv_S, f32,
   v4f32, neon_uimm2_bare, v2f32, v4f32, neon_uimm1_bare>;
 defm : NeonI_Scalar_DUP_Elt_pattern<DUPdv_D, f64,
   v2f64, neon_uimm1_bare, v1f64, v2f64, neon_uimm0_bare>;
 
+multiclass NeonI_Scalar_DUP_Vec_pattern<Instruction DUPI,
+  ValueType ResTy, ValueType OpTy,Operand OpLImm,
+  ValueType NOpTy, ValueType ExTy, Operand OpNImm> {
+
+  def : Pat<(ResTy (extract_subvector (OpTy VPR128:$Rn), OpLImm:$Imm)),
+            (ResTy (DUPI VPR128:$Rn, OpLImm:$Imm))>;
+
+  def : Pat<(ResTy (extract_subvector (NOpTy VPR64:$Rn), OpNImm:$Imm)),
+            (ResTy (DUPI
+              (ExTy (SUBREG_TO_REG (i64 0), VPR64:$Rn, sub_64)),
+                OpNImm:$Imm))>;
+}
+// Patterns for extract subvectors of v1ix data using scalar DUP instructions
+defm : NeonI_Scalar_DUP_Vec_pattern<DUPbv_B,
+  v1i8, v16i8, neon_uimm4_bare, v8i8, v16i8, neon_uimm3_bare>;
+defm : NeonI_Scalar_DUP_Vec_pattern<DUPhv_H,
+  v1i16, v8i16, neon_uimm3_bare, v4i16, v8i16, neon_uimm2_bare>;
+defm : NeonI_Scalar_DUP_Vec_pattern<DUPsv_S,
+  v1i32, v4i32, neon_uimm2_bare, v2i32, v4i32, neon_uimm1_bare>;
+
+
 multiclass NeonI_Scalar_DUP_alias<string asmop, string asmlane,
                                   Instruction DUPI, Operand OpImm,
                                   RegisterClass ResRC> {
-  def : NeonInstAlias<!strconcat(asmop, "$Rd, $Rn." # asmlane # "[$Imm]"),
+  def : NeonInstAlias<!strconcat(asmop, "$Rd, $Rn" # asmlane # "[$Imm]"),
           (DUPI ResRC:$Rd, VPR128:$Rn, OpImm:$Imm), 0b0>;
 }
 

Modified: llvm/branches/release_34/test/MC/AArch64/neon-scalar-dup.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/test/MC/AArch64/neon-scalar-dup.s?rev=195612&r1=195611&r2=195612&view=diff
==============================================================================
--- llvm/branches/release_34/test/MC/AArch64/neon-scalar-dup.s (original)
+++ llvm/branches/release_34/test/MC/AArch64/neon-scalar-dup.s Sun Nov 24 23:38:48 2013
@@ -27,3 +27,29 @@
 // CHECK: dup d3, v5.d[0]       // encoding: [0xa3,0x04,0x08,0x5e]
 // CHECK: dup d6, v5.d[1]       // encoding: [0xa6,0x04,0x18,0x5e]
 
+//------------------------------------------------------------------------------
+// Aliases for Duplicate element (scalar)
+//------------------------------------------------------------------------------
+         mov b0, v0.b[15]
+         mov b1, v0.b[7]
+         mov b17, v0.b[0]
+         mov h5, v31.h[7]
+         mov h9, v1.h[4]
+         mov h11, v17.h[0]
+         mov s2, v2.s[3]
+         mov s4, v21.s[0]
+         mov s31, v21.s[2]
+         mov d3, v5.d[0]
+         mov d6, v5.d[1]
+
+// CHECK: dup b0, v0.b[15]      // encoding: [0x00,0x04,0x1f,0x5e]
+// CHECK: dup b1, v0.b[7]       // encoding: [0x01,0x04,0x0f,0x5e]
+// CHECK: dup b17, v0.b[0]      // encoding: [0x11,0x04,0x01,0x5e]
+// CHECK: dup h5, v31.h[7]      // encoding: [0xe5,0x07,0x1e,0x5e]
+// CHECK: dup h9, v1.h[4]       // encoding: [0x29,0x04,0x12,0x5e]
+// CHECK: dup h11, v17.h[0]     // encoding: [0x2b,0x06,0x02,0x5e]
+// CHECK: dup s2, v2.s[3]       // encoding: [0x42,0x04,0x1c,0x5e]
+// CHECK: dup s4, v21.s[0]      // encoding: [0xa4,0x06,0x04,0x5e]
+// CHECK: dup s31, v21.s[2]     // encoding: [0xbf,0x06,0x14,0x5e]
+// CHECK: dup d3, v5.d[0]       // encoding: [0xa3,0x04,0x08,0x5e]
+// CHECK: dup d6, v5.d[1]       // encoding: [0xa6,0x04,0x18,0x5e]





More information about the llvm-branch-commits mailing list