[PATCH] Add Integer Saturation Intrinsics.

Demikhovsky, Elena elena.demikhovsky at intel.com
Tue Mar 31 23:23:46 PDT 2015


Unlike ARM, X86 can saturate (signed and unsigned) from 16 to 8, from 32 to 16 with following truncation and these instructions are SIMD.

The ideal form would be something like <16 x i16> @llvm.ssat.v16i32(<16 x i32> %val). And the sequence is
Cmp
Select
Cmp
Select
trunc

I'm thinking how to define an intrinsic convenient for all targets..


-  Elena


-----Original Message-----
From: Ahmed Bougacha [mailto:ahmed.bougacha at gmail.com] 
Sent: Monday, March 30, 2015 19:38
To: Demikhovsky, Elena
Cc: reviews+D6976+public+4d709814889a9ede at reviews.llvm.org; weimingz at codeaurora.org; echristo at gmail.com; llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] Add Integer Saturation Intrinsics.

On Mon, Mar 30, 2015 at 4:24 AM, Demikhovsky, Elena <elena.demikhovsky at intel.com> wrote:
> Hi,
>
> I'm interested in these intrinsics for X86.

Great!  I have patches matching these intrinsics to generate add, sub, and pack with saturation.  Is that what you want, or is there something else I missed?

> Do you plan to push them as target independent?

Yes, whatever we decide (intrinsics or not), the solution will be target-independent (and I'm working on AArch64, ARM, and X86).

-Ahmed

> Thanks.
>
> -  Elena
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.




More information about the llvm-commits mailing list