RE: Vector (and integer) API: unsigned min/max

2024-04-18 Thread Viswanathan, Sandhya
: core-libs-dev@openjdk.org; Viswanathan, Sandhya Subject: Re: Vector (and integer) API: unsigned min/max Hi David, It’s not at all outlandish, but would caution it's more work than one might initially think. Could you describe a little more about your use case? that can be helpful to under

Re: Vector (and integer) API: unsigned min/max

2024-04-18 Thread John Rose
On Apr 17, 2024, at 7:14 AM, David Lloyd wrote: > > 2. Add .MIN_VALUE, min/max with a value or vector also offset by > .MIN_VALUE, and then subtract the offset again I think that’s the path of least resistance. It’s just a vxor on each operand, with a constant mask. That can be done in Java co

Re: Vector (and integer) API: unsigned min/max

2024-04-18 Thread David Lloyd
Presently, I'm implementing operations for a WASM emulator/runtime, so it's more a case of transitively acquiring use cases from WASM, though I'm also doing this specifically to practice accomplishing useful things with the vector API. Regarding saturating arithmetic: WASM has operations for that

Re: Vector (and integer) API: unsigned min/max

2024-04-18 Thread Paul Sandoz
Hi David, It’s not at all outlandish, but would caution it's more work than one might initially think. Could you describe a little more about your use case? that can be helpful to understand the larger picture and demand. Using unsigned comparison would be my recommended approach with the curr