[llvm-commits] [dragonegg] r169679 - in /dragonegg/trunk: include/dragonegg/Internals.h src/Convert.cpp test/validator/fortran/VecPackFixTruncExpr.f

Duncan Sands baldrick at free.fr
Sat Dec 8 10:19:05 PST 2012


Author: baldrick
Date: Sat Dec  8 12:19:04 2012
New Revision: 169679

URL: http://llvm.org/viewvc/llvm-project?rev=169679&view=rev
Log:
Add support for VEC_PACK_FIX_TRUNC_EXPR.  This came up in PR12664 after the
original problem was fixed.

Added:
    dragonegg/trunk/test/validator/fortran/VecPackFixTruncExpr.f
Modified:
    dragonegg/trunk/include/dragonegg/Internals.h
    dragonegg/trunk/src/Convert.cpp

Modified: dragonegg/trunk/include/dragonegg/Internals.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/Internals.h?rev=169679&r1=169678&r2=169679&view=diff
==============================================================================
--- dragonegg/trunk/include/dragonegg/Internals.h (original)
+++ dragonegg/trunk/include/dragonegg/Internals.h Sat Dec  8 12:19:04 2012
@@ -568,6 +568,8 @@
   Value *EmitReg_VEC_INTERLEAVE_HIGH_EXPR(tree_node *op0, tree_node *op1);
   Value *EmitReg_VEC_INTERLEAVE_LOW_EXPR(tree_node *op0, tree_node *op1);
 #endif
+  Value *EmitReg_VEC_PACK_FIX_TRUNC_EXPR(tree_node *type, tree_node *op0,
+                                         tree_node *op1);
   Value *EmitReg_VEC_PACK_TRUNC_EXPR(tree_node *type, tree_node *op0,
                                      tree_node *op1);
   Value *EmitReg_VEC_WIDEN_MULT_HI_EXPR(tree_node *type, tree_node *op0,

Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=169679&r1=169678&r2=169679&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Sat Dec  8 12:19:04 2012
@@ -7740,7 +7740,8 @@
 #endif
 
 Value *TreeToLLVM::EmitReg_VEC_PACK_TRUNC_EXPR(tree type, tree op0, tree op1) {
-  // Eg: <4 x float> = VEC_PACK_TRUNC_EXPR(<2 x double>, <2 x double>).
+  // Eg: <4 x float> = VEC_PACK_TRUNC_EXPR(<2 x double>, <2 x double>)
+  // or <4 x i32> = VEC_PACK_FIX_TRUNC_EXPR(<2 x double>, <2 x double>).
   Value *LHS = EmitRegister(op0);
   Value *RHS = EmitRegister(op1);
 
@@ -8882,6 +8883,7 @@
 #endif
   case VEC_LSHIFT_EXPR:
     RHS = EmitReg_VecShiftOp(rhs1, rhs2, /*isLeftShift*/true); break;
+  case VEC_PACK_FIX_TRUNC_EXPR:
   case VEC_PACK_TRUNC_EXPR:
     RHS = EmitReg_VEC_PACK_TRUNC_EXPR(type, rhs1, rhs2); break;
   case VEC_RSHIFT_EXPR:

Added: dragonegg/trunk/test/validator/fortran/VecPackFixTruncExpr.f
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/validator/fortran/VecPackFixTruncExpr.f?rev=169679&view=auto
==============================================================================
--- dragonegg/trunk/test/validator/fortran/VecPackFixTruncExpr.f (added)
+++ dragonegg/trunk/test/validator/fortran/VecPackFixTruncExpr.f Sat Dec  8 12:19:04 2012
@@ -0,0 +1,43 @@
+C RUN: %dragonegg %s -S -msse3 -ffast-math -funroll-loops -O3 -fplugin-arg-dragonegg-enable-gcc-optzns
+C PR12664
+      SUBROUTINE MLIST()
+      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
+      PARAMETER (NM=16384)
+      PARAMETER (NG=100)
+      PARAMETER (NH=100)
+      PARAMETER (MU=20)
+      PARAMETER (NL=1)
+      PARAMETER (LL=10*NM)
+      PARAMETER (KP=2001,KR=2001,KG=2001)
+      COMMON /COUNT / NFI , LCOunt , LISter , KNTsta , KNTgor , LEP ,   &
+     &                MANyon
+      COMMON /LCS   / X0(3,-2:NM) , X(3,-2:NM,5) , XIN(3,-2:NM)
+      COMMON /LISCOM/ LISt(LL) , MRKr1(NM) , MRKr2(NM) , LISlen
+      COMMON /MOLEC / LPBc(3) , MOLsp , MOLsa , NBX , NBY , NBZ , NPLa ,&
+     &                LPBcsm
+      COMMON /PARAM / DELta , DELta2 , GAMma , VSCale , CTRlce ,        &
+     &                CTRlmi , CTRlma , RSQupd , RANsq , VMAs , BOX(3,3)
+      COMMON /PBCS  / HALf , PBCx , PBCy , PBCz
+      COMMON /PRINT / LNGprt , IPRind
+      COMMON /SCRATC/ DUMmy1(NM) , DUMmy2(NM) , DUMmy3(NM) , DUMmy4(NM)
+      COMMON /STATIS/ FGS(NG) , GRAng , FACng , SCAby2 , RESz , DONtr , &
+     &                FONtr , SIG2 , NGS(NG) , NGMax , NZHigh , NZLow , &
+     &                MULtip
+      COMMON /WALLS / HI(3,3) , G(3,3) , DH , AREa , VOLume , SCM(3)
+      DIMENSION H(3,3) , HIN(3,3)
+      EQUIVALENCE (X0(1,-2),H(1,1))
+      EQUIVALENCE (XIN(1,-2),HIN(1,1))
+      IF ( LPBcsm.GT.0 ) THEN
+         DO i = 1 , MOLsp
+            boxjmp = PBCx*INT(X0(1,i)+SIGN(HALf,X0(1,i)))
+            X0(1,i) = X0(1,i) - boxjmp
+            XIN(1,i) = XIN(1,i) - boxjmp
+            boxjmp = PBCy*INT(X0(2,i)+SIGN(HALf,X0(2,i)))
+            X0(2,i) = X0(2,i) - boxjmp
+            XIN(2,i) = XIN(2,i) - boxjmp
+            boxjmp = PBCz*INT(X0(3,i)+SIGN(HALf,X0(3,i)))
+            X0(3,i) = X0(3,i) - boxjmp
+            XIN(3,i) = XIN(3,i) - boxjmp
+         ENDDO
+      ENDIF
+      END





More information about the llvm-commits mailing list