gcc-9-20200222 is now available

2020-02-22 Thread gccadmin
Snapshot gcc-9-20200222 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/9-20200222/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 9 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch releases/gcc-9 
revision c080a6fb6f0cf402affc287fc600c189980cfb2d

You'll find:

 gcc-9-20200222.tar.xzComplete GCC

  SHA256=fb2730c45d9bff260c3906d6aa8a4492d0c600ceb5e6971b899ab1dbbd15cee8
  SHA1=04212999c7af2047342c37c4c78c2be13a09d900

Diffs from 9-20200215 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-9
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


Re: Matching and testing against smulhsm3

2020-02-22 Thread Segher Boessenkool
Hi!

On Mon, Feb 17, 2020 at 09:54:58PM +0100, Marcus Geelnard wrote:
> On 2020-02-17 02:12, Segher Boessenkool wrote:
> >>Trying 10, 9 -> 11:
> >>Failed to match this instruction:
> >>(set (reg:SI 84)
> >> (mult:SI (sign_extend:SI (subreg:HI (reg:SI 87) 0))
> >> (sign_extend:SI (subreg:HI (reg:SI 86) 0
> >And neither do both together.  Do you have an instruction that can do
> >this?  How expensive is it?
> 
> Unfortunately I don't have an instruction specifically for mult:SI 
> (sign_extend:SI (HI)) (sign_extend:SI (HI)).

> >In the meantime, you can add a pattern for the result of 9+10+11:
> >
> >(set (match_operand:SI ...)
> >  (mult:SI (sign_extend:SI (match_operand:HI ...))
> >   (sign_extend:SI (match_operand:HI ...
> >
> >(which you then have to handle, of course, either with a machine insn
> >if that exists, or some other way, a libcall perhaps; you already have
> >some way to do mulsi3 I guess?)
> 
> Yes, I have mulsi3, but the thing is that I have instructions that 
> exactly match the definition of smulhsqi3/smulhshi3/smulhssi3. They're 
> called MULQ.B, MULQ.H and MULQ (for Q-format fixed point), and they 
> typically have a throughput of 1 operation / cycle. See [1]. I'd really 
> like to find a way to tell gcc to emit those instructions.

Sure, but it won't go there in one step currently, since it would have
to combine four insns, and it doesn't try that.  But, if you add a
pattern for this mulsihi2, it can create that one first, and then
combine that single insn with the shift right.

If this mulsihi2 isn't combined in that way, you will have to split it
into separate extends and a mulsi3 later (or do it some other way, if
you can do it cheaper for example).

> If naive C code does not generate a matching pattern (it would be nice 
> if it did, though), is there something else that can be used (e.g. a 
> builtin)?

You can always create a builtin for it, sure.


Segher