public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Adding log files to gcc dump and adding testcase-rtl
@ 2022-05-25  4:55 RICHU NORMAN
  2022-05-25 10:44 ` David Malcolm
  0 siblings, 1 reply; 5+ messages in thread
From: RICHU NORMAN @ 2022-05-25  4:55 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

Hi,
I am a beginner in gcc. I am trying to add an instruction to riscv-gcc.It
would be helpful could help with a few tips .
1.How to write comments to rtl or create a custom log file to log comments
to rtl dump?
2.How to run testsuite ?
3.Is there a way to directly run an rtl test case? Like giving rtl input
and checking the generated asm.(Like in the attachment which is posted in
bugzilla[ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82815 ])
Please suggest a way to run the gcc-testsuite with these cases. Pfa



-- 
Richu Norman
Research Scholar
Department of Computer Science
Cochin University of Science and Technology
Ph : (+91)-8848455627

[-- Attachment #2: testcase_read-rtl.c --]
[-- Type: text/x-c-code, Size: 3109 bytes --]

/* { dg-do compile } */
/* { dg-options "-march=armv7e-m -mfloat-abi=hard -mfpu=fpv5-d16" } */

double __RTL (startwith ("mach")) foo (void)
{
(function "foo"
  (insn-chain
    (cnote 1 NOTE_INSN_DELETED)
    (cnote 3 [bb 2] NOTE_INSN_BASIC_BLOCK)
    (cinsn/f 16 (parallel [
                    (set (mem/c:BLK (pre_modify:SI (reg/f:SI sp)
                                (plus:SI (reg/f:SI sp)
                                    (const_int -8))) [1  A8])
                        (unspec:BLK [
                                (reg:SI r4)
                            ] UNSPEC_PUSH_MULT))
                    (use (reg/f:SI r7))
                ]) "foo.c":2
             (expr_list:REG_FRAME_RELATED_EXPR (sequence [
                        (set/f (reg/f:SI sp)
                            (plus:SI (reg/f:SI sp)
                                (const_int -8)))
                        (set/f (mem/c:SI (reg/f:SI sp) [1  S4 A32])
                            (reg:SI r4))
                        (set/f (mem/c:SI (plus:SI (reg/f:SI sp)
                                    (const_int 4)) [1  S4 A32])
                            (reg/f:SI r7))
                    ])))
    (cinsn/f 17 (set (reg/f:SI r7)
                (plus:SI (reg/f:SI sp)
                    (const_int 0))) "foo.c":2)
    (cnote 18 NOTE_INSN_PROLOGUE_END)
    (cnote 2 NOTE_INSN_FUNCTION_BEG)
    (cinsn 5 (set (reg:DF r3 [orig:110 _1 ] [110])
                (const_double:DF 1.0e+0 [0x0.8p+1])) "foo.c":3)
    (cinsn 8 (set (reg:DF s14 [orig:111 <retval> ] [111])
                (reg:DF r3 [orig:110 _1 ] [110])) "foo.c":3)
    (cinsn 12 (set (reg/i:DF s0)
                (reg:DF s14 [orig:111 <retval> ] [111])) "foo.c":4)
    (cinsn 13 (use (reg/i:DF s0)) "foo.c":4)
    (cnote 19 NOTE_INSN_EPILOGUE_BEG)
    (cinsn 20 (unspec_volatile [
                    (const_int 0)
                ] VUNSPEC_BLOCKAGE) "foo.c":4)
    (cinsn/f 21 (set (reg/f:SI sp)
                (reg/f:SI r7)) "foo.c":4
             (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI sp)
                    (reg/f:SI r7))))
    (cinsn 22 (unspec:SI [
                    (reg/f:SI sp)
                ] UNSPEC_REGISTER_USE) "foo.c":4)
    (cinsn/f 23 (parallel [
                    (set/f (reg/f:SI sp)
                        (plus:SI (reg/f:SI sp)
                            (const_int 8)))
                    (set/f (reg:SI r4)
                        (mem/c:SI (reg/f:SI sp) [1  S4 A32]))
                    (set/f (reg/f:SI r7)
                        (mem/c:SI (plus:SI (reg/f:SI sp)
                                (const_int 4)) [1  S4 A32]))
                ]) "foo.c":4
             (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI sp)
                    (plus:SI (reg/f:SI sp)
                        (const_int 8)))
                (expr_list:REG_CFA_RESTORE (reg/f:SI r7)
                    (expr_list:REG_CFA_RESTORE (reg:SI r4)))))
    (cjump_insn 24 (simple_return) "foo.c":4)
    (cbarrier 25)
    (cnote 15 NOTE_INSN_DELETED)
  ) ;; insn-chain
  (crtl
    (return_rtx 
      (reg/i:DF s0)
    ) ;; return_rtx
  ) ;; crtl
) ;; function "foo"
}

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

end of thread, other threads:[~2022-05-25 12:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25  4:55 Adding log files to gcc dump and adding testcase-rtl RICHU NORMAN
2022-05-25 10:44 ` David Malcolm
2022-05-25 10:54   ` David Malcolm
2022-05-25 11:02   ` RICHU NORMAN
2022-05-25 12:39     ` David Malcolm

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).