[PATCH] D117898: [Clang] Add elementwise saturated add/sub builtins
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 7 09:48:00 PST 2022
aaron.ballman added inline comments.
Comment at: clang/docs/LanguageExtensions.rst:549
+ T __builtin_elementwise_add_sat(T x, T y) return the sum of x and y, clamped to the range of signed or integer types
+ values representable by the bit width of the arguments.
+ T __builtin_elementwise_sub_sat(T x, T y) return the difference of x and y, clamped to the range of integer types
> aaron.ballman wrote:
> > aaron.ballman wrote:
> > > craig.topper wrote:
> > > > Not sure if I'm reading this right due to the columns, but is "unsigned" missing after the "signed or"
> > > This reads strangely to me as well. "..., clamped to the range of signed or integer types unsigned values representable by.."
> > This still seems unaddressed.
> I rephrased it - what did you have in mind?
I think what's been throwing me off is "range of integer types signed or unsigned values", but I don't think signed or unsigned really matters here, so I tried to reword it a bit. Does this work for you?
`return the sum of x and y, clamped to the range of representable values for the integer type.`
(Similar below for difference).
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits