Displaying 16 results from an estimated 16 matches for "usat".
Did you mean:
usa
2012 Nov 17
0
[LLVMdev] Question about lowering clamp function to bic/usat on ARM
Hi,
Given a function like x < 0 ? 0 : x
We can lower it to bic x, x, asr 31 because we can test if CC==LT && RHS==TrueVal==0 && LHS==FalseVal
Further, give a function x > 255 ? 255 : (x < 0 ? 0 :x), we should lower it to: usat x, #8
However, things become more complicated if we have
((x < 0 ? 0 :x) << n ) & mask ...
Because it will first be converted to
x < 0 ? 0 : ((x << n) & mask)
Now, it's hard to match the pattern. (Doable but nasty)
Any suggestions?
Thanks in advance.
Weiming
Qual...
2011 Jun 18
0
[LLVMdev] RFC: Integer saturation intrinsics
...gt; The plan is to form calls to these intrinsics in InstCombine. Legalizer
> can expand these intrinsics if they are not legal. The expansion should
> be fairly straight forward and produce code that is at least as good as
> what LLVM is currently generating for these code sequence.
SSAT/USAT may set the Q (saturation) flag, which might cause problems
for anyone relying on explicitly using saturating operations (QADD etc.)
and testing the Q flag. So there are several possibilities:
- you could do liveness analysis on Q and only introduce SSAT/USAT if
Q is not live
- you could fa...
2011 Jun 17
5
[LLVMdev] RFC: Integer saturation intrinsics
Hi all,
I'm proposing integer saturation intrinsics.
def int_ssat : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i32_ty]>;
def int_usat : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i32_ty]>;
The first operand is the integer value being saturated, and second is the saturation bit position.
For scalar integer types, the semantics are:
int_ssat: x < -(1 << (bit-1)) ? -(1 << (bit-1)) : (x > (1...
2015 Jan 14
5
[LLVMdev] [RFC] Integer Saturation Intrinsics
Hi all,
The patches linked below introduce a new family of intrinsics, for
integer saturation: @llvm.usat, and @llvm.ssat (unsigned/signed).
Quoting the added documentation:
%r = call i32 @llvm.ssat.i32(i32 %x, i32 %n)
is equivalent to the expression min(max(x, -2^(n-1)), 2^(n-1)-1), itself
implementable as the following IR:
%min_sint_n = i32 ... ; the min. signed integer of bitwidth n,...
2011 Jun 19
1
[LLVMdev] RFC: Integer saturation intrinsics
...ese intrinsics in legalizer time. Also llvm is already generating inferior code for these patterns for ARM and x86.
We also have to consider whether forming sset will require substantial
changes to other passes; thinking about it, it won't be too bad here.
I still don't see the point of a usat intrinsic; we ought to already
handle constructs that should form into usat effectively.
-Eli
2015 Jan 15
2
[LLVMdev] [RFC] Integer Saturation Intrinsics
...Do you have a specific part in
mind?
Anyway, thanks for the feedback!
-Ahmed
> Philip
>
>
> On 01/14/2015 02:08 PM, Ahmed Bougacha wrote:
>>
>> Hi all,
>>
>> The patches linked below introduce a new family of intrinsics, for
>> integer saturation: @llvm.usat, and @llvm.ssat (unsigned/signed).
>> Quoting the added documentation:
>>
>> %r = call i32 @llvm.ssat.i32(i32 %x, i32 %n)
>>
>> is equivalent to the expression min(max(x, -2^(n-1)), 2^(n-1)-1), itself
>> implementable as the following IR:
>>
>>...
2011 Jun 17
0
[LLVMdev] RFC: Integer saturation intrinsics
On Fri, Jun 17, 2011 at 3:08 PM, Evan Cheng <evan.cheng at apple.com> wrote:
> Hi all,
>
> I'm proposing integer saturation intrinsics.
>
> def int_ssat : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i32_ty]>;
> def int_usat : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i32_ty]>;
>
> The first operand is the integer value being saturated, and second is the saturation bit position.
>
> For scalar integer types, the semantics are:
>
> int_ssat: x < -(1 << (bit-1)) ? -(1 <...
2011 Jun 19
0
[LLVMdev] RFC: Integer saturation intrinsics
On Jun 17, 2011, at 5:49 PM, Eli Friedman wrote:
> On Fri, Jun 17, 2011 at 4:50 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>>>>> The plan is to form calls to these intrinsics in InstCombine. Legalizer can expand these intrinsics if they are not legal. The expansion should be fairly straight forward and produce code that is at least as good as what LLVM is
2011 Jun 18
2
[LLVMdev] RFC: Integer saturation intrinsics
On Fri, Jun 17, 2011 at 4:50 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>>>> The plan is to form calls to these intrinsics in InstCombine. Legalizer can expand these intrinsics if they are not legal. The expansion should be fairly straight forward and produce code that is at least as good as what LLVM is currently generating for these code sequence.
>>>>
2011 Jun 17
2
[LLVMdev] RFC: Integer saturation intrinsics
...> On Fri, Jun 17, 2011 at 3:08 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>> Hi all,
>>
>> I'm proposing integer saturation intrinsics.
>>
>> def int_ssat : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i32_ty]>;
>> def int_usat : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i32_ty]>;
>>
>> The first operand is the integer value being saturated, and second is the saturation bit position.
>>
>> For scalar integer types, the semantics are:
>>
>> int_ssat: x < -(1 &...
2015 Jan 15
3
[LLVMdev] [RFC] Integer Saturation Intrinsics
...neficial
> optimisations.
>
> David
>
> > On 14 Jan 2015, at 22:08, Ahmed Bougacha <ahmed.bougacha at gmail.com>
> wrote:
> >
> > Hi all,
> >
> > The patches linked below introduce a new family of intrinsics, for
> > integer saturation: @llvm.usat, and @llvm.ssat (unsigned/signed).
> > Quoting the added documentation:
> >
> > %r = call i32 @llvm.ssat.i32(i32 %x, i32 %n)
> >
> > is equivalent to the expression min(max(x, -2^(n-1)), 2^(n-1)-1), itself
> > implementable as the following IR:
> >
>...
2015 Jan 15
0
[LLVMdev] [RFC] Integer Saturation Intrinsics
...t; Anyway, thanks for the feedback!
>
> -Ahmed
>
>> Philip
>>
>>
>> On 01/14/2015 02:08 PM, Ahmed Bougacha wrote:
>>> Hi all,
>>>
>>> The patches linked below introduce a new family of intrinsics, for
>>> integer saturation: @llvm.usat, and @llvm.ssat (unsigned/signed).
>>> Quoting the added documentation:
>>>
>>> %r = call i32 @llvm.ssat.i32(i32 %x, i32 %n)
>>>
>>> is equivalent to the expression min(max(x, -2^(n-1)), 2^(n-1)-1), itself
>>> implementable as the follow...
2018 Aug 22
2
Fixed Point Support in LLVM
...ould be a number of separate intrinsics with well-defined
semantics for each one, preferably semantics that can be described in a
single line. That makes it easy to implement and understand. Like so:
llvm.ssat.iN(iN A, i32 SatWidth) = saturate anything above SatWidth bits
as a signed value
llvm.usat.iN(iN B, i32 SatWidth) = saturate anything above SatWidth bits
as an unsigned value
llvm.fixsmul.iN(iN A, iN B, i32 Scale) = sext->mul->ashr->trunc
llvm.fixumul.iN(iN A, iN B, i32 Scale) = zext->mul->lshr->trunc
llvm.fixsmul.sat.iN(iN A, iN B, i32 Scale) = sext->mul->ashr-&...
2007 Jul 30
2
EditingCentOSWiki in Italian
...==
* Evitare l'uso delle prima persona singolare ("Io", "mio" etc.) nelle
pagine, poich? non ? molto utile al lettore, e d? un'aria poco professionale
al tutto. Se dovete fare riferimento a voi stessi o a qualcun altro,
riferitevi alla pagina del Wiki con il contatto (o usate il nome completo se
la persona non ha una pagina su questo Wiki)
--
Quando ti trovi d'accordo con la maggioranza, ? il momento di fermarti e
riflettere - Mark Twain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos-d...
2011 Jun 17
0
[LLVMdev] RFC: Integer saturation intrinsics
...2011 at 3:08 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>>> Hi all,
>>>
>>> I'm proposing integer saturation intrinsics.
>>>
>>> def int_ssat : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i32_ty]>;
>>> def int_usat : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i32_ty]>;
>>>
>>> The first operand is the integer value being saturated, and second is the saturation bit position.
>>>
>>> For scalar integer types, the semantics are:
>>>
>>> i...
2018 Aug 22
2
Fixed Point Support in LLVM
On 2018-08-22 05:56, John McCall via llvm-dev wrote:
>> On Aug 21, 2018, at 6:20 PM, Leonard Chan <leonardchan at google.com> wrote:
>> If we were to create a new type down the line, I think the main
>> features that would distinguish them from other types are the
>> arbitrary width and scale. Saturation can be handled through
>> instructions since saturation