I forget to thank you for your help. But if I do write your code how compiler knows that it should be put two instructions instead immediate shift?
I write this piese of code: ###############################################################33 (define_insn "lshrsi3" [(set (match_operand:SI 0 "register_operand" "=d") (lshiftrt:SI (match_operand:SI 1 "register_operand" "d") (match_operand:SI 2 "arith_operand" "dI"))) (clobber(match_scratch:SI 3 "=&d"))] "" "* { if (GET_CODE (operands[2]) == CONST_INT) operands[2] = gen_rtx (CONST_INT, VOIDmode, (XINT (operands[2], 0))& 0x1f); operands[4] = gen_rtx (REG, VOIDmode, 0); return \"add\\t%3,%4,%z2;srl\\t%0,%1,%3\"; }" [(set_attr "type" "arith") (set_attr "mode" "SI") (set_attr "length" "1")]) ################################################################ Is there any other solutions? Best Regards, yazdanbakhsh wrote: > > Is it any way that we can chat? > I'm working on my thesis project and a paper. I appreciate it if you would > cooperate in this project. > I have gmail Id "amir.yazdanbakhsh" > and also skype "amir.yazdanbakhsh" > > best regards, > > yazdanbakhsh wrote: >> >> Hi, >> >> Please assume I'm working with the MIPS. There is a little difference >> between the MIPS and what I'm actually working on it. How can I remove >> immediate logical shift right/left from the compiler? >> I mean If I want the programmer writes an immediate shift, It is compiled >> to the two instructions: >> >> sll %2,%2,5 >> >> changed to: >> >> addi %3,%0,5 >> sllv %2,%2,%3 >> >> thanks in advance >> >> Ian Lance Taylor-3 wrote: >>> >>> yazdanbakhsh <amir.yazdanbak...@gmail.com> writes: >>> >>>> I'm working on my a gcc compiler for my own written processor with the >>>> help >>>> of SimpleScalar. >>>> I want to remove "srav/slav" (immediate arithmetic shift) from the >>>> instruction set. I explore ss.md file but I didn't see any define_ins >>>> for >>>> the mentioned instructions, but they are used in other instruction >>>> definitions. >>>> It is also exist for addi/addui. Where I can find the definitions of >>>> these >>>> instructions? I want to force gcc to just use register shift and >>>> register >>>> add. >>> >>> There is no ss.md file in the standard gcc distribution. If >>> SimpleScalar has a gcc port, I don't know anything about it. So it's >>> hard to answer to your question precisely. >>> >>> Instructions can come from either a .md file or a .c file in the >>> config/CPU directory used for your CPU. If those instructions are >>> appearing in the generated assembler, then they must be in there >>> somewhere. >>> >>> Ian >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/Question-about-Machine-Description-tp1026428p28440002.html Sent from the gcc - Dev mailing list archive at Nabble.com.