1 /* SPDX-License-Identifier: GPL-2.0-or-later */
7 static void addv(const int a
, const int b
, const int res
, const int carry
)
11 asm volatile("addv %2,%0\n"
13 : "+r"(o
), "=r"(c
) : "r"(b
) : );
15 if (c
!= carry
|| o
!= res
) {
16 printf("ADDV %d, %d = %d/%d [T = %d/%d]\n", a
, b
, o
, res
, c
, carry
);
23 addv(INT_MAX
, 1, INT_MIN
, 1);
24 addv(INT_MAX
- 1, 1, INT_MAX
, 0);