int test_j(int i) {
int res;
__asm("movw %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "j"(-1), [ input ] "r"(i)
:);
__asm("movw %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "j"(0), [ input ] "r"(i)
:);
__asm("movw %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "j"(65535), [ input ] "r"(i)
:);
__asm("movw %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "j"(65536), [ input ] "r"(i)
:);
return res;
}
int test_I(int i) {
int res;
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "I"(-1), [ input ] "r"(i)
:); __asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "I"(0), [ input ] "r"(i)
:); __asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "I"(255), [ input ] "r"(i)
:); __asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "I"(256), [ input ] "r"(i)
:); return res;
}
int test_J(int i) {
int res;
__asm(
"movw %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "J"(-4096), [ input ] "r"(i)
:);
__asm(
"movw %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "J"(-4095), [ input ] "r"(i)
:);
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "J"(-256), [ input ] "r"(i)
:);
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "J"(-255), [ input ] "r"(i)
:);
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "J"(-1), [ input ] "r"(i)
:);
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "J"(0), [ input ] "r"(i)
:);
__asm(
"movw %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "J"(4095), [ input ] "r"(i)
:);
__asm(
"movw %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "J"(4096), [ input ] "r"(i)
:);
return res;
}
int test_K(int i) {
int res;
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "K"(123), [ input ] "r"(i)
:);
return res;
}
int test_L(int i) {
int res;
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "L"(-8), [ input ] "r"(i)
:); __asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "L"(-7), [ input ] "r"(i)
:); __asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "L"(7), [ input ] "r"(i)
:); __asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "L"(8), [ input ] "r"(i)
:); return res;
}
int test_M(int i) {
int res;
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "M"(123), [ input ] "r"(i)
:); return res;
}
int test_N(int i) {
int res;
__asm("add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "N"(-1), [ input ] "r"(i)
:);
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "N"(0), [ input ] "r"(i)
:);
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "N"(31), [ input ] "r"(i)
:);
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "N"(32), [ input ] "r"(i)
:);
return res;
}
int test_O(int i) {
int res;
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "O"(1), [ input ] "r"(i)
:);
return res;
}
int test_l(int i) {
int res;
__asm(
"add %0, %1;"
: [ result ] "=l"(res)
: [ constant ] "i"(10), [ input ] "l"(i)
:); return res;
}
int test_h(int i) {
int res;
__asm(
"add %0, %1;"
: [ result ] "=h"(res)
: [ constant ] "i"(10), [ input ] "h"(i)
:);
return res;
}
int g;
int test_s(int i) {
int res;
__asm(
"add %0, %1;"
: [ result ] "=r"(res)
: [ constant ] "s"(&g), [ input ] "r"(i)
:); return res;
}
float test_w(float x) {
__asm__("vsqrt.f32 %0, %1"
: "=w"(x)
: "w"(x)); return x;
}
float test_x(float x) {
__asm__("vsqrt.f32 %0, %1"
: "=x"(x)
: "x"(x)); return x;
}
float test_t(float x) {
__asm__("vsqrt.f32 %0, %1"
: "=t"(x)
: "t"(x)); return x;
}