• Home
  • Raw
  • Download

Lines Matching refs:address

65 mir_match_constant(struct mir_address *address)  in mir_match_constant()  argument
67 if (address->A.def && nir_ssa_scalar_is_const(address->A)) { in mir_match_constant()
68 address->bias += nir_ssa_scalar_as_uint(address->A); in mir_match_constant()
69 address->A.def = NULL; in mir_match_constant()
72 if (address->B.def && nir_ssa_scalar_is_const(address->B)) { in mir_match_constant()
73 address->bias += nir_ssa_scalar_as_uint(address->B); in mir_match_constant()
74 address->B.def = NULL; in mir_match_constant()
81 mir_match_iadd(struct mir_address *address, bool first_free) in mir_match_iadd() argument
83 if (!address->B.def || !nir_ssa_scalar_is_alu(address->B)) in mir_match_iadd()
86 if (!mir_args_ssa(address->B, 2)) in mir_match_iadd()
89 nir_op op = nir_ssa_scalar_alu_op(address->B); in mir_match_iadd()
93 nir_ssa_scalar op1 = nir_ssa_scalar_chase_alu_src(address->B, 0); in mir_match_iadd()
94 nir_ssa_scalar op2 = nir_ssa_scalar_chase_alu_src(address->B, 1); in mir_match_iadd()
97 address->bias += nir_ssa_scalar_as_uint(op1); in mir_match_iadd()
98 address->B = op2; in mir_match_iadd()
100 address->bias += nir_ssa_scalar_as_uint(op2); in mir_match_iadd()
101 address->B = op1; in mir_match_iadd()
102 } else if (first_free && !address->A.def) { in mir_match_iadd()
103 address->A = op1; in mir_match_iadd()
104 address->B = op2; in mir_match_iadd()
111 mir_match_u2u64(struct mir_address *address) in mir_match_u2u64() argument
113 if (!address->B.def || !nir_ssa_scalar_is_alu(address->B)) in mir_match_u2u64()
116 if (!mir_args_ssa(address->B, 1)) in mir_match_u2u64()
119 nir_op op = nir_ssa_scalar_alu_op(address->B); in mir_match_u2u64()
121 nir_ssa_scalar arg = nir_ssa_scalar_chase_alu_src(address->B, 0); in mir_match_u2u64()
123 address->B = arg; in mir_match_u2u64()
124 address->zext = true; in mir_match_u2u64()
130 mir_match_ishl(struct mir_address *address) in mir_match_ishl() argument
132 if (!address->B.def || !nir_ssa_scalar_is_alu(address->B)) in mir_match_ishl()
135 if (!mir_args_ssa(address->B, 2)) in mir_match_ishl()
138 nir_op op = nir_ssa_scalar_alu_op(address->B); in mir_match_ishl()
140 nir_ssa_scalar op1 = nir_ssa_scalar_chase_alu_src(address->B, 0); in mir_match_ishl()
141 nir_ssa_scalar op2 = nir_ssa_scalar_chase_alu_src(address->B, 1); in mir_match_ishl()
148 address->B = op1; in mir_match_ishl()
149 address->shift = shift; in mir_match_ishl()
155 mir_match_mov(struct mir_address *address) in mir_match_mov() argument
157 if (address->A.def && nir_ssa_scalar_is_alu(address->A)) { in mir_match_mov()
158 nir_op op = nir_ssa_scalar_alu_op(address->A); in mir_match_mov()
160 if (op == nir_op_mov && mir_args_ssa(address->A, 1)) in mir_match_mov()
161 address->A = nir_ssa_scalar_chase_alu_src(address->A, 0); in mir_match_mov()
164 if (address->B.def && nir_ssa_scalar_is_alu(address->B)) { in mir_match_mov()
165 nir_op op = nir_ssa_scalar_alu_op(address->B); in mir_match_mov()
167 if (op == nir_op_mov && mir_args_ssa(address->B, 1)) in mir_match_mov()
168 address->B = nir_ssa_scalar_chase_alu_src(address->B, 0); in mir_match_mov()
177 struct mir_address address = { in mir_match_offset() local
181 mir_match_mov(&address); in mir_match_offset()
182 mir_match_constant(&address); in mir_match_offset()
183 mir_match_mov(&address); in mir_match_offset()
184 mir_match_iadd(&address, first_free); in mir_match_offset()
185 mir_match_mov(&address); in mir_match_offset()
186 mir_match_u2u64(&address); in mir_match_offset()
187 mir_match_mov(&address); in mir_match_offset()
188 mir_match_ishl(&address); in mir_match_offset()
190 return address; in mir_match_offset()