Liste des Groupes | Revenir à c arch |
mitchalsup@aol.com (MitchAlsup1) writes:I just copied the RISC-V codeAnd just for fun::>
>
On Fri, 6 Sep 2024 13:26:42 +0000, Anton Ertl wrote:Here we have the three variants:>
>
#include <limits.h>
>
extern long foo1(long);
extern long foo2(long);
>
long bar(long a, long b)
{
long c;
if (__builtin_sub_overflow(b,1,&c))
return foo1(a);
else
return foo2(a);
}
>
long bar2(long a, long b)
{
if (b < b-1)
return foo1(a);
else
return foo2(a);
}
>
long bar3(long a, long b)
{
if (b == LONG_MIN)
return foo1(a);
else
return foo2(a);
}
My 66000:
add r3,R1,#-1 add r3,r1,#-1 bepm r1,.L4
bge R3,.L4 bge r3,.L4
8-bytes 8-bytes 4-bytes
>
I have a direct test for POSMAX in ISA that does not use a constant.
How does bge work in the first and second column? My impression was
that you are using an 88k-style flags-in-GPR architecture.
Concerning the last column, the gcc developer who added theMy branch on comparison to zero (BC) instruction has 32 variants
transformation of bar2() into bar3() apparently had My66000 in mind.
- anton
Les messages affichés proviennent d'usenet.