Hexagon (target/hexagon) Add support for v68/v69/v71/v73

Add support for the ELF flags
Move target/hexagon/cpu.[ch] to be v73
Change the compiler flag used by "make check-tcg"

The decbin instruction is removed in Hexagon v73, so check the
version before trying to compile the instruction.

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230427224057.3766963-2-tsimpson@quicinc.com>
This commit is contained in:
Taylor Simpson 2023-04-27 15:40:49 -07:00
parent 278238505d
commit fc2622f660
7 changed files with 43 additions and 13 deletions

View file

@ -18,6 +18,8 @@
#include <stdio.h>
#include <string.h>
#define CORE_HAS_CABAC (__HEXAGON_ARCH__ <= 71)
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
@ -245,6 +247,7 @@ static void check(int val, int expect)
}
}
#if CORE_HAS_CABAC
static void check64(long long val, long long expect)
{
if (val != expect) {
@ -252,6 +255,7 @@ static void check64(long long val, long long expect)
err++;
}
}
#endif
uint32_t init[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
uint32_t array[10];
@ -286,6 +290,7 @@ static long long creg_pair(int x, int y)
return retval;
}
#if CORE_HAS_CABAC
static long long decbin(long long x, long long y, int *pred)
{
long long retval;
@ -295,6 +300,7 @@ static long long decbin(long long x, long long y, int *pred)
: "r"(x), "r"(y));
return retval;
}
#endif
/* Check that predicates are auto-and'ed in a packet */
static int auto_and(void)
@ -388,8 +394,10 @@ void test_count_trailing_zeros_ones(void)
int main()
{
int res;
#if CORE_HAS_CABAC
long long res64;
int pred;
#endif
memcpy(array, init, sizeof(array));
S4_storerhnew_rr(array, 4, 0xffff);
@ -505,6 +513,7 @@ int main()
res = test_clrtnew(2, 7);
check(res, 7);
#if CORE_HAS_CABAC
res64 = decbin(0xf0f1f2f3f4f5f6f7LL, 0x7f6f5f4f3f2f1f0fLL, &pred);
check64(res64, 0x357980003700010cLL);
check(pred, 0);
@ -512,6 +521,9 @@ int main()
res64 = decbin(0xfLL, 0x1bLL, &pred);
check64(res64, 0x78000100LL);
check(pred, 1);
#else
puts("Skipping cabac tests");
#endif
res = auto_and();
check(res, 0);