Beispiel #1
0
void test_ld1st1(int8x8_t small, int8x16_t big, void *addr) {
  vld1_lane_s8(addr, small, 7);
  vld1_lane_s16(addr, small, 3);
  vld1_lane_s32(addr, small, 1);
  vld1_lane_s64(addr, small, 0);

  vld1q_lane_s8(addr, big, 15);
  vld1q_lane_s16(addr, big, 7);
  vld1q_lane_s32(addr, big, 3);
  vld1q_lane_s64(addr, big, 1);

  vld1_lane_s8(addr, small, 8); // expected-error {{argument should be a value from 0 to 7}}
  vld1_lane_s16(addr, small, 4); // expected-error {{argument should be a value from 0 to 3}}
  vld1_lane_s32(addr, small, 2); // expected-error {{argument should be a value from 0 to 1}}
  vld1_lane_s64(addr, small, 1); // expected-error {{argument should be a value from 0 to 0}}

  vld1q_lane_s8(addr, big, 16); // expected-error {{argument should be a value from 0 to 15}}
  vld1q_lane_s16(addr, big, 8); // expected-error {{argument should be a value from 0 to 7}}
  vld1q_lane_s32(addr, big, 4); // expected-error {{argument should be a value from 0 to 3}}
  vld1q_lane_s64(addr, big, 2); // expected-error {{argument should be a value from 0 to 1}}

  vst1_lane_s8(addr, small, 7);
  vst1_lane_s16(addr, small, 3);
  vst1_lane_s32(addr, small, 1);
  vst1_lane_s64(addr, small, 0);

  vst1q_lane_s8(addr, big, 15);
  vst1q_lane_s16(addr, big, 7);
  vst1q_lane_s32(addr, big, 3);
  vst1q_lane_s64(addr, big, 1);

  vst1_lane_s8(addr, small, 8); // expected-error {{argument should be a value from 0 to 7}}
  vst1_lane_s16(addr, small, 4); // expected-error {{argument should be a value from 0 to 3}}
  vst1_lane_s32(addr, small, 2); // expected-error {{argument should be a value from 0 to 1}}
  vst1_lane_s64(addr, small, 1); // expected-error {{argument should be a value from 0 to 0}}

  vst1q_lane_s8(addr, big, 16); // expected-error {{argument should be a value from 0 to 15}}
  vst1q_lane_s16(addr, big, 8); // expected-error {{argument should be a value from 0 to 7}}
  vst1q_lane_s32(addr, big, 4); // expected-error {{argument should be a value from 0 to 3}}
  vst1q_lane_s64(addr, big, 2); // expected-error {{argument should be a value from 0 to 1}}
}
Beispiel #2
0
/* s16x8 mm mul */
void mw_neon_mm_mul_s16x8(short * A, int Row, int T, short * B, int Col, short * C)
{
	int i, k, j;

	int16x8_t neon_b, neon_c;
	int16x8_t neon_a0, neon_a1, neon_a2, neon_a3, neon_a4, neon_a5, neon_a6, neon_a7;
	int16x8_t neon_b0, neon_b1, neon_b2, neon_b3, neon_b4, neon_b5, neon_b6, neon_b7;

	for (i = 0; i < Row; i+=8)
	{

		for (k = 0; k < Col; k+=1)
		{
			neon_c = vmovq_n_s16(0);

			for (j = 0; j < T; j+=8)
			{

				int j_T = j * T + i;
				int k_Row = k * Row;

				neon_a0 = vld1q_s16(A + j_T);
				j_T+=Row;
				neon_a1 = vld1q_s16(A + j_T);
				j_T+=Row;
				neon_a2 = vld1q_s16(A + j_T);
				j_T+=Row;
				neon_a3 = vld1q_s16(A + j_T);
				j_T+=Row;
				neon_a4 = vld1q_s16(A + j_T);
				j_T+=Row;
				neon_a5 = vld1q_s16(A + j_T);
				j_T+=Row;
				neon_a6 = vld1q_s16(A + j_T);
				j_T+=Row;
				neon_a7 = vld1q_s16(A + j_T);

				neon_b = vld1q_s16(B + k_Row + j);
				neon_b0 = vdupq_n_s16(vgetq_lane_s16(neon_b, 0));
				neon_b1 = vdupq_n_s16(vgetq_lane_s16(neon_b, 1));
				neon_b2 = vdupq_n_s16(vgetq_lane_s16(neon_b, 2));
				neon_b3 = vdupq_n_s16(vgetq_lane_s16(neon_b, 3));
				neon_b4 = vdupq_n_s16(vgetq_lane_s16(neon_b, 4));
				neon_b5 = vdupq_n_s16(vgetq_lane_s16(neon_b, 5));
				neon_b6 = vdupq_n_s16(vgetq_lane_s16(neon_b, 6));
				neon_b7 = vdupq_n_s16(vgetq_lane_s16(neon_b, 7));

				neon_c = vaddq_s16(vmulq_s16(neon_a0, neon_b0), neon_c);
				neon_c = vaddq_s16(vmulq_s16(neon_a1, neon_b1), neon_c);
				neon_c = vaddq_s16(vmulq_s16(neon_a2, neon_b2), neon_c);
				neon_c = vaddq_s16(vmulq_s16(neon_a3, neon_b3), neon_c);
				neon_c = vaddq_s16(vmulq_s16(neon_a4, neon_b4), neon_c);
				neon_c = vaddq_s16(vmulq_s16(neon_a5, neon_b5), neon_c);
				neon_c = vaddq_s16(vmulq_s16(neon_a6, neon_b6), neon_c);
				neon_c = vaddq_s16(vmulq_s16(neon_a7, neon_b7), neon_c);

				vst1q_lane_s16(C + k_Row + i, neon_c, 0);
				vst1q_lane_s16(C + k_Row + i + 1, neon_c, 1);
				vst1q_lane_s16(C + k_Row + i + 2, neon_c, 2);
				vst1q_lane_s16(C + k_Row + i + 3, neon_c, 3);
				vst1q_lane_s16(C + k_Row + i + 4, neon_c, 4);
				vst1q_lane_s16(C + k_Row + i + 5, neon_c, 5);
				vst1q_lane_s16(C + k_Row + i + 6, neon_c, 6);
				vst1q_lane_s16(C + k_Row + i + 7, neon_c, 7);

			}
		}
	}
}