Add basicUnsafeMove to generation script and regenerate unbox-tuble-instances
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>
Wed, 11 May 2011 20:21:15 +0000 (20:21 +0000)
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Wed, 11 May 2011 20:21:15 +0000 (20:21 +0000)
internal/GenUnboxTuple.hs
internal/unbox-tuple-instances

index 8433adb..5711667 100644 (file)
@@ -164,6 +164,11 @@ generate n =
          mk_do [q rec <+> vs <> char '1' <+> vs <> char '2' | vs <- varss]
                empty)
 
+    gen_unsafeMove rec
+      = (patn "MV" 1 <+> patn "MV" 2,
+         mk_do [qM rec <+> vs <> char '1' <+> vs <> char '2' | vs <- varss]
+               empty)
+
     gen_unsafeGrow rec
       = (pat "MV" <+> var 'm',
          mk_do [vs <> char '\'' <+> text "<-"
@@ -218,6 +223,7 @@ generate n =
                       ,("basicClear",             gen_clear)
                       ,("basicSet",               gen_set)
                       ,("basicUnsafeCopy",        gen_unsafeCopy "MV" qM)
+                      ,("basicUnsafeMove",        gen_unsafeMove)
                       ,("basicUnsafeGrow",        gen_unsafeGrow)]
 
     methods_Vector  = [("basicUnsafeFreeze",      gen_unsafeFreeze)
index d733156..d5f5879 100644 (file)
@@ -613,6 +613,18 @@ instance (Unbox a,
           M.basicUnsafeCopy cs1 cs2
           M.basicUnsafeCopy ds1 ds2
           M.basicUnsafeCopy es1 es2
+  {-# INLINE basicUnsafeMove  #-}
+  basicUnsafeMove (MV_5 n_1 as1 bs1 cs1 ds1 es1) (MV_5 n_2 as2
+                                                           bs2
+                                                           cs2
+                                                           ds2
+                                                           es2)
+      = do
+          M.basicUnsafeMove as1 as2
+          M.basicUnsafeMove bs1 bs2
+          M.basicUnsafeMove cs1 cs2
+          M.basicUnsafeMove ds1 ds2
+          M.basicUnsafeMove es1 es2
   {-# INLINE basicUnsafeGrow  #-}
   basicUnsafeGrow (MV_5 n_ as bs cs ds es) m_
       = do
@@ -887,6 +899,20 @@ instance (Unbox a,
           M.basicUnsafeCopy ds1 ds2
           M.basicUnsafeCopy es1 es2
           M.basicUnsafeCopy fs1 fs2
+  {-# INLINE basicUnsafeMove  #-}
+  basicUnsafeMove (MV_6 n_1 as1 bs1 cs1 ds1 es1 fs1) (MV_6 n_2 as2
+                                                               bs2
+                                                               cs2
+                                                               ds2
+                                                               es2
+                                                               fs2)
+      = do
+          M.basicUnsafeMove as1 as2
+          M.basicUnsafeMove bs1 bs2
+          M.basicUnsafeMove cs1 cs2
+          M.basicUnsafeMove ds1 ds2
+          M.basicUnsafeMove es1 es2
+          M.basicUnsafeMove fs1 fs2
   {-# INLINE basicUnsafeGrow  #-}
   basicUnsafeGrow (MV_6 n_ as bs cs ds es fs) m_
       = do