Skip to content

Commit

Permalink
[apps] 🎨 clang format pass
Browse files Browse the repository at this point in the history
  • Loading branch information
mp-17 committed Oct 30, 2024
1 parent 95a6cb4 commit 1ac317d
Show file tree
Hide file tree
Showing 7 changed files with 1,844 additions and 1,167 deletions.
123 changes: 61 additions & 62 deletions apps/riscv-tests/isa/rv64uv/vlseg.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ void TEST_CASE4_8(void) {
// Segment-2 for 16-bit
void TEST_CASE1_16(void) {
VSET(4, e16, m1);
volatile uint16_t INP1[] = {0x9fe4, 0x1920, 0x8f2e, 0x05e0,
0xf9aa, 0x71f0, 0xc394, 0xbbd3,
0x1234, 0x5678, 0x9abc, 0xdef0,
volatile uint16_t INP1[] = {0x9fe4, 0x1920, 0x8f2e, 0x05e0, 0xf9aa, 0x71f0,
0xc394, 0xbbd3, 0x1234, 0x5678, 0x9abc, 0xdef0,
0x1357, 0x2468, 0x369b, 0x48ac};
VCLEAR(v1);
VCLEAR(v2);
Expand All @@ -89,9 +88,8 @@ void TEST_CASE1_16(void) {
// Segment-3 for 16-bit
void TEST_CASE2_16(void) {
VSET(4, e16, m1);
volatile uint16_t INP1[] = {0x9fe4, 0x1920, 0x8f2e, 0x05e0,
0xf9aa, 0x71f0, 0xc394, 0xbbd3,
0x1234, 0x5678, 0x9abc, 0xdef0,
volatile uint16_t INP1[] = {0x9fe4, 0x1920, 0x8f2e, 0x05e0, 0xf9aa, 0x71f0,
0xc394, 0xbbd3, 0x1234, 0x5678, 0x9abc, 0xdef0,
0x1357, 0x2468, 0x369b, 0x48ac};
VCLEAR(v1);
VCLEAR(v2);
Expand All @@ -105,9 +103,8 @@ void TEST_CASE2_16(void) {
// Segment-4 for 16-bit
void TEST_CASE3_16(void) {
VSET(4, e16, m1);
volatile uint16_t INP1[] = {0x9fe4, 0x1920, 0x8f2e, 0x05e0,
0xf9aa, 0x71f0, 0xc394, 0xbbd3,
0x1234, 0x5678, 0x9abc, 0xdef0,
volatile uint16_t INP1[] = {0x9fe4, 0x1920, 0x8f2e, 0x05e0, 0xf9aa, 0x71f0,
0xc394, 0xbbd3, 0x1234, 0x5678, 0x9abc, 0xdef0,
0x1357, 0x2468, 0x369b, 0x48ac};
VCLEAR(v1);
VCLEAR(v2);
Expand All @@ -123,9 +120,8 @@ void TEST_CASE3_16(void) {
// Segment-8 for 16-bit
void TEST_CASE4_16(void) {
VSET(2, e16, m1);
volatile uint16_t INP1[] = {0x9fe4, 0x1920, 0x8f2e, 0x05e0,
0xf9aa, 0x71f0, 0xc394, 0xbbd3,
0x1234, 0x5678, 0x9abc, 0xdef0,
volatile uint16_t INP1[] = {0x9fe4, 0x1920, 0x8f2e, 0x05e0, 0xf9aa, 0x71f0,
0xc394, 0xbbd3, 0x1234, 0x5678, 0x9abc, 0xdef0,
0x1357, 0x2468, 0x369b, 0x48ac};
VCLEAR(v1);
VCLEAR(v2);
Expand Down Expand Up @@ -223,74 +219,79 @@ void TEST_CASE4_32(void) {
// Segment-2 for 64-bit
void TEST_CASE1_64(void) {
VSET(4, e64, m1);
volatile uint64_t INP1[] = {0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3,
0x123456789abcdef0, 0x13572468369b48ac,
0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890,
0xfeedfacecafebabe, 0x123456789abcdef0,
0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321,
0x012345670abcdef1, 0x987654321fedcba0};
volatile uint64_t INP1[] = {
0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3, 0x123456789abcdef0,
0x13572468369b48ac, 0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890, 0xfeedfacecafebabe,
0x123456789abcdef0, 0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321, 0x012345670abcdef1,
0x987654321fedcba0};
VCLEAR(v1);
VCLEAR(v2);
asm volatile("vlseg2e64.v v1, (%0)" ::"r"(INP1));
VCMP_U64(52, v1, 0x9fe419208f2e05e0, 0x123456789abcdef0, 0xdeadbeefcafebabe, 0x55aa55aa77889900);
VCMP_U64(53, v2, 0xf9aa71f0c394bbd3, 0x13572468369b48ac, 0x0123456789abcdef, 0xabcdef1234567890);
VCMP_U64(52, v1, 0x9fe419208f2e05e0, 0x123456789abcdef0, 0xdeadbeefcafebabe,
0x55aa55aa77889900);
VCMP_U64(53, v2, 0xf9aa71f0c394bbd3, 0x13572468369b48ac, 0x0123456789abcdef,
0xabcdef1234567890);
}

// Segment-3 for 64-bit
void TEST_CASE2_64(void) {
VSET(4, e64, m1);
volatile uint64_t INP1[] = {0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3,
0x123456789abcdef0, 0x13572468369b48ac,
0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890,
0xfeedfacecafebabe, 0x123456789abcdef0,
0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321,
0x012345670abcdef1, 0x987654321fedcba0};
volatile uint64_t INP1[] = {
0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3, 0x123456789abcdef0,
0x13572468369b48ac, 0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890, 0xfeedfacecafebabe,
0x123456789abcdef0, 0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321, 0x012345670abcdef1,
0x987654321fedcba0};
VCLEAR(v1);
VCLEAR(v2);
VCLEAR(v3);
asm volatile("vlseg3e64.v v1, (%0)" ::"r"(INP1));
VCMP_U64(54, v1, 0x9fe419208f2e05e0, 0x13572468369b48ac, 0x55aa55aa77889900, 0x123456789abcdef0);
VCMP_U64(55, v2, 0xf9aa71f0c394bbd3, 0xdeadbeefcafebabe, 0xabcdef1234567890, 0x1357246855aa55aa);
VCMP_U64(56, v3, 0x123456789abcdef0, 0x0123456789abcdef, 0xfeedfacecafebabe, 0x369b48acdeadbeef);
VCMP_U64(54, v1, 0x9fe419208f2e05e0, 0x13572468369b48ac, 0x55aa55aa77889900,
0x123456789abcdef0);
VCMP_U64(55, v2, 0xf9aa71f0c394bbd3, 0xdeadbeefcafebabe, 0xabcdef1234567890,
0x1357246855aa55aa);
VCMP_U64(56, v3, 0x123456789abcdef0, 0x0123456789abcdef, 0xfeedfacecafebabe,
0x369b48acdeadbeef);
}

// Segment-4 for 64-bit
void TEST_CASE3_64(void) {
VSET(4, e64, m1);
volatile uint64_t INP1[] = {0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3,
0x123456789abcdef0, 0x13572468369b48ac,
0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890,
0xfeedfacecafebabe, 0x123456789abcdef0,
0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321,
0x012345670abcdef1, 0x987654321fedcba0};
volatile uint64_t INP1[] = {
0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3, 0x123456789abcdef0,
0x13572468369b48ac, 0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890, 0xfeedfacecafebabe,
0x123456789abcdef0, 0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321, 0x012345670abcdef1,
0x987654321fedcba0};
VCLEAR(v1);
VCLEAR(v2);
VCLEAR(v3);
VCLEAR(v4);
asm volatile("vlseg4e64.v v1, (%0)" ::"r"(INP1));
VCMP_U64(57, v1, 0x9fe419208f2e05e0, 0xdeadbeefcafebabe, 0xfeedfacecafebabe, 0xcafebabe12345678);
VCMP_U64(58, v2, 0xf9aa71f0c394bbd3, 0x0123456789abcdef, 0x123456789abcdef0, 0xabcdef0987654321);
VCMP_U64(59, v3, 0x123456789abcdef0, 0x55aa55aa77889900, 0x1357246855aa55aa, 0x012345670abcdef1);
VCMP_U64(60, v4, 0x13572468369b48ac, 0xabcdef1234567890, 0x369b48acdeadbeef, 0x987654321fedcba0);
VCMP_U64(57, v1, 0x9fe419208f2e05e0, 0xdeadbeefcafebabe, 0xfeedfacecafebabe,
0xcafebabe12345678);
VCMP_U64(58, v2, 0xf9aa71f0c394bbd3, 0x0123456789abcdef, 0x123456789abcdef0,
0xabcdef0987654321);
VCMP_U64(59, v3, 0x123456789abcdef0, 0x55aa55aa77889900, 0x1357246855aa55aa,
0x012345670abcdef1);
VCMP_U64(60, v4, 0x13572468369b48ac, 0xabcdef1234567890, 0x369b48acdeadbeef,
0x987654321fedcba0);
}

// Segment-8 for 64-bit
void TEST_CASE4_64(void) {
VSET(2, e64, m1);
volatile uint64_t INP1[] = {0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3,
0x123456789abcdef0, 0x13572468369b48ac,
0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890,
0xfeedfacecafebabe, 0x123456789abcdef0,
0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321,
0x012345670abcdef1, 0x987654321fedcba0};
volatile uint64_t INP1[] = {
0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3, 0x123456789abcdef0,
0x13572468369b48ac, 0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890, 0xfeedfacecafebabe,
0x123456789abcdef0, 0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321, 0x012345670abcdef1,
0x987654321fedcba0};
VCLEAR(v1);
VCLEAR(v2);
VCLEAR(v3);
Expand All @@ -313,14 +314,13 @@ void TEST_CASE4_64(void) {
// Segment-8 for 64-bit
void TEST_CASE4_64_m(void) {
VSET(2, e64, m1);
volatile uint64_t INP1[] = {0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3,
0x123456789abcdef0, 0x13572468369b48ac,
0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890,
0xfeedfacecafebabe, 0x123456789abcdef0,
0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321,
0x012345670abcdef1, 0x987654321fedcba0};
volatile uint64_t INP1[] = {
0x9fe419208f2e05e0, 0xf9aa71f0c394bbd3, 0x123456789abcdef0,
0x13572468369b48ac, 0xdeadbeefcafebabe, 0x0123456789abcdef,
0x55aa55aa77889900, 0xabcdef1234567890, 0xfeedfacecafebabe,
0x123456789abcdef0, 0x1357246855aa55aa, 0x369b48acdeadbeef,
0xcafebabe12345678, 0xabcdef0987654321, 0x012345670abcdef1,
0x987654321fedcba0};
VCLEAR(v1);
VCLEAR(v2);
VCLEAR(v3);
Expand Down Expand Up @@ -360,7 +360,6 @@ void TEST_CASE4_64_m(void) {
VCMP_U64(84, v8, 0, 0);
}


int main(void) {
INIT_CHECK();
enable_vec();
Expand Down
Loading

0 comments on commit 1ac317d

Please sign in to comment.