On 5/11/23 04:33, Robin Dapp wrote:
"csr_operand" does seem wrong, though, as that just accepts constants.
Maybe "arith_operand" is the way to go?  I haven't looked at the
V immediates though.

I was pondering changing the shift-count operand to QImode everywhere
but that indeed does not help code generation across the board.  It can
still work but might require extra patterns here and there.
Yea. It's a GCC wart and there hasn't ever been a clear best direction on the mode for the shift count. If you use QImode, as you note you often end up having to add various patterns to avoid useless conversions and such.

I suspect QImode isn't ideal on a target like RV where we don't really have QImode operations. So all we do is force the introduction of subregs all over the place to force the operand in to QImode. It's something I'd like to explore, but would obviously require a fair amount of benchmarking to be able to confidently say which is better.

Jeff

Reply via email to