Re: Reload problems with only one base reg for "base + offset" addressing mode

2010-07-25 Thread redriver jiang
Hi, it works.

But the constrains are really long.

I use "U" for memory operands with address "R18+offset", and "S" for
memory operands with address "R16" or "R17", and "Q" for memory
operands with constant address(such as symbol ref, or const_int), the
all combinations are as more as 43 types, and I have to change
"MAX_RECOG_ALTERNATIVES" from "30" to be larger constants in
"recog.h".

(define_insn "*iorqi3_noimm_to_reg"
[(set(match_operand:QI 0 "register_mem_operand"
"=r,r,r,r,r,r,r,r,r,r,r,r,r,U,U,U,S,S,S,Q,Q,Q,U,S,Q,U,U,U,U,U,U,S,S,S,S,S,S,Q,Q,Q,Q,Q,Q")
  (ior:QI (match_operand:QI 1 "register_mem_operand"
"%0,0,0,0,U,U,U,S,S,S,Q,Q,Q,r,r,r,r,r,r,r,r,r,r,r,r,U,U,U,S,Q,Q,U,U,U,S,Q,Q,U,U,U,S,Q,Q")
   (match_operand:QI 2 "register_mem_operand"
"U,S,Q,r,U,S,Q,U,S,Q,U,S,Q,U,S,Q,U,S,Q,U,S,Q,r,r,r,U,S,Q,S,S,Q,U,S,Q,S,S,Q,U,S,Q,S,S,Q")))]
 ""
 "..."

[( set_attr "length"
"3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3"
)
( set_attr "clobberb"
"no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no"
)])


Is there any suggestions about this "long" constraints?

Thanks!

2010/7/23 Ian Lance Taylor :
> redriver jiang  writes:
>
>> Hi,
>>
>> You mean I should define insn like this:
>>
>> (define_insn "*iorqi3_imm"
>>  [(set (mem:QI (match_operand:HI 0 "register_operand"       "b"))
>>        (ior:QI (mem:QI (match_operand:HI 1 "register_operand"   "b")
>>                      (mem:QI (plus: HI (match_operand:HI 2
>> "register_operand"  "f")
>>                                    (match_operand: 3 HI
>> "immediate_operand" "K")   ]
>> ""
>> "..."
>> [( set_attr "length" "1" )])
>>
>> "b" for R16,R17,R18, and "f" for R18, "K" for immediate operand with
>> range "0-127"?
>
> Sort of, but you shouldn't write the PLUS in the insn.  Instead, write a
> new constraint which accepts either a R16, R17, or R18 plus an offset.
> Also, write the insn with three alternatives, with the offset constraint
> in each position.
>
> Ian
>


Re: Reload problems with only one base reg for "base + offset" addressing mode

2010-07-25 Thread Ian Lance Taylor
redriver jiang  writes:

> But the constrains are really long.

Well, yeah.

> I use "U" for memory operands with address "R18+offset", and "S" for
> memory operands with address "R16" or "R17", and "Q" for memory
> operands with constant address(such as symbol ref, or const_int), the
> all combinations are as more as 43 types, and I have to change
> "MAX_RECOG_ALTERNATIVES" from "30" to be larger constants in
> "recog.h".
>
> (define_insn "*iorqi3_noimm_to_reg"
> [(set(match_operand:QI 0 "register_mem_operand"
> "=r,r,r,r,r,r,r,r,r,r,r,r,r,U,U,U,S,S,S,Q,Q,Q,U,S,Q,U,U,U,U,U,U,S,S,S,S,S,S,Q,Q,Q,Q,Q,Q")
> (ior:QI (match_operand:QI 1 "register_mem_operand"
> "%0,0,0,0,U,U,U,S,S,S,Q,Q,Q,r,r,r,r,r,r,r,r,r,r,r,r,U,U,U,S,Q,Q,U,U,U,S,Q,Q,U,U,U,S,Q,Q")
>  (match_operand:QI 2 "register_mem_operand"
> "U,S,Q,r,U,S,Q,U,S,Q,U,S,Q,U,S,Q,U,S,Q,U,S,Q,r,r,r,U,S,Q,S,S,Q,U,S,Q,S,S,Q,U,S,Q,S,S,Q")))]
>  ""
>  "..."
>
> [( set_attr "length"
> "3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3"
> )
> ( set_attr "clobberb"
> "no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no,no"
> )])
>
>
> Is there any suggestions about this "long" constraints?

My only useful suggestion is that you can say
(set_attr "length" "3")
(set_attr "clobberb" "no")
You don't have to repeat the setting if it is the same for all
alternatives.

Ian


gcc-4.3-20100725 is now available

2010-07-25 Thread gccadmin
Snapshot gcc-4.3-20100725 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.3-20100725/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.3 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch 
revision 162521

You'll find:

gcc-4.3-20100725.tar.bz2  Complete GCC (includes all of below)

gcc-core-4.3-20100725.tar.bz2 C front end and core compiler

gcc-ada-4.3-20100725.tar.bz2  Ada front end and runtime

gcc-fortran-4.3-20100725.tar.bz2  Fortran front end and runtime

gcc-g++-4.3-20100725.tar.bz2  C++ front end and runtime

gcc-java-4.3-20100725.tar.bz2 Java front end and runtime

gcc-objc-4.3-20100725.tar.bz2 Objective-C front end and runtime

gcc-testsuite-4.3-20100725.tar.bz2The GCC testsuite

Diffs from 4.3-20100718 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.3
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.