Re: [PATCH] rs6000: Generate _Decimal128 to _Decimal32 hardware conversion instructions

2020-07-17 Thread Peter Bergner via Gcc-patches
On 7/17/20 5:07 PM, Peter Bergner wrote: > As we discussed offline, we need the duplicated constraint alternatives > like below. I'll test this and commit this if clean with the following > additional ChangeLog entry for the p9 addition. Thanks. Testing was clean, so I pushed the commit. Thanks

Re: [PATCH] rs6000: Generate _Decimal128 to _Decimal32 hardware conversion instructions

2020-07-17 Thread Peter Bergner via Gcc-patches
On 7/17/20 4:32 PM, Segher Boessenkool wrote: > Well, just make an "isa" value of "p9"? Then you can just do > > (define_insn "trunctdsd2" > [(set (match_operand:SD 0 "gpc_reg_operand" "=d") > (float_truncate:SD (match_operand:TD 1 "gpc_reg_operand" "d"))) >(clobber (match_scratch:T

Re: [PATCH] rs6000: Generate _Decimal128 to _Decimal32 hardware conversion instructions

2020-07-17 Thread Segher Boessenkool
On Fri, Jul 17, 2020 at 04:18:55PM -0500, Peter Bergner wrote: > On 7/17/20 3:23 PM, Segher Boessenkool wrote: > > On ISA 3.0B and later you can do > > > > mffscdrni %3,7 > > drdpq %2,%1 > > mffscdrn %3,%3 > > drsp %0,%2 > > > > (saving one insn, and using somewhat cheaper insns).

Re: [PATCH] rs6000: Generate _Decimal128 to _Decimal32 hardware conversion instructions

2020-07-17 Thread Peter Bergner via Gcc-patches
On 7/17/20 3:23 PM, Segher Boessenkool wrote: > On ISA 3.0B and later you can do > > mffscdrni %3,7 > drdpq %2,%1 > mffscdrn %3,%3 > drsp %0,%2 > > (saving one insn, and using somewhat cheaper insns). But that is only > on newer machines, so is this worth it at all? :-)

Re: [PATCH] rs6000: Generate _Decimal128 to _Decimal32 hardware conversion instructions

2020-07-17 Thread Segher Boessenkool
On Fri, Jul 17, 2020 at 02:47:50PM -0500, Peter Bergner wrote: > PR92488 shows we do not generate hardware conversion instructions when > converting from _Decimal128 to _Decimal32. There is no one instruction > that does the conversion, so we currently call the __dpd_trunctdsd2 > function to do th

[PATCH] rs6000: Generate _Decimal128 to _Decimal32 hardware conversion instructions

2020-07-17 Thread Peter Bergner via Gcc-patches
PR92488 shows we do not generate hardware conversion instructions when converting from _Decimal128 to _Decimal32. There is no one instruction that does the conversion, so we currently call the __dpd_trunctdsd2 function to do the conversion for us. This is slow. Paul Murphy described a short sequ