Re: [PATCH][arm][1/X] Add initial support for saturation intrinsics

2019-11-12 Thread Kyrill Tkachov
Hi Christophe, On 11/12/19 10:29 AM, Christophe Lyon wrote: On Thu, 7 Nov 2019 at 11:26, Kyrill Tkachov wrote: Hi all, This patch adds the plumbing for and an implementation of the saturation intrinsics from ACLE [1], in particular the __ssat, __usat intrinsics. These intrinsics set the Q sti

Re: [PATCH][arm][1/X] Add initial support for saturation intrinsics

2019-11-12 Thread Christophe Lyon
On Thu, 7 Nov 2019 at 11:26, Kyrill Tkachov wrote: > > Hi all, > > This patch adds the plumbing for and an implementation of the saturation > intrinsics from ACLE [1], in particular the __ssat, __usat intrinsics. > These intrinsics set the Q sticky bit in APSR if an overflow occurred. > ACLE allow

Re: [PATCH][arm][1/X] Add initial support for saturation intrinsics

2019-11-11 Thread Kyrill Tkachov
Hi Richard, On 11/9/19 12:44 PM, Richard Henderson wrote: On 11/7/19 11:26 AM, Kyrill Tkachov wrote: -;; The code sequence emitted by this insn pattern uses the Q flag, which GCC -;; doesn't generally know about, so we don't bother expanding to individual -;; instructions. It may be better to

Re: [PATCH][arm][1/X] Add initial support for saturation intrinsics

2019-11-09 Thread Richard Henderson
> +;; define_subst and associated attributes > + > +(define_subst "add_setq" > + [(set (match_operand:SI 0 "" "") > +(match_operand:SI 1 "" ""))] > + "" > + [(set (match_dup 0) > +(match_dup 1)) > + (set (reg:CC APSRQ_REGNUM) > + (unspec:CC [(reg:CC APSRQ_REGNUM)] UNSPEC_Q_

[PATCH][arm][1/X] Add initial support for saturation intrinsics

2019-11-07 Thread Kyrill Tkachov
Hi all, This patch adds the plumbing for and an implementation of the saturation intrinsics from ACLE [1], in particular the __ssat, __usat intrinsics. These intrinsics set the Q sticky bit in APSR if an overflow occurred. ACLE allows the user to read that bit (within the same function, it's not