Home
last modified time | relevance | path

Searched refs:insn (Results 1 – 23 of 23) sorted by relevance

/illumos-gate/usr/src/tools/smatch/src/
H A Dsimplify.c78 static int get_phisources(struct instruction *sources[], int nbr, struct instruction *insn) in get_phisources() argument
83 assert(insn->opcode == OP_PHI); in get_phisources()
84 FOR_EACH_PTR(insn->phi_list, phi) { in get_phisources()
97 static int if_convert_phi(struct instruction *insn) in if_convert_phi() argument
105 bb = insn->bb; in if_convert_phi()
106 if (get_phisources(array, 2, insn)) in if_convert_phi()
170 insert_select(source, br, insn, p1, p2); in if_convert_phi()
171 kill_instruction(insn); in if_convert_phi()
188 static pseudo_t trivial_phi(pseudo_t pseudo, struct instruction *insn, struct pseudo_list **list) in trivial_phi() argument
190 pseudo_t target = insn->target; in trivial_phi()
[all …]
H A Dir.c9 static int nbr_phi_operands(struct instruction *insn) in nbr_phi_operands() argument
14 if (!insn->phi_list) in nbr_phi_operands()
17 FOR_EACH_PTR(insn->phi_list, p) { in nbr_phi_operands()
26 static int check_phi_node(struct instruction *insn) in check_phi_node() argument
32 if (!has_users(insn->target)) in check_phi_node()
35 if (bb_list_size(insn->bb->parents) != nbr_phi_operands(insn)) { in check_phi_node()
36 sparse_error(insn->pos, "bad number of phi operands in:\n\t%s", in check_phi_node()
37 show_instruction(insn)); in check_phi_node()
38 info(insn->pos, "parents: %d", bb_list_size(insn->bb->parents)); in check_phi_node()
39 info(insn->pos, "phisrcs: %d", nbr_phi_operands(insn)); in check_phi_node()
[all …]
H A Dssa.c77 struct instruction *insn; in insn_before() local
80 FOR_EACH_PTR(bb->insns, insn) { in insn_before()
81 if (insn == a) in insn_before()
83 if (insn == b) in insn_before()
85 } END_FOR_EACH_PTR(insn); in insn_before()
89 static void kill_store(struct instruction *insn) in kill_store() argument
91 remove_use(&insn->src); in kill_store()
92 remove_use(&insn->target); in kill_store()
93 insn->bb = NULL; in kill_store()
98 struct instruction *insn; in rewrite_local_var() local
[all …]
H A Dflow.c57 struct instruction *insn = pseudo->def; in pseudo_truth_value() local
60 if (insn->opcode == OP_SYMADDR && insn->target == pseudo) in pseudo_truth_value()
93 struct instruction *insn; in bb_depends_on_phi() local
94 FOR_EACH_PTR(src->insns, insn) { in bb_depends_on_phi()
95 if (!insn->bb) in bb_depends_on_phi()
97 if (insn->opcode != OP_PHI) in bb_depends_on_phi()
99 if (pseudo_in_list(target->needs, insn->target)) in bb_depends_on_phi()
101 } END_FOR_EACH_PTR(insn); in bb_depends_on_phi()
165 struct instruction *insn; in bb_has_side_effects() local
166 FOR_EACH_PTR(bb->insns, insn) { in bb_has_side_effects()
[all …]
H A Dsparse-llvm.c221 static LLVMTypeRef insn_symbol_type(struct instruction *insn) in insn_symbol_type() argument
223 if (insn->type) in insn_symbol_type()
224 return symbol_type(insn->type); in insn_symbol_type()
226 switch (insn->size) { in insn_symbol_type()
233 die("invalid bit size %d", insn->size); in insn_symbol_type()
534 static void output_op_binary(struct function *fn, struct instruction *insn) in output_op_binary() argument
539 lhs = get_ioperand(fn, insn->type, insn->src1); in output_op_binary()
540 rhs = get_ioperand(fn, insn->type, insn->src2); in output_op_binary()
542 pseudo_name(insn->target, target_name); in output_op_binary()
544 switch (insn->opcode) { in output_op_binary()
[all …]
H A Dmemops.c19 static int find_dominating_parents(pseudo_t pseudo, struct instruction *insn, in find_dominating_parents() argument
34 if (one == insn) in find_dominating_parents()
36 dominance = dominates(pseudo, insn, one, local); in find_dominating_parents()
51 if (!find_dominating_parents(pseudo, insn, parent, generation, dominators, local)) in find_dominating_parents()
60 use_pseudo(insn, phi, add_pseudo(dominators, phi)); in find_dominating_parents()
69 struct instruction *insn = pu->insn; in address_taken() local
70 if (insn->bb && (insn->opcode != OP_LOAD && insn->opcode != OP_STORE)) in address_taken()
72 if (pu->userp != &insn->src) in address_taken()
87 struct instruction *insn; in simplify_loads() local
89 FOR_EACH_PTR_REVERSE(bb->insns, insn) { in simplify_loads()
[all …]
H A Dsparse.c46 struct instruction *insn; in context_increase() local
48 FOR_EACH_PTR(bb->insns, insn) { in context_increase()
50 if (!insn->bb) in context_increase()
52 if (insn->opcode != OP_CONTEXT) in context_increase()
54 val = insn->increment; in context_increase()
55 if (insn->check) { in context_increase()
62 warning(insn->pos, "context check failure"); in context_increase()
66 } END_FOR_EACH_PTR(insn); in context_increase()
83 struct instruction *insn; in check_children() local
86 insn = last_instruction(bb->insns); in check_children()
[all …]
H A Dgraph.c47 struct instruction *insn; in graph_ep() local
76 FOR_EACH_PTR(bb->insns, insn) { in graph_ep()
77 if (!insn->bb) in graph_ep()
79 switch(insn->opcode) { in graph_ep()
81 if (insn->src->type == PSEUDO_SYM) { in graph_ep()
82 printf("%s store(%s)", s, show_ident(insn->src->sym->ident)); in graph_ep()
88 if (insn->src->type == PSEUDO_SYM) { in graph_ep()
89 printf("%s load(%s)", s, show_ident(insn->src->sym->ident)); in graph_ep()
99 } END_FOR_EACH_PTR(insn); in graph_ep()
123 struct instruction *insn; in graph_calls() local
[all …]
H A Dcse.c38 void cse_collect(struct instruction *insn) in cse_collect() argument
42 hash = (insn->opcode << 3) + (insn->size >> 3); in cse_collect()
43 switch (insn->opcode) { in cse_collect()
45 hash += hashval(insn->src3); in cse_collect()
73 hash += hashval(insn->src2); in cse_collect()
80 hash += hashval(insn->src1); in cse_collect()
84 hash += hashval(insn->val); in cse_collect()
88 hash += hashval(insn->fvalue); in cse_collect()
95 if (!insn->orig_type || insn->orig_type->bit_size < 0) in cse_collect()
97 hash += hashval(insn->src); in cse_collect()
[all …]
H A Dliveness.c31 static void asm_liveness(struct basic_block *bb, struct instruction *insn, in asm_liveness() argument
37 FOR_EACH_PTR(insn->asm_rules->inputs, entry) { in asm_liveness()
41 FOR_EACH_PTR(insn->asm_rules->outputs, entry) { in asm_liveness()
46 static void track_instruction_usage(struct basic_block *bb, struct instruction *insn, in track_instruction_usage() argument
52 #define USES(x) use(bb, insn->x) in track_instruction_usage()
53 #define DEFINES(x) def(bb, insn->x) in track_instruction_usage()
55 switch (insn->opcode) { in track_instruction_usage()
100 phi_defines(insn, insn->target, def); in track_instruction_usage()
113 if (insn->target != VOID) in track_instruction_usage()
115 FOR_EACH_PTR(insn->arguments, pseudo) { in track_instruction_usage()
[all …]
H A Dlinearize.c47 struct instruction * insn = __alloc_instruction(0); in alloc_instruction() local
48 insn->opcode = opcode; in alloc_instruction()
49 insn->size = size; in alloc_instruction()
50 insn->pos = current_pos; in alloc_instruction()
51 return insn; in alloc_instruction()
61 struct instruction *insn = alloc_instruction(opcode, type_size(type)); in alloc_typed_instruction() local
62 insn->type = type; in alloc_typed_instruction()
63 return insn; in alloc_typed_instruction()
297 static char *show_asm(char *buf, struct instruction *insn) in show_asm() argument
299 struct asm_rules *rules = insn->asm_rules; in show_asm()
[all …]
H A Dexample.c886 static void do_binop(struct bb_state *state, struct instruction *insn, pseudo_t val1, pseudo_t val2) in do_binop() argument
888 const char *op = opcodes[insn->opcode]; in do_binop()
889 struct operand *src = get_register_operand(state, val1, insn->target); in do_binop()
893 dst = target_copy_reg(state, src->reg, insn->target); in do_binop()
894 output_insn(state, "%s.%d %s,%s", op, insn->size, show_op(state, src2), dst->name); in do_binop()
897 add_pseudo_reg(state, insn->target, dst); in do_binop()
900 static void generate_binop(struct bb_state *state, struct instruction *insn) in generate_binop() argument
903 do_binop(state, insn, insn->src1, insn->src2); in generate_binop()
921 static void generate_commutative_binop(struct bb_state *state, struct instruction *insn) in generate_commutative_binop() argument
927 src1 = insn->src1; in generate_commutative_binop()
[all …]
H A Dunssa.c56 use_pseudo(pu->insn, tmp, pu->userp); in simplify_phi_node()
94 struct instruction *insn; in replace_phi_node() local
96 insn = src->def; in replace_phi_node()
97 if (!insn) in replace_phi_node()
99 insn->target = tmp; in replace_phi_node()
119 struct instruction *insn; in rewrite_phi_bb() local
124 FOR_EACH_PTR(bb->insns, insn) { in rewrite_phi_bb()
125 if (!insn->bb) in rewrite_phi_bb()
127 if (insn->opcode != OP_PHI) in rewrite_phi_bb()
129 replace_phi_node(insn); in rewrite_phi_bb()
[all …]
H A Dflow.h22 extern void convert_instruction_target(struct instruction *insn, pseudo_t src);
32 static inline int kill_instruction(struct instruction *insn) in kill_instruction() argument
34 return kill_insn(insn, 0); in kill_instruction()
36 static inline int kill_instruction_force(struct instruction *insn) in kill_instruction_force() argument
38 return kill_insn(insn, 1); in kill_instruction_force()
41 void check_access(struct instruction *insn);
44 int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom, int local);
H A Dlinearize.h15 struct instruction *insn; member
191 static inline void add_instruction(struct instruction_list **list, struct instruction *insn) in add_instruction() argument
193 add_ptr_list(list, insn); in add_instruction()
218 struct instruction *insn; in bb_terminated() local
221 insn = last_instruction(bb->insns); in bb_terminated()
222 return insn && insn->opcode >= OP_TERMINATOR in bb_terminated()
223 && insn->opcode <= OP_TERMINATOR_END; in bb_terminated()
272 static inline struct pseudo_user *alloc_pseudo_user(struct instruction *insn, pseudo_t *pp) in alloc_pseudo_user() argument
276 user->insn = insn; in alloc_pseudo_user()
280 static inline void use_pseudo(struct instruction *insn, pseudo_t p, pseudo_t *pp) in use_pseudo() argument
[all …]
H A Doptimize.c35 struct instruction *insn; in clean_up_insns() local
36 FOR_EACH_PTR(bb->insns, insn) { in clean_up_insns()
37 repeat_phase |= simplify_instruction(insn); in clean_up_insns()
38 if (!insn->bb) in clean_up_insns()
40 assert(insn->bb == bb); in clean_up_insns()
41 cse_collect(insn); in clean_up_insns()
42 } END_FOR_EACH_PTR(insn); in clean_up_insns()
H A Dcompile-i386.c174 char insn[32]; member
626 static void insn(const char *insn, struct storage *op1, struct storage *op2, in insn() function
632 assert(insn != NULL); in insn()
634 strcpy(atom->insn, insn); in insn()
725 atom->insn, tmp, stor_op_name(op2), comment); in emit_insn_atom()
728 atom->insn, stor_op_name(op1), in emit_insn_atom()
732 atom->insn, in emit_insn_atom()
883 insn("addl", val, REG_ESP, NULL); in emit_func_post()
886 insn("ret", NULL, NULL, NULL); in emit_func_post()
1137 static const char *opbits(const char *insn, unsigned int bits) in opbits() argument
[all …]
H A Dtest-unssa.c12 struct instruction *insn; in output_bb() local
17 FOR_EACH_PTR(bb->insns, insn) { in output_bb()
18 if (!insn->bb) in output_bb()
20 printf("\t%s\n", show_instruction(insn)); in output_bb()
22 END_FOR_EACH_PTR(insn); in output_bb()
H A Dstorage.c271 struct instruction *insn; in combine_phi_storage() local
272 FOR_EACH_PTR(bb->insns, insn) { in combine_phi_storage()
276 if (!insn->bb || insn->opcode != OP_PHISOURCE) in combine_phi_storage()
279 FOR_EACH_PTR(insn->phi_users, phi) { in combine_phi_storage()
289 PACK_PTR_LIST(&insn->phi_users); in combine_phi_storage()
290 } END_FOR_EACH_PTR(insn); in combine_phi_storage()
H A Dcse.h8 void cse_collect(struct instruction *insn);
/illumos-gate/usr/src/cmd/sgs/rtld/sparcv9/
H A Dboot_elf.S214 sethi %hi(M_SETHI_L0), %o4 ! Get "sethi 0x0, %l0" insn
220 sethi %hi(M_SETHI_L1), %o4 ! Get "sethi 0x0, %l1" insn
225 sethi %hi(M_OR_L0L0), %o4 ! Get "or %l0, 0x0, %l0" insn
233 sethi %hi(M_SLLX_L032L0), %o4 ! get "sllx %l0, 32, %l0" insn
237 sethi %hi(M_OR_L0L1L0), %o4 ! get "or %l0, %l1, %l0" insn
242 sethi %hi(M_JMPL_L0O1), %o4 ! get "jmpl %l0 + 0, %o1" insn
248 sethi %hi(M_MOV_G1O0), %o4 ! get "mov %g1, %o0" insn
406 sethi %hi(M_JMPL_G1G0), %o3 ! Get "jmpl %g1, %g0" insn
411 sethi %hi(M_XNOR_G5G1), %o3 ! Get "xnor %g5, %g1, %g1" insn
417 sethi %hi(M_SETHI_G5), %o3 ! Get "sethi 0x0, %g5" insn
[all …]
/illumos-gate/usr/src/lib/libm/common/C/
H A Dlibm.h165 #define PIC_G_LOAD(insn,sym,dst) \ argument
167 insn (%dst),%dst
178 #define PIC_G_LOAD(insn,sym,dst) \ argument
180 insn (%dst),%dst
188 #define PIC_G_LOAD(insn,sym,dst) insn sym,%dst argument
/illumos-gate/usr/src/uts/intel/os/
H A Darchdep.c435 uint32_t insn; in getuserpc() local
446 if (fuword32((void *)(upc - 2), &insn) != -1 && in getuserpc()
447 (insn & 0xffff) == 0x340f || (insn & 0xffff) == 0x050f) in getuserpc()