1/*
2 *  Copyright (c) 2015 The WebM project authors. All Rights Reserved.
3 *
4 *  Use of this source code is governed by a BSD-style license
5 *  that can be found in the LICENSE file in the root of the source
6 *  tree. An additional intellectual property rights grant can be found
7 *  in the file PATENTS.  All contributing project authors may
8 *  be found in the AUTHORS file in the root of the source tree.
9 */
10
11#include "./vp8_rtcd.h"
12#include "vp8/common/mips/msa/vp8_macros_msa.h"
13
14static void copy_8x4_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
15                         int32_t dst_stride) {
16  uint64_t src0, src1, src2, src3;
17
18  LD4(src, src_stride, src0, src1, src2, src3);
19  SD4(src0, src1, src2, src3, dst, dst_stride);
20}
21
22static void copy_8x8_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
23                         int32_t dst_stride) {
24  uint64_t src0, src1, src2, src3;
25
26  LD4(src, src_stride, src0, src1, src2, src3);
27  src += (4 * src_stride);
28  SD4(src0, src1, src2, src3, dst, dst_stride);
29  dst += (4 * dst_stride);
30
31  LD4(src, src_stride, src0, src1, src2, src3);
32  SD4(src0, src1, src2, src3, dst, dst_stride);
33}
34
35static void copy_16x16_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
36                           int32_t dst_stride) {
37  v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
38  v16u8 src8, src9, src10, src11, src12, src13, src14, src15;
39
40  LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
41  src += (8 * src_stride);
42  LD_UB8(src, src_stride, src8, src9, src10, src11, src12, src13, src14, src15);
43
44  ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7, dst, dst_stride);
45  dst += (8 * dst_stride);
46  ST_UB8(src8, src9, src10, src11, src12, src13, src14, src15, dst, dst_stride);
47}
48
49void vp8_copy_mem16x16_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
50                           int32_t dst_stride) {
51  copy_16x16_msa(src, src_stride, dst, dst_stride);
52}
53
54void vp8_copy_mem8x8_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
55                         int32_t dst_stride) {
56  copy_8x8_msa(src, src_stride, dst, dst_stride);
57}
58
59void vp8_copy_mem8x4_msa(uint8_t *src, int32_t src_stride, uint8_t *dst,
60                         int32_t dst_stride) {
61  copy_8x4_msa(src, src_stride, dst, dst_stride);
62}
63