Commit 2073ea11 authored by Luca Barbato's avatar Luca Barbato Committed by Luca Barbato

checkasm: Add a readtime impl for ppc

parent 197032bd
......@@ -100,6 +100,8 @@ static const struct {
{ "AVX-512", "avx512", DAV1D_X86_CPU_FLAG_AVX512 },
#elif ARCH_AARCH64 || ARCH_ARM
{ "NEON", "neon", DAV1D_ARM_CPU_FLAG_NEON },
#elif ARCH_PPC64LE
{ "VSX", "vsx", DAV1D_PPC_CPU_FLAG_VSX },
#endif
{ 0 }
};
......
......@@ -155,6 +155,24 @@ static inline uint64_t readtime(void) {
return cycle_counter;
}
#define readtime readtime
#elif ARCH_PPC64LE
static inline uint64_t readtime(void) {
uint32_t tbu, tbl, temp;
__asm__ __volatile__(
"1:\n"
"mfspr %2,269\n"
"mfspr %0,268\n"
"mfspr %1,269\n"
"cmpw %2,%1\n"
"bne 1b\n"
: "=r"(tbl), "=r"(tbu), "=r"(temp)
:
: "cc");
return (((uint64_t)tbu) << 32) | (uint64_t)tbl;
}
#define readtime readtime
#endif
/* Verifies that clobbered callee-saved registers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment