Blame thirdparty/libjpeg-turbo/libjpeg-turbo-2.0.6/simd/powerpc/jccolext-altivec.c

shun-iwasawa 82a8f5
/*
shun-iwasawa 82a8f5
 * AltiVec optimizations for libjpeg-turbo
shun-iwasawa 82a8f5
 *
shun-iwasawa 82a8f5
 * Copyright (C) 2014-2015, D. R. Commander.  All Rights Reserved.
shun-iwasawa 82a8f5
 * Copyright (C) 2014, Jay Foad.  All Rights Reserved.
shun-iwasawa 82a8f5
 *
shun-iwasawa 82a8f5
 * This software is provided 'as-is', without any express or implied
shun-iwasawa 82a8f5
 * warranty.  In no event will the authors be held liable for any damages
shun-iwasawa 82a8f5
 * arising from the use of this software.
shun-iwasawa 82a8f5
 *
shun-iwasawa 82a8f5
 * Permission is granted to anyone to use this software for any purpose,
shun-iwasawa 82a8f5
 * including commercial applications, and to alter it and redistribute it
shun-iwasawa 82a8f5
 * freely, subject to the following restrictions:
shun-iwasawa 82a8f5
 *
shun-iwasawa 82a8f5
 * 1. The origin of this software must not be misrepresented; you must not
shun-iwasawa 82a8f5
 *    claim that you wrote the original software. If you use this software
shun-iwasawa 82a8f5
 *    in a product, an acknowledgment in the product documentation would be
shun-iwasawa 82a8f5
 *    appreciated but is not required.
shun-iwasawa 82a8f5
 * 2. Altered source versions must be plainly marked as such, and must not be
shun-iwasawa 82a8f5
 *    misrepresented as being the original software.
shun-iwasawa 82a8f5
 * 3. This notice may not be removed or altered from any source distribution.
shun-iwasawa 82a8f5
 */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
/* This file is included by jccolor-altivec.c */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
void jsimd_rgb_ycc_convert_altivec(JDIMENSION img_width, JSAMPARRAY input_buf,
shun-iwasawa 82a8f5
                                   JSAMPIMAGE output_buf,
shun-iwasawa 82a8f5
                                   JDIMENSION output_row, int num_rows)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  JSAMPROW inptr, outptr0, outptr1, outptr2;
shun-iwasawa 82a8f5
  int pitch = img_width * RGB_PIXELSIZE, num_cols;
shun-iwasawa 82a8f5
#if __BIG_ENDIAN__
shun-iwasawa 82a8f5
  int offset;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
  unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16];
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  __vector unsigned char rgb0, rgb1 = { 0 }, rgb2 = { 0 },
shun-iwasawa 82a8f5
    rgbg0, rgbg1, rgbg2, rgbg3, y, cb, cr;
shun-iwasawa 82a8f5
#if __BIG_ENDIAN__ || RGB_PIXELSIZE == 4
shun-iwasawa 82a8f5
  __vector unsigned char rgb3 = { 0 };
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
#if __BIG_ENDIAN__ && RGB_PIXELSIZE == 4
shun-iwasawa 82a8f5
  __vector unsigned char rgb4 = { 0 };
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
  __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3;
shun-iwasawa 82a8f5
  __vector unsigned short yl, yh, crl, crh, cbl, cbh;
shun-iwasawa 82a8f5
  __vector int y0, y1, y2, y3, cr0, cr1, cr2, cr3, cb0, cb1, cb2, cb3;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* Constants */
shun-iwasawa 82a8f5
  __vector short pw_f0299_f0337 = { __4X2(F_0_299, F_0_337) },
shun-iwasawa 82a8f5
    pw_f0114_f0250 = { __4X2(F_0_114, F_0_250) },
shun-iwasawa 82a8f5
    pw_mf016_mf033 = { __4X2(-F_0_168, -F_0_331) },
shun-iwasawa 82a8f5
    pw_mf008_mf041 = { __4X2(-F_0_081, -F_0_418) };
shun-iwasawa 82a8f5
  __vector unsigned short pw_f050_f000 = { __4X2(F_0_500, 0) };
shun-iwasawa 82a8f5
  __vector int pd_onehalf = { __4X(ONE_HALF) },
shun-iwasawa 82a8f5
    pd_onehalfm1_cj = { __4X(ONE_HALF - 1 + (CENTERJSAMPLE << SCALEBITS)) };
shun-iwasawa 82a8f5
  __vector unsigned char pb_zero = { __16X(0) },
shun-iwasawa 82a8f5
#if __BIG_ENDIAN__
shun-iwasawa 82a8f5
    shift_pack_index =
shun-iwasawa 82a8f5
      {  0,  1,  4,  5,  8,  9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29 };
shun-iwasawa 82a8f5
#else
shun-iwasawa 82a8f5
    shift_pack_index =
shun-iwasawa 82a8f5
      {  2,  3,  6,  7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31 };
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  while (--num_rows >= 0) {
shun-iwasawa 82a8f5
    inptr = *input_buf++;
shun-iwasawa 82a8f5
    outptr0 = output_buf[0][output_row];
shun-iwasawa 82a8f5
    outptr1 = output_buf[1][output_row];
shun-iwasawa 82a8f5
    outptr2 = output_buf[2][output_row];
shun-iwasawa 82a8f5
    output_row++;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
    for (num_cols = pitch; num_cols > 0;
shun-iwasawa 82a8f5
         num_cols -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16,
shun-iwasawa 82a8f5
         outptr0 += 16, outptr1 += 16, outptr2 += 16) {
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if __BIG_ENDIAN__
shun-iwasawa 82a8f5
      /* Load 16 pixels == 48 or 64 bytes */
shun-iwasawa 82a8f5
      offset = (size_t)inptr & 15;
shun-iwasawa 82a8f5
      if (offset) {
shun-iwasawa 82a8f5
        __vector unsigned char unaligned_shift_index;
shun-iwasawa 82a8f5
        int bytes = num_cols + offset;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
        if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) {
shun-iwasawa 82a8f5
          /* Slow path to prevent buffer overread.  Since there is no way to
shun-iwasawa 82a8f5
           * read a partial AltiVec register, overread would occur on the last
shun-iwasawa 82a8f5
           * chunk of the last image row if the right edge is not on a 16-byte
shun-iwasawa 82a8f5
           * boundary.  It could also occur on other rows if the bytes per row
shun-iwasawa 82a8f5
           * is low enough.  Since we can't determine whether we're on the last
shun-iwasawa 82a8f5
           * image row, we have to assume every row is the last.
shun-iwasawa 82a8f5
           */
shun-iwasawa 82a8f5
          memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16));
shun-iwasawa 82a8f5
          rgb0 = vec_ld(0, tmpbuf);
shun-iwasawa 82a8f5
          rgb1 = vec_ld(16, tmpbuf);
shun-iwasawa 82a8f5
          rgb2 = vec_ld(32, tmpbuf);
shun-iwasawa 82a8f5
#if RGB_PIXELSIZE == 4
shun-iwasawa 82a8f5
          rgb3 = vec_ld(48, tmpbuf);
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
        } else {
shun-iwasawa 82a8f5
          /* Fast path */
shun-iwasawa 82a8f5
          rgb0 = vec_ld(0, inptr);
shun-iwasawa 82a8f5
          if (bytes > 16)
shun-iwasawa 82a8f5
            rgb1 = vec_ld(16, inptr);
shun-iwasawa 82a8f5
          if (bytes > 32)
shun-iwasawa 82a8f5
            rgb2 = vec_ld(32, inptr);
shun-iwasawa 82a8f5
          if (bytes > 48)
shun-iwasawa 82a8f5
            rgb3 = vec_ld(48, inptr);
shun-iwasawa 82a8f5
#if RGB_PIXELSIZE == 4
shun-iwasawa 82a8f5
          if (bytes > 64)
shun-iwasawa 82a8f5
            rgb4 = vec_ld(64, inptr);
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
          unaligned_shift_index = vec_lvsl(0, inptr);
shun-iwasawa 82a8f5
          rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index);
shun-iwasawa 82a8f5
          rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index);
shun-iwasawa 82a8f5
          rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index);
shun-iwasawa 82a8f5
#if RGB_PIXELSIZE == 4
shun-iwasawa 82a8f5
          rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index);
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
        }
shun-iwasawa 82a8f5
      } else {
shun-iwasawa 82a8f5
#endif /* __BIG_ENDIAN__ */
shun-iwasawa 82a8f5
        if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) {
shun-iwasawa 82a8f5
          /* Slow path */
shun-iwasawa 82a8f5
          memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16));
shun-iwasawa 82a8f5
          rgb0 = VEC_LD(0, tmpbuf);
shun-iwasawa 82a8f5
          rgb1 = VEC_LD(16, tmpbuf);
shun-iwasawa 82a8f5
          rgb2 = VEC_LD(32, tmpbuf);
shun-iwasawa 82a8f5
#if RGB_PIXELSIZE == 4
shun-iwasawa 82a8f5
          rgb3 = VEC_LD(48, tmpbuf);
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
        } else {
shun-iwasawa 82a8f5
          /* Fast path */
shun-iwasawa 82a8f5
          rgb0 = VEC_LD(0, inptr);
shun-iwasawa 82a8f5
          if (num_cols > 16)
shun-iwasawa 82a8f5
            rgb1 = VEC_LD(16, inptr);
shun-iwasawa 82a8f5
          if (num_cols > 32)
shun-iwasawa 82a8f5
            rgb2 = VEC_LD(32, inptr);
shun-iwasawa 82a8f5
#if RGB_PIXELSIZE == 4
shun-iwasawa 82a8f5
          if (num_cols > 48)
shun-iwasawa 82a8f5
            rgb3 = VEC_LD(48, inptr);
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
        }
shun-iwasawa 82a8f5
#if __BIG_ENDIAN__
shun-iwasawa 82a8f5
      }
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if RGB_PIXELSIZE == 3
shun-iwasawa 82a8f5
      /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5
shun-iwasawa 82a8f5
       * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga
shun-iwasawa 82a8f5
       * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf
shun-iwasawa 82a8f5
       *
shun-iwasawa 82a8f5
       * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3
shun-iwasawa 82a8f5
       * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7
shun-iwasawa 82a8f5
       * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb
shun-iwasawa 82a8f5
       * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf
shun-iwasawa 82a8f5
       */
shun-iwasawa 82a8f5
      rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX0);
shun-iwasawa 82a8f5
      rgbg1 = vec_perm(rgb0, rgb1, (__vector unsigned char)RGBG_INDEX1);
shun-iwasawa 82a8f5
      rgbg2 = vec_perm(rgb1, rgb2, (__vector unsigned char)RGBG_INDEX2);
shun-iwasawa 82a8f5
      rgbg3 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX3);
shun-iwasawa 82a8f5
#else
shun-iwasawa 82a8f5
      /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3
shun-iwasawa 82a8f5
       * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7
shun-iwasawa 82a8f5
       * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb
shun-iwasawa 82a8f5
       * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf
shun-iwasawa 82a8f5
       *
shun-iwasawa 82a8f5
       * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3
shun-iwasawa 82a8f5
       * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7
shun-iwasawa 82a8f5
       * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb
shun-iwasawa 82a8f5
       * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf
shun-iwasawa 82a8f5
       */
shun-iwasawa 82a8f5
      rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX);
shun-iwasawa 82a8f5
      rgbg1 = vec_perm(rgb1, rgb1, (__vector unsigned char)RGBG_INDEX);
shun-iwasawa 82a8f5
      rgbg2 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX);
shun-iwasawa 82a8f5
      rgbg3 = vec_perm(rgb3, rgb3, (__vector unsigned char)RGBG_INDEX);
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
      /* rg0 = R0 G0 R1 G1 R2 G2 R3 G3
shun-iwasawa 82a8f5
       * bg0 = B0 G0 B1 G1 B2 G2 B3 G3
shun-iwasawa 82a8f5
       * ...
shun-iwasawa 82a8f5
       *
shun-iwasawa 82a8f5
       * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't
shun-iwasawa 82a8f5
       * support unsigned vectors.
shun-iwasawa 82a8f5
       */
shun-iwasawa 82a8f5
      rg0 = (__vector signed short)VEC_UNPACKHU(rgbg0);
shun-iwasawa 82a8f5
      bg0 = (__vector signed short)VEC_UNPACKLU(rgbg0);
shun-iwasawa 82a8f5
      rg1 = (__vector signed short)VEC_UNPACKHU(rgbg1);
shun-iwasawa 82a8f5
      bg1 = (__vector signed short)VEC_UNPACKLU(rgbg1);
shun-iwasawa 82a8f5
      rg2 = (__vector signed short)VEC_UNPACKHU(rgbg2);
shun-iwasawa 82a8f5
      bg2 = (__vector signed short)VEC_UNPACKLU(rgbg2);
shun-iwasawa 82a8f5
      rg3 = (__vector signed short)VEC_UNPACKHU(rgbg3);
shun-iwasawa 82a8f5
      bg3 = (__vector signed short)VEC_UNPACKLU(rgbg3);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
      /* (Original)
shun-iwasawa 82a8f5
       * Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B
shun-iwasawa 82a8f5
       * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
shun-iwasawa 82a8f5
       * Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
shun-iwasawa 82a8f5
       *
shun-iwasawa 82a8f5
       * (This implementation)
shun-iwasawa 82a8f5
       * Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G
shun-iwasawa 82a8f5
       * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
shun-iwasawa 82a8f5
       * Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
shun-iwasawa 82a8f5
       */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
      /* Calculate Y values */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
      y0 = vec_msums(rg0, pw_f0299_f0337, pd_onehalf);
shun-iwasawa 82a8f5
      y1 = vec_msums(rg1, pw_f0299_f0337, pd_onehalf);
shun-iwasawa 82a8f5
      y2 = vec_msums(rg2, pw_f0299_f0337, pd_onehalf);
shun-iwasawa 82a8f5
      y3 = vec_msums(rg3, pw_f0299_f0337, pd_onehalf);
shun-iwasawa 82a8f5
      y0 = vec_msums(bg0, pw_f0114_f0250, y0);
shun-iwasawa 82a8f5
      y1 = vec_msums(bg1, pw_f0114_f0250, y1);
shun-iwasawa 82a8f5
      y2 = vec_msums(bg2, pw_f0114_f0250, y2);
shun-iwasawa 82a8f5
      y3 = vec_msums(bg3, pw_f0114_f0250, y3);
shun-iwasawa 82a8f5
      /* Clever way to avoid 4 shifts + 2 packs.  This packs the high word from
shun-iwasawa 82a8f5
       * each dword into a new 16-bit vector, which is the equivalent of
shun-iwasawa 82a8f5
       * descaling the 32-bit results (right-shifting by 16 bits) and then
shun-iwasawa 82a8f5
       * packing them.
shun-iwasawa 82a8f5
       */
shun-iwasawa 82a8f5
      yl = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1,
shun-iwasawa 82a8f5
                    shift_pack_index);
shun-iwasawa 82a8f5
      yh = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3,
shun-iwasawa 82a8f5
                    shift_pack_index);
shun-iwasawa 82a8f5
      y = vec_pack(yl, yh);
shun-iwasawa 82a8f5
      vec_st(y, 0, outptr0);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
      /* Calculate Cb values */
shun-iwasawa 82a8f5
      cb0 = vec_msums(rg0, pw_mf016_mf033, pd_onehalfm1_cj);
shun-iwasawa 82a8f5
      cb1 = vec_msums(rg1, pw_mf016_mf033, pd_onehalfm1_cj);
shun-iwasawa 82a8f5
      cb2 = vec_msums(rg2, pw_mf016_mf033, pd_onehalfm1_cj);
shun-iwasawa 82a8f5
      cb3 = vec_msums(rg3, pw_mf016_mf033, pd_onehalfm1_cj);
shun-iwasawa 82a8f5
      cb0 = (__vector int)vec_msum((__vector unsigned short)bg0, pw_f050_f000,
shun-iwasawa 82a8f5
                                   (__vector unsigned int)cb0);
shun-iwasawa 82a8f5
      cb1 = (__vector int)vec_msum((__vector unsigned short)bg1, pw_f050_f000,
shun-iwasawa 82a8f5
                                   (__vector unsigned int)cb1);
shun-iwasawa 82a8f5
      cb2 = (__vector int)vec_msum((__vector unsigned short)bg2, pw_f050_f000,
shun-iwasawa 82a8f5
                                   (__vector unsigned int)cb2);
shun-iwasawa 82a8f5
      cb3 = (__vector int)vec_msum((__vector unsigned short)bg3, pw_f050_f000,
shun-iwasawa 82a8f5
                                   (__vector unsigned int)cb3);
shun-iwasawa 82a8f5
      cbl = vec_perm((__vector unsigned short)cb0,
shun-iwasawa 82a8f5
                     (__vector unsigned short)cb1, shift_pack_index);
shun-iwasawa 82a8f5
      cbh = vec_perm((__vector unsigned short)cb2,
shun-iwasawa 82a8f5
                     (__vector unsigned short)cb3, shift_pack_index);
shun-iwasawa 82a8f5
      cb = vec_pack(cbl, cbh);
shun-iwasawa 82a8f5
      vec_st(cb, 0, outptr1);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
      /* Calculate Cr values */
shun-iwasawa 82a8f5
      cr0 = vec_msums(bg0, pw_mf008_mf041, pd_onehalfm1_cj);
shun-iwasawa 82a8f5
      cr1 = vec_msums(bg1, pw_mf008_mf041, pd_onehalfm1_cj);
shun-iwasawa 82a8f5
      cr2 = vec_msums(bg2, pw_mf008_mf041, pd_onehalfm1_cj);
shun-iwasawa 82a8f5
      cr3 = vec_msums(bg3, pw_mf008_mf041, pd_onehalfm1_cj);
shun-iwasawa 82a8f5
      cr0 = (__vector int)vec_msum((__vector unsigned short)rg0, pw_f050_f000,
shun-iwasawa 82a8f5
                                   (__vector unsigned int)cr0);
shun-iwasawa 82a8f5
      cr1 = (__vector int)vec_msum((__vector unsigned short)rg1, pw_f050_f000,
shun-iwasawa 82a8f5
                                   (__vector unsigned int)cr1);
shun-iwasawa 82a8f5
      cr2 = (__vector int)vec_msum((__vector unsigned short)rg2, pw_f050_f000,
shun-iwasawa 82a8f5
                                   (__vector unsigned int)cr2);
shun-iwasawa 82a8f5
      cr3 = (__vector int)vec_msum((__vector unsigned short)rg3, pw_f050_f000,
shun-iwasawa 82a8f5
                                   (__vector unsigned int)cr3);
shun-iwasawa 82a8f5
      crl = vec_perm((__vector unsigned short)cr0,
shun-iwasawa 82a8f5
                     (__vector unsigned short)cr1, shift_pack_index);
shun-iwasawa 82a8f5
      crh = vec_perm((__vector unsigned short)cr2,
shun-iwasawa 82a8f5
                     (__vector unsigned short)cr3, shift_pack_index);
shun-iwasawa 82a8f5
      cr = vec_pack(crl, crh);
shun-iwasawa 82a8f5
      vec_st(cr, 0, outptr2);
shun-iwasawa 82a8f5
    }
shun-iwasawa 82a8f5
  }
shun-iwasawa 82a8f5
}