9 #ifndef FIRM_BE_RISCV_GEN_RISCV_NEW_NODES_H
10 #define FIRM_BE_RISCV_GEN_RISCV_NEW_NODES_H
14 #include "riscv_nodes_attr.h"
16 typedef enum riscv_opcodes {
62 int is_riscv_irn(
const ir_node *node);
63 int is_riscv_op(
const ir_op *op);
65 int get_riscv_irn_opcode(
const ir_node *node);
66 void riscv_create_opcodes(
void);
67 void riscv_free_opcodes(
void);
69 extern ir_op *op_riscv_add;
71 static inline bool is_riscv_add(
ir_node const *
const n)
81 extern ir_op *op_riscv_addi;
83 static inline bool is_riscv_addi(
ir_node const *
const n)
93 extern ir_op *op_riscv_and;
95 static inline bool is_riscv_and(
ir_node const *
const n)
105 extern ir_op *op_riscv_andi;
107 static inline bool is_riscv_andi(
ir_node const *
const n)
117 extern ir_op *op_riscv_bcc;
119 static inline bool is_riscv_bcc(
ir_node const *
const n)
129 extern ir_op *op_riscv_div;
131 static inline bool is_riscv_div(
ir_node const *
const n)
141 extern ir_op *op_riscv_divu;
143 static inline bool is_riscv_divu(
ir_node const *
const n)
153 extern ir_op *op_riscv_ijmp;
155 static inline bool is_riscv_ijmp(
ir_node const *
const n)
165 extern ir_op *op_riscv_j;
167 static inline bool is_riscv_j(
ir_node const *
const n)
177 extern ir_op *op_riscv_jal;
179 static inline bool is_riscv_jal(
ir_node const *
const n)
187 ir_node *new_bd_riscv_jal(
dbg_info *dbgi,
ir_node *block,
int const arity,
ir_node *
const *
const in, arch_register_req_t
const **
const in_reqs,
int n_res,
ir_entity *
const ent, int32_t
const val);
189 extern ir_op *op_riscv_jalr;
191 static inline bool is_riscv_jalr(
ir_node const *
const n)
199 ir_node *new_bd_riscv_jalr(
dbg_info *dbgi,
ir_node *block,
int const arity,
ir_node *
const *
const in, arch_register_req_t
const **
const in_reqs,
int n_res);
201 extern ir_op *op_riscv_lb;
203 static inline bool is_riscv_lb(
ir_node const *
const n)
213 extern ir_op *op_riscv_lbu;
215 static inline bool is_riscv_lbu(
ir_node const *
const n)
225 extern ir_op *op_riscv_lh;
227 static inline bool is_riscv_lh(
ir_node const *
const n)
237 extern ir_op *op_riscv_lhu;
239 static inline bool is_riscv_lhu(
ir_node const *
const n)
249 extern ir_op *op_riscv_lui;
251 static inline bool is_riscv_lui(
ir_node const *
const n)
261 extern ir_op *op_riscv_lw;
263 static inline bool is_riscv_lw(
ir_node const *
const n)
273 extern ir_op *op_riscv_mul;
275 static inline bool is_riscv_mul(
ir_node const *
const n)
285 extern ir_op *op_riscv_mulh;
287 static inline bool is_riscv_mulh(
ir_node const *
const n)
297 extern ir_op *op_riscv_mulhu;
299 static inline bool is_riscv_mulhu(
ir_node const *
const n)
309 extern ir_op *op_riscv_or;
311 static inline bool is_riscv_or(
ir_node const *
const n)
321 extern ir_op *op_riscv_ori;
323 static inline bool is_riscv_ori(
ir_node const *
const n)
333 extern ir_op *op_riscv_rem;
335 static inline bool is_riscv_rem(
ir_node const *
const n)
345 extern ir_op *op_riscv_remu;
347 static inline bool is_riscv_remu(
ir_node const *
const n)
357 extern ir_op *op_riscv_ret;
359 static inline bool is_riscv_ret(
ir_node const *
const n)
367 ir_node *new_bd_riscv_ret(
dbg_info *dbgi,
ir_node *block,
int const arity,
ir_node *
const *
const in, arch_register_req_t
const **
const in_reqs);
369 extern ir_op *op_riscv_sb;
371 static inline bool is_riscv_sb(
ir_node const *
const n)
381 extern ir_op *op_riscv_sh;
383 static inline bool is_riscv_sh(
ir_node const *
const n)
393 extern ir_op *op_riscv_sll;
395 static inline bool is_riscv_sll(
ir_node const *
const n)
405 extern ir_op *op_riscv_slli;
407 static inline bool is_riscv_slli(
ir_node const *
const n)
417 extern ir_op *op_riscv_slt;
419 static inline bool is_riscv_slt(
ir_node const *
const n)
429 extern ir_op *op_riscv_sltiu;
431 static inline bool is_riscv_sltiu(
ir_node const *
const n)
441 extern ir_op *op_riscv_sltu;
443 static inline bool is_riscv_sltu(
ir_node const *
const n)
453 extern ir_op *op_riscv_sra;
455 static inline bool is_riscv_sra(
ir_node const *
const n)
465 extern ir_op *op_riscv_srai;
467 static inline bool is_riscv_srai(
ir_node const *
const n)
477 extern ir_op *op_riscv_srl;
479 static inline bool is_riscv_srl(
ir_node const *
const n)
489 extern ir_op *op_riscv_srli;
491 static inline bool is_riscv_srli(
ir_node const *
const n)
501 extern ir_op *op_riscv_sub;
503 static inline bool is_riscv_sub(
ir_node const *
const n)
513 extern ir_op *op_riscv_sw;
515 static inline bool is_riscv_sw(
ir_node const *
const n)
525 extern ir_op *op_riscv_switch;
527 static inline bool is_riscv_switch(
ir_node const *
const n)
537 extern ir_op *op_riscv_xor;
539 static inline bool is_riscv_xor(
ir_node const *
const n)
549 extern ir_op *op_riscv_xori;
551 static inline bool is_riscv_xori(
ir_node const *
const n)
562 typedef enum pn_riscv_add {
563 pn_riscv_add_res = 0,
566 typedef enum n_riscv_add {
567 n_riscv_add_left = 0,
568 n_riscv_add_right = 1,
571 typedef enum pn_riscv_addi {
572 pn_riscv_addi_res = 0,
575 typedef enum n_riscv_addi {
576 n_riscv_addi_left = 0,
579 typedef enum pn_riscv_and {
580 pn_riscv_and_res = 0,
583 typedef enum n_riscv_and {
584 n_riscv_and_left = 0,
585 n_riscv_and_right = 1,
588 typedef enum pn_riscv_andi {
589 pn_riscv_andi_res = 0,
592 typedef enum n_riscv_andi {
593 n_riscv_andi_left = 0,
596 typedef enum pn_riscv_bcc {
597 pn_riscv_bcc_false = 0,
598 pn_riscv_bcc_true = 1,
601 typedef enum n_riscv_bcc {
602 n_riscv_bcc_left = 0,
603 n_riscv_bcc_right = 1,
606 typedef enum pn_riscv_div {
607 pn_riscv_div_res = 0,
610 typedef enum n_riscv_div {
611 n_riscv_div_left = 0,
612 n_riscv_div_right = 1,
615 typedef enum pn_riscv_divu {
616 pn_riscv_divu_res = 0,
619 typedef enum n_riscv_divu {
620 n_riscv_divu_left = 0,
621 n_riscv_divu_right = 1,
624 typedef enum pn_riscv_jal {
626 pn_riscv_jal_stack = 1,
627 pn_riscv_jal_first_result = 2,
630 typedef enum n_riscv_jal {
632 n_riscv_jal_stack = 1,
633 n_riscv_jal_first_argument = 2,
636 typedef enum pn_riscv_jalr {
638 pn_riscv_jalr_stack = 1,
639 pn_riscv_jalr_first_result = 2,
642 typedef enum n_riscv_jalr {
643 n_riscv_jalr_mem = 0,
644 n_riscv_jalr_stack = 1,
645 n_riscv_jalr_first_argument = 2,
648 typedef enum pn_riscv_lb {
653 typedef enum n_riscv_lb {
658 typedef enum pn_riscv_lbu {
660 pn_riscv_lbu_res = 1,
663 typedef enum n_riscv_lbu {
665 n_riscv_lbu_base = 1,
668 typedef enum pn_riscv_lh {
673 typedef enum n_riscv_lh {
678 typedef enum pn_riscv_lhu {
680 pn_riscv_lhu_res = 1,
683 typedef enum n_riscv_lhu {
685 n_riscv_lhu_base = 1,
688 typedef enum pn_riscv_lui {
689 pn_riscv_lui_res = 0,
692 typedef enum pn_riscv_lw {
697 typedef enum n_riscv_lw {
702 typedef enum pn_riscv_mul {
703 pn_riscv_mul_res = 0,
706 typedef enum n_riscv_mul {
707 n_riscv_mul_left = 0,
708 n_riscv_mul_right = 1,
711 typedef enum pn_riscv_mulh {
712 pn_riscv_mulh_res = 0,
715 typedef enum n_riscv_mulh {
716 n_riscv_mulh_left = 0,
717 n_riscv_mulh_right = 1,
720 typedef enum pn_riscv_mulhu {
721 pn_riscv_mulhu_res = 0,
724 typedef enum n_riscv_mulhu {
725 n_riscv_mulhu_left = 0,
726 n_riscv_mulhu_right = 1,
729 typedef enum pn_riscv_or {
733 typedef enum n_riscv_or {
735 n_riscv_or_right = 1,
738 typedef enum pn_riscv_ori {
739 pn_riscv_ori_res = 0,
742 typedef enum n_riscv_ori {
743 n_riscv_ori_left = 0,
746 typedef enum pn_riscv_rem {
747 pn_riscv_rem_res = 0,
750 typedef enum n_riscv_rem {
751 n_riscv_rem_left = 0,
752 n_riscv_rem_right = 1,
755 typedef enum pn_riscv_remu {
756 pn_riscv_remu_res = 0,
759 typedef enum n_riscv_remu {
760 n_riscv_remu_left = 0,
761 n_riscv_remu_right = 1,
764 typedef enum n_riscv_ret {
766 n_riscv_ret_stack = 1,
767 n_riscv_ret_addr = 2,
768 n_riscv_ret_first_result = 3,
771 typedef enum pn_riscv_sb {
775 typedef enum n_riscv_sb {
778 n_riscv_sb_value = 2,
781 typedef enum pn_riscv_sh {
785 typedef enum n_riscv_sh {
788 n_riscv_sh_value = 2,
791 typedef enum pn_riscv_sll {
792 pn_riscv_sll_res = 0,
795 typedef enum n_riscv_sll {
796 n_riscv_sll_left = 0,
797 n_riscv_sll_right = 1,
800 typedef enum pn_riscv_slli {
801 pn_riscv_slli_res = 0,
804 typedef enum n_riscv_slli {
805 n_riscv_slli_left = 0,
808 typedef enum pn_riscv_slt {
809 pn_riscv_slt_res = 0,
812 typedef enum n_riscv_slt {
813 n_riscv_slt_left = 0,
814 n_riscv_slt_right = 1,
817 typedef enum pn_riscv_sltiu {
818 pn_riscv_sltiu_res = 0,
821 typedef enum n_riscv_sltiu {
822 n_riscv_sltiu_left = 0,
825 typedef enum pn_riscv_sltu {
826 pn_riscv_sltu_res = 0,
829 typedef enum n_riscv_sltu {
830 n_riscv_sltu_left = 0,
831 n_riscv_sltu_right = 1,
834 typedef enum pn_riscv_sra {
835 pn_riscv_sra_res = 0,
838 typedef enum n_riscv_sra {
839 n_riscv_sra_left = 0,
840 n_riscv_sra_right = 1,
843 typedef enum pn_riscv_srai {
844 pn_riscv_srai_res = 0,
847 typedef enum n_riscv_srai {
848 n_riscv_srai_left = 0,
851 typedef enum pn_riscv_srl {
852 pn_riscv_srl_res = 0,
855 typedef enum n_riscv_srl {
856 n_riscv_srl_left = 0,
857 n_riscv_srl_right = 1,
860 typedef enum pn_riscv_srli {
861 pn_riscv_srli_res = 0,
864 typedef enum n_riscv_srli {
865 n_riscv_srli_left = 0,
868 typedef enum pn_riscv_sub {
869 pn_riscv_sub_res = 0,
872 typedef enum n_riscv_sub {
873 n_riscv_sub_left = 0,
874 n_riscv_sub_right = 1,
877 typedef enum pn_riscv_sw {
881 typedef enum n_riscv_sw {
884 n_riscv_sw_value = 2,
887 typedef enum pn_riscv_xor {
888 pn_riscv_xor_res = 0,
891 typedef enum n_riscv_xor {
892 n_riscv_xor_left = 0,
893 n_riscv_xor_right = 1,
896 typedef enum pn_riscv_xori {
897 pn_riscv_xori_res = 0,
900 typedef enum n_riscv_xori {
901 n_riscv_xori_left = 0,
struct dbg_info dbg_info
Source Reference.
struct ir_node ir_node
Procedure Graph Node.
struct ir_switch_table ir_switch_table
A switch table mapping integer numbers to proj-numbers of a Switch-node.
struct ir_entity ir_entity
Entity.
ir_op * get_irn_op(const ir_node *node)
Returns the opcode struct of the node.
struct ir_op ir_op
Node Opcode.