public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* A problem with one instruction multiple latencies and pipelines
@ 2020-09-07  6:08 Qian, Jianhua
  2020-09-07  7:40 ` Richard Biener
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Qian, Jianhua @ 2020-09-07  6:08 UTC (permalink / raw)
  To: gcc

Hi

I'm adding a new machine model. I have a problem when writing the "define_insn_reservation" for instruction scheduling.
How to write the "define_insn_reservation" for one instruction that there are different latencies and pipelines according to parameter.

For example, the ADD (shifted register) instruction in a64fx

Instruction            Option                             Latency    Pipeline
ADD (shifted register)  <amount> = 0                     1          EX* | EAG*
                      <amount> = [1-4] && <shift>=LSL  1+1       (EXA + EXA) | (EXB + EXB)
                                                         2+1       (EXA + EXA) | (EXB + EXB)

In aarch64.md ADD (shifted register) instruction is defined as following.
 (define_insn "*add_<shift>_<mode>"
  [(set (match_operand:GPI 0 "register_operand" "=r")
        (plus:GPI (ASHIFT:GPI (match_operand:GPI 1 "register_operand" "r")
                              (match_operand:QI 2 "aarch64_shift_imm_<mode>" "n"))
                  (match_operand:GPI 3 "register_operand" "r")))]
  ""
  "add\\t%<w>0, %<w>3, %<w>1, <shift> %2"
  [(set_attr "type" "alu_shift_imm")]
)

It could not be distinguished by the type "alu_shift_imm" when writing "define_insn_reservation" for ADD (shifted register). 
What should I do?

Regards
Qian




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-09-14 22:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07  6:08 A problem with one instruction multiple latencies and pipelines Qian, Jianhua
2020-09-07  7:40 ` Richard Biener
2020-09-07  8:45   ` Qian, Jianhua
2020-09-07 11:58     ` Richard Biener
2020-09-07 20:20 ` Richard Sandiford
2020-09-08  5:34   ` Qian, Jianhua
2020-09-09 21:22   ` Segher Boessenkool
2020-09-10  5:01     ` Qian, Jianhua
2020-09-10 10:04     ` Richard Sandiford
2020-09-10 23:00       ` Segher Boessenkool
2020-09-11  7:44         ` Richard Sandiford
2020-09-11 13:58           ` Segher Boessenkool
2020-09-14  5:41             ` Qian, Jianhua
2020-09-14  9:55               ` Richard Sandiford
2020-09-14 18:41                 ` Segher Boessenkool
2020-09-14 19:35                   ` Richard Sandiford
2020-09-14 22:14                     ` Segher Boessenkool
2020-09-11 13:30 ` Richard Earnshaw
2020-09-14  2:53   ` Qian, Jianhua
2020-09-14  9:08     ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).