This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Modifying ARM code generator for elimination of 8bit writes - need help


Rask,

On Thursday 01 June 2006 16:13, Rask Ingemann Lambertsen wrote:
> I think you will need to remove the '+' as already suggested and add
> (clobber (match_scratch:QI "=X,X,X,1")) to tell GCC that the register
> allocated to operand 1 is clobbered by the instruction for this
> particular alternative.

Using 

(define_insn "*arm_movqi_insn"
  [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,r,m")
	(match_operand:QI 1 "general_operand" "rI,K,m,r"))
	(clobber (match_scratch:QI 2 "=X,X,X,1"))]
  "TARGET_ARM
   && (   register_operand (operands[0], QImode)
       || register_operand (operands[1], QImode))"
  "@
   mov%?\\t%0, %1
   mvn%?\\t%0, #%B1
   ldr%?b\\t%0, %1
   str%?b\\t%1, %0"
  [(set_attr "type" "*,*,load1,store1")
   (set_attr "predicable" "yes")]
)

(_only_ adding the clobber statement),
I get

> /data1/home/wolfgang/Projekte/DSO/devkitpro/buildscripts/newlib-1.14.
>0/newlib/li bc/argz/argz_create_sep.c: In function 'argz_create_sep':
> /data1/home/wolfgang/Projekte/DSO/devkitpro/buildscripts/newlib-1.14.
>0/newlib/li bc/argz/argz_create_sep.c:60: error: unrecognizable insn:
> (insn 192 21 24 0
> /data1/home/wolfgang/Projekte/DSO/devkitpro/buildscripts/newli
> b-1.14.0/newlib/libc/argz/argz_create_sep.c:29 (set (reg:QI 1 r1)
> (reg:QI 4 r4)) -1 (nil)
>     (nil))
> /data1/home/wolfgang/Projekte/DSO/devkitpro/buildscripts/newlib-1.14.
>0/newlib/li bc/argz/argz_create_sep.c:60: internal compiler error: in
> extract_insn, at recog .c:2020

What do you mean with

> You will also have to modify any code which 
> expands this pattern accordingly.

I will use this weekend to digg deeper into the documentation...

thank you for your help so far...

Wolfgang
-- 
We're back to the times when men were men 
and wrote their own device drivers.

(Linus Torvalds)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]