Skip to content

Commit

Permalink
maxtrix add number intend
Browse files Browse the repository at this point in the history
  • Loading branch information
LyleLee committed Nov 14, 2019
1 parent ec91ee1 commit d3993af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions matrix_add_number.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ void print_uint8x16(uint8x16_t *a, int n)
int main()
{
uint8_t data[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};

uint8x16_t A = vld1q_u8(data); //copy data to matrix A
uint8x16_t B = vmovq_n_u8(3); //prepare matrix B, every element with 3
uint8x16_t C = vaddq_u8(A, B); //C = A ⊕ B
Expand Down
5 changes: 1 addition & 4 deletions vmovq_n_u8.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ void print_uint8x16(uint8x16_t *a, int n)
{
uint8_t *p = (uint8_t *)a;
int i;
for(i = 0; i < n; i++)
{
for(i = 0; i < n; i++) {
printf("%02d ", *(p+1));
}
printf("\n");
}

int main()
{

uint8x16_t three = vmovq_n_u8(3);

print_uint8x16(&three, 16);
}

0 comments on commit d3993af

Please sign in to comment.