Re: [PATCH] RL78 one_cmplhi2 improvement

2018-02-27 Thread DJ Delorie
"Sebastian Perta" writes: > Is this similar to what you had in mind? Yes. Did it affect code size in any of the larger tests? I was hoping that it wouldn't force too much into 8-bit registers and cause more moves to be needed elsewhere. (and even if it didn't, I

RE: [PATCH] RL78 one_cmplhi2 improvement

2018-02-27 Thread Sebastian Perta
s, Sebastian > -Original Message- > From: DJ Delorie [mailto:d...@redhat.com] > Sent: 20 February 2018 19:39 > To: Sebastian Perta <sebastian.pe...@renesas.com> > Cc: gcc-patches@gcc.gnu.org > Subject: Re: [PATCH] RL78 one_cmplhi2 improvement > > > Const

Re: [PATCH] RL78 one_cmplhi2 improvement

2018-02-20 Thread DJ Delorie
Const type promotion is the bane of embedded developers... One thing to try is to use (subreg:QI in a define_expand, so that there's a one_cmplhi2 pattern that expands to two QImode insns that operate on HImode input/outputs via SUBREGs. I don't have high hopes of gcc optimizing this properly

[PATCH] RL78 one_cmplhi2 improvement

2018-02-20 Thread Sebastian Perta
Hello, The following patch defines one_cmplhi2 pattern. The improvement does not come from the two xor instructions used (in fact for the second xor the pattern uses xor saddr , #byte is used which is 1 bytes longer than xor a, #byte) it comes from the fact that that the number of move