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: inserting insn's into insn chain


Sorry about the formatting in the original posting. Hopefully this looks 
better:


      tmp_reg_rtx = gen_reg_rtx (SImode);

      new_insn = emit_insn_before (
				   gen_rtx (SET, SImode,
					    tmp_reg_rtx,
					    gen_rtx (REG, SImode,
						     8
						     )
					    )
				   , insn);
      
      // Construct PARALLEL rtx from rtvec and use it to put call insn in chain
      new_insn = emit_insn_before (
				   gen_rtx (PARALLEL, VOIDmode, 
					    gen_rtvec (2, 
						       gen_rtx (SET, VOIDmode,
								gen_rtx (REG, SImode,
									 0
									 ),
								gen_rtx (CALL, VOIDmode,
									 gen_rtx (MEM, SImode,
										  gen_rtx (SYMBOL_REF, SImode,
											   func_name
											   ),
										  0
										  ),
									 gen_rtx (CONST_INT, VOIDmode,
										  0
										  )
									 )
								),
						       gen_rtx (CLOBBER, VOIDmode,
								gen_rtx (REG, SImode, 
									 15
									 )
								)
						       ))						 
				   , insn);

      new_insn = emit_insn_before (
				   gen_rtx (SET, SImode,
					    gen_rtx (REG, SImode,
						     8
						     ),
					    copy_rtx (tmp_reg_rtx)
					    )
				   , insn);

    }




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