RE: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread Li, Pan2
a better understanding for this. Pan -Original Message- From: Andrew Pinski Sent: Tuesday, May 21, 2024 8:34 PM To: Li, Pan2 Cc: GCC Patches ; 钟居哲 ; Kito Cheng ; Tamar Christina ; Richard Guenther Subject: Re: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigne

Re: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread Andrew Pinski
@0 @1)` directly the :c is not needed and genmatch will just generate extra matching code that cannot be not get reached Thanks, Andrew. > > > > Pan > > > > > > From: Andrew Pinski > Sent: Tuesday, May 21, 2024 7:40 PM > To: Li, Pan2 > Cc: GCC Patches ;

RE: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread Li, Pan2
tina ; Richard Guenther Subject: Re: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD On Tue, May 21, 2024, 3:55 AM mailto:pan2...@intel.com>> wrote: From: Pan Li mailto:pan2...@intel.com>> This patch would like to support the __builtin_add_overf

Re: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread Andrew Pinski
On Tue, May 21, 2024, 3:55 AM wrote: > From: Pan Li > > This patch would like to support the __builtin_add_overflow branch form for > unsigned SAT_ADD. For example as below: > > uint64_t > sat_add (uint64_t x, uint64_t y) > { > uint64_t ret; > return __builtin_add_overflow (x, y, &ret) ? -1

[PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread pan2 . li
From: Pan Li This patch would like to support the __builtin_add_overflow branch form for unsigned SAT_ADD. For example as below: uint64_t sat_add (uint64_t x, uint64_t y) { uint64_t ret; return __builtin_add_overflow (x, y, &ret) ? -1 : ret; } Different to the branchless version, we lever