[llvm-branch-commits] [cfe-branch] r195614 - Merging r195329:

Bill Wendling isanbard at gmail.com
Sun Nov 24 21:39:42 PST 2013


Author: void
Date: Sun Nov 24 23:39:42 2013
New Revision: 195614

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

Implemented Neon scalar vdup_lane intrinsics.

Fixed scalar dup alias and added test case.


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

Added:
    cfe/branches/release_34/test/CodeGen/aarch64-neon-scalar-copy.c
      - copied unchanged from r195329, cfe/trunk/test/CodeGen/aarch64-neon-scalar-copy.c
Modified:
    cfe/branches/release_34/   (props changed)
    cfe/branches/release_34/include/clang/Basic/arm_neon.td
    cfe/branches/release_34/lib/CodeGen/CGBuiltin.cpp

Propchange: cfe/branches/release_34/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Nov 24 23:39:42 2013
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:195126,195128,195135-195136,195146,195149,195154,195158,195163,195168,195174,195268,195283,195326,195367,195384,195547
+/cfe/trunk:195126,195128,195135-195136,195146,195149,195154,195158,195163,195168,195174,195268,195283,195326,195329,195367,195384,195547
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_34/include/clang/Basic/arm_neon.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/include/clang/Basic/arm_neon.td?rev=195614&r1=195613&r2=195614&view=diff
==============================================================================
--- cfe/branches/release_34/include/clang/Basic/arm_neon.td (original)
+++ cfe/branches/release_34/include/clang/Basic/arm_neon.td Sun Nov 24 23:39:42 2013
@@ -1271,4 +1271,6 @@ def SCALAR_SQDMULH_LANEQ : SOpInst<"vqdm
 def SCALAR_SQRDMULH_LANE : SOpInst<"vqrdmulh_lane", "ssdi", "SsSi", OP_SCALAR_QRDMULH_LN>;
 def SCALAR_SQRDMULH_LANEQ : SOpInst<"vqrdmulh_laneq", "ssji", "SsSi", OP_SCALAR_QRDMULH_LNQ>;
 
+def SCALAR_VDUP_LANE : IInst<"vdup_lane", "sdi", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">;
+def SCALAR_VDUP_LANEQ : IInst<"vdup_laneq", "sji", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">;
 }

Modified: cfe/branches/release_34/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/CodeGen/CGBuiltin.cpp?rev=195614&r1=195613&r2=195614&view=diff
==============================================================================
--- cfe/branches/release_34/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/branches/release_34/lib/CodeGen/CGBuiltin.cpp Sun Nov 24 23:39:42 2013
@@ -1772,6 +1772,31 @@ static Value *EmitAArch64ScalarBuiltinEx
   // argument that specifies the vector type, need to handle each case.
   switch (BuiltinID) {
   default: break;
+  case AArch64::BI__builtin_neon_vdups_lane_f32:
+  case AArch64::BI__builtin_neon_vdupd_lane_f64:
+  case AArch64::BI__builtin_neon_vdups_laneq_f32:
+  case AArch64::BI__builtin_neon_vdupd_laneq_f64: {
+    return CGF.Builder.CreateExtractElement(Ops[0], Ops[1], "vdup_lane");
+  }
+  case AArch64::BI__builtin_neon_vdupb_lane_i8:
+  case AArch64::BI__builtin_neon_vduph_lane_i16:
+  case AArch64::BI__builtin_neon_vdups_lane_i32:
+  case AArch64::BI__builtin_neon_vdupd_lane_i64:
+  case AArch64::BI__builtin_neon_vdupb_laneq_i8:
+  case AArch64::BI__builtin_neon_vduph_laneq_i16:
+  case AArch64::BI__builtin_neon_vdups_laneq_i32:
+  case AArch64::BI__builtin_neon_vdupd_laneq_i64: {
+    // The backend treats Neon scalar types as v1ix types
+    // So we want to dup lane from any vector to v1ix vector
+    // with shufflevector
+    s = "vdup_lane";
+    Value* SV = llvm::ConstantVector::getSplat(1, cast<ConstantInt>(Ops[1]));
+    Value *Result = CGF.Builder.CreateShuffleVector(Ops[0], Ops[0], SV, s);
+    llvm::Type *Ty = CGF.ConvertType(E->getCallReturnType());
+    // AArch64 intrinsic one-element vector type cast to
+    // scalar type expected by the builtin
+    return CGF.Builder.CreateBitCast(Result, Ty, s);
+  }
   case AArch64::BI__builtin_neon_vqdmlalh_lane_s16 :
   case AArch64::BI__builtin_neon_vqdmlalh_laneq_s16 :
   case AArch64::BI__builtin_neon_vqdmlals_lane_s32 :





More information about the llvm-branch-commits mailing list