This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add uaddv4_optab, usubv4_optab


Toward fixing PR68385.  I'm just starting a full round of testing, but

extern void underflow(void) __attribute__((noreturn));
unsigned sub1(unsigned a, unsigned b)
{
    unsigned r = a - b;
    if (r > a) underflow();
    return r;
}

unsigned sub2(unsigned a, unsigned b)
{
    unsigned r;
    if (__builtin_sub_overflow(a, b, &r)) underflow();
    return r;
}


sub1:
	movl	%edi, %eax
	subl	%esi, %eax
	cmpl	%eax, %edi
	jb	.L7
	rep ret
...
sub2:
	movl	%edi, %eax
	subl	%esi, %eax
	jb	.L16
	rep ret
...


r~

Attachment: z
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]