~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to strings/bmove512.c

  • Committer: Patrick Galbraith
  • Date: 2008-07-24 16:57:40 UTC
  • mto: (202.2.4 rename-mysql-to-drizzle)
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: patg@ishvara-20080724165740-x58yw6zs6d9o17lf
Most everything working with client rename
mysqlslap test still fails... can't connect to the server

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2000 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
/*  File   : bmove512.c
 
17
    Author : Michael Widenius;
 
18
    Defines: bmove512()
 
19
 
 
20
    bmove512(dst, src, len) moves exactly "len" bytes from the source "src"
 
21
    to the destination "dst".  "src" and "dst" must be alligned on long
 
22
    boundory and len must be a mutliple of 512 byte. If len is not a
 
23
    multiple of 512 byte len/512*512+1 bytes is copyed.
 
24
    bmove512 is moustly used to copy IO_BLOCKS.  bmove512 should be the
 
25
    fastest way to move a mutiple of 512 byte.
 
26
*/
 
27
 
 
28
#include <my_global.h>
 
29
#include "m_string.h"
 
30
 
 
31
#ifndef bmove512
 
32
 
 
33
#define LONG uint64_t
 
34
 
 
35
void bmove512(uchar *to, const uchar *from, register size_t length)
 
36
{
 
37
  register LONG *f,*t,*end= (LONG*) ((char*) from+length);
 
38
 
 
39
  f= (LONG*) from;
 
40
  t= (LONG*) to;
 
41
 
 
42
#if defined(m88k) || defined(sparc) 
 
43
  do {
 
44
    t[0]=f[0];      t[1]=f[1];      t[2]=f[2];      t[3]=f[3];
 
45
    t[4]=f[4];      t[5]=f[5];      t[6]=f[6];      t[7]=f[7];
 
46
    t[8]=f[8];      t[9]=f[9];      t[10]=f[10];    t[11]=f[11];
 
47
    t[12]=f[12];    t[13]=f[13];    t[14]=f[14];    t[15]=f[15];
 
48
    t[16]=f[16];    t[17]=f[17];    t[18]=f[18];    t[19]=f[19];
 
49
    t[20]=f[20];    t[21]=f[21];    t[22]=f[22];    t[23]=f[23];
 
50
    t[24]=f[24];    t[25]=f[25];    t[26]=f[26];    t[27]=f[27];
 
51
    t[28]=f[28];    t[29]=f[29];    t[30]=f[30];    t[31]=f[31];
 
52
    t[32]=f[32];    t[33]=f[33];    t[34]=f[34];    t[35]=f[35];
 
53
    t[36]=f[36];    t[37]=f[37];    t[38]=f[38];    t[39]=f[39];
 
54
    t[40]=f[40];    t[41]=f[41];    t[42]=f[42];    t[43]=f[43];
 
55
    t[44]=f[44];    t[45]=f[45];    t[46]=f[46];    t[47]=f[47];
 
56
    t[48]=f[48];    t[49]=f[49];    t[50]=f[50];    t[51]=f[51];
 
57
    t[52]=f[52];    t[53]=f[53];    t[54]=f[54];    t[55]=f[55];
 
58
    t[56]=f[56];    t[57]=f[57];    t[58]=f[58];    t[59]=f[59];
 
59
    t[60]=f[60];    t[61]=f[61];    t[62]=f[62];    t[63]=f[63];
 
60
    t+=64; f+=64;
 
61
  } while (f < end);
 
62
#else
 
63
  do {
 
64
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
65
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
66
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
67
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
68
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
69
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
70
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
71
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
72
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
73
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
74
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
75
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
76
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
77
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
78
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
79
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
80
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
81
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
82
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
83
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
84
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
85
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
86
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
87
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
88
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
89
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
90
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
91
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
92
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
93
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
94
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
95
    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;    *t++ = *f++;
 
96
  } while (f < end);
 
97
#endif
 
98
  return;
 
99
} /* bmove512 */
 
100
 
 
101
#endif /* bmove512 */