jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageCopy_f.c
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1999-2003 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * FUNCTIONS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 *      mlib_v_ImageCopy_a1         - 1-D, Aligned8, size 8x
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *      mlib_v_ImageCopy_a2         - 2-D, Aligned8, width 8x
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 *      mlib_ImageCopy_na           - BYTE, non-aligned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *      mlib_ImageCopy_bit_al       - BIT, aligned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * SYNOPSIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * ARGUMENT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *      sp       pointer to source image data
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *      dp       pointer to destination image data
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *      size     size in 8-bytes, bytes, or SHORTs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *      width    image width in 8-bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *      height   image height in lines
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *      stride   source image line stride in 8-bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *      dstride  destination image line stride in 8-bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *      s_offset source image line bit offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *      d_offset destination image line bit offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * DESCRIPTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 *      Direct copy from one image to another -- VIS version low level
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 *      functions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * NOTE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *      These functions are separated from mlib_v_ImageCopy.c for loop
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *      unrolling and structure clarity.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
#include "vis_proto.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#include "mlib_image.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
#include "mlib_ImageCopy.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#include "mlib_v_ImageCopy_f.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#define VIS_ALIGNADDR(X, Y)  vis_alignaddr((void *)(X), Y)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * Both source and destination image data are 1-d vectors and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * 8-byte aligned. And size is in 8-bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
void mlib_v_ImageCopy_a1(mlib_d64 *sp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                         mlib_d64 *dp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                         mlib_s32 size)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
  mlib_s32 i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
  for (i = 0; i < size; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    *dp++ = *sp++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * Either source or destination image data are not 1-d vectors, but
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * they are 8-byte aligned. And stride and width are in 8-bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
void mlib_v_ImageCopy_a2(mlib_d64 *sp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                         mlib_d64 *dp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                         mlib_s32 width,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                         mlib_s32 height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                         mlib_s32 stride,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                         mlib_s32 dstride)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
  mlib_d64 *spl;                                      /* 8-byte aligned pointer for line */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
  mlib_d64 *dpl;                                      /* 8-byte aligned pointer for line */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  mlib_s32 i, j;                                      /* indices for x, y */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
  spl = sp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
  dpl = dp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
  /* row loop */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
  for (j = 0; j < height; j++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    /* 8-byte column loop */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    for (i = 0; i < width; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
      *dp++ = *sp++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    sp = spl += stride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    dp = dpl += dstride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 * Both bit offsets of source and distination are the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
void mlib_ImageCopy_bit_al(const mlib_u8 *sa,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                           mlib_u8       *da,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                           mlib_s32      size,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                           mlib_s32      offset)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
  mlib_u8 *dend;                                      /* end points in dst */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
  mlib_d64 *dp;                                       /* 8-byte aligned start points in dst */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
  mlib_d64 *sp;                                       /* 8-byte aligned start point in src */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
  mlib_d64 s0, s1;                                    /* 8-byte source data */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
  mlib_s32 j;                                         /* offset of address in dst */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
  mlib_s32 emask;                                     /* edge mask */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
  mlib_s32 b_size;                                    /* size in bytes */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
  mlib_u8 mask0 = 0xFF;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
  mlib_u8 src, mask;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
  if (size <- 0) return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
  if (size < (8 - offset)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    mask = mask0 << (8 - size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    mask >>= offset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    src = da[0];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    da[0] = (src & (~mask)) | (sa[0] & mask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
  mask = mask0 >> offset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
  src = da[0];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
  da[0] = (src & (~mask)) | (sa[0] & mask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
  da++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
  sa++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
  size = size - 8 + offset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
  b_size = size >> 3;                       /* size in bytes */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
  /* prepare the destination addresses */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
  dp = (mlib_d64 *) ((mlib_addr) da & (~7));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
  j = (mlib_addr) dp - (mlib_addr) da;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
  dend = da + b_size - 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
  /* prepare the source address */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
  sp = (mlib_d64 *) VIS_ALIGNADDR(sa, j);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
  /* generate edge mask for the start point */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
  emask = vis_edge8(da, dend);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
  s1 = vis_ld_d64_nf(sp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
  if (emask != 0xff) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    s0 = s1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    s1 = vis_ld_d64_nf(sp+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    s0 = vis_faligndata(s0, s1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    vis_pst_8(s0, dp++, emask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    sp++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    j += 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
  for (; j <= (b_size - 8); j += 8) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    s0 = s1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    s1 = vis_ld_d64_nf(sp+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    *dp++ = vis_faligndata(s0, s1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    sp++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
  if (j < b_size) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    s0 = vis_faligndata(s1, vis_ld_d64_nf(sp+1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    emask = vis_edge8(dp, dend);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    vis_pst_8(s0, dp, emask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
  j = size & 7;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
  if (j > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    mask = mask0 << (8 - j);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    src = dend[1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    dend[1] = (src & (~mask)) | (sa[b_size] & mask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
 * Either source or destination data are not 8-byte aligned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
 * And size is is in bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
void mlib_ImageCopy_na(const mlib_u8 *sa,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                       mlib_u8       *da,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                       mlib_s32      size)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
  mlib_u8 *dend;                                      /* end points in dst */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
  mlib_d64 *dp;                                       /* 8-byte aligned start points in dst */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
  mlib_d64 *sp;                                       /* 8-byte aligned start point in src */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
  mlib_d64 s0, s1;                                    /* 8-byte source data */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
  mlib_s32 j;                                         /* offset of address in dst */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
  mlib_s32 emask;                                     /* edge mask */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
  /* prepare the destination addresses */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
  dp = (mlib_d64 *) ((mlib_addr) da & (~7));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
  j = (mlib_addr) dp - (mlib_addr) da;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
  dend = da + size - 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
  /* prepare the source address */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
  sp = (mlib_d64 *) VIS_ALIGNADDR(sa, j);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
  /* generate edge mask for the start point */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
  emask = vis_edge8(da, dend);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
  s1 = vis_ld_d64_nf(sp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
  if (emask != 0xff) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    s0 = s1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    s1 = vis_ld_d64_nf(sp+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    s0 = vis_faligndata(s0, s1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    vis_pst_8(s0, dp++, emask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    sp++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    j += 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
  if (((mlib_addr) sa ^ (mlib_addr) da) & 7) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    for (; j <= (size - 8); j += 8) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
      s0 = s1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
      s1 = vis_ld_d64_nf(sp+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
      *dp++ = vis_faligndata(s0, s1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
      sp++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    if (j < size) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
      s0 = vis_faligndata(s1, vis_ld_d64_nf(sp+1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
      emask = vis_edge8(dp, dend);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
      vis_pst_8(s0, dp, emask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
  else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    for (; j <= (size - 8); j += 8) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
      *dp++ = *sp++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    if (j < size) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
      emask = vis_edge8(dp, dend);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
      vis_pst_8(vis_ld_d64_nf(sp), dp, emask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
/***************************************************************/