• Home
  • Raw
  • Download

Lines Matching refs:emitter

35 def LoadAndDuplicateOffsets(emitter, registers, lanes, offsets):  argument
40 emitter.EmitVLoadA('1.32', [emitter.AllLanes(registers.Low(register)),
41 emitter.AllLanes(registers.High(register))],
42 emitter.DereferenceIncrement(offsets, 32))
49 def GenerateQntLanes(emitter, registers, qnt_lanes, source, stride, destination, argument
52 offset_registers = LoadAndDuplicateOffsets(emitter, registers, qnt_lanes,
73 emitter.EmitAdd(input_register, last_input_register, stride)
74 emitter.EmitAdd(output_register, last_output_register, destination_stride)
80 def DuplicateRegister(emitter, registers, value): argument
82 emitter.EmitVDup('32', register, value)
86 def GenerateQuantize(emitter, registers, lanes, lane_temps, argument
90 emitter.EmitVAdd('i32', lane[0], lane[0], lane[1])
93 emitter.EmitVMul('i32', lane[0], lane[0], multiplicative_offset)
96 emitter.EmitVAdd('i32', lane[0], lane[0], rounding_offset)
99 emitter.EmitVShl('s32', lane[0], lane[0], shift)
102 emitter.EmitVQmovn('s32', lane[2], lane[0])
105 emitter.EmitVQmovun('s16', registers.Low(lane_temp), lane_temp)
108 def GenerateLoadQuantizeStore(emitter, registers, lanes, multiplicative_offset, argument
116 emitter.EmitVLoadA(
119 emitter.DereferenceIncrement(lane.source, 64))
122 emitter.EmitPld(lane.source)
129 GenerateQuantize(emitter, registers, quantize_setup, lane_temps,
133 emitter.EmitVStore('1.8', registers.Low(lane_temp),
134 emitter.DereferenceIncrement(lane.output, alignment))
140 def GenerateLoadLeftovers(emitter, registers, leftovers, lanes): argument
144 emitter.EmitVLoad('1.32', emitter.Lane(
146 emitter.Dereference(lane.source, None))
149 emitter.EmitVLoad('1.32', registers.Low(lane.load_1),
150 emitter.Dereference(lane.source, 64))
153 emitter.EmitVLoad('1.32', registers.Low(lane.load_1),
154 emitter.DereferenceIncrement(lane.source, 64))
156 emitter.EmitVLoad('1.32', emitter.Lane(
158 emitter.Dereference(lane.source, None))
161 emitter.EmitVLoadA('1.32', [registers.Low(lane.load_1),
163 emitter.Dereference(lane.source, 64))
166 emitter.EmitVLoadA('1.32', [registers.Low(lane.load_1),
168 emitter.DereferenceIncrement(lane.source, 64))
170 emitter.EmitVLoad('1.32', emitter.Lane(
172 emitter.Dereference(lane.source, None))
175 emitter.EmitVLoadA('1.32', [registers.Low(lane.load_1),
178 emitter.Dereference(lane.source, 64))
181 emitter.EmitVLoadA('1.32', [registers.Low(lane.load_1),
184 emitter.DereferenceIncrement(lane.source, 64))
186 emitter.EmitVLoad('1.32', emitter.Lane(
188 emitter.Dereference(lane.source, None))
193 def GenerateStoreLeftovers(emitter, registers, leftovers, lane_temps, lanes): argument
201 emitter.EmitVStore('1.8', emitter.Lane(lane[0], 0),
202 emitter.Dereference(lane[1], None))
205 emitter.EmitVStore('1.16', emitter.Lane(lane[0], 0),
206 emitter.Dereference(lane[1], None))
209 emitter.EmitVStore('1.16', emitter.Lane(lane[0], 0),
210 emitter.DereferenceIncrement(lane[1], None))
212 emitter.EmitVStore('1.8', emitter.Lane(lane[0], 2),
213 emitter.Dereference(lane[1], None))
216 emitter.EmitVStore('1.32', emitter.Lane(lane[0], 0),
217 emitter.Dereference(lane[1], None))
220 emitter.EmitVStore('1.32', emitter.Lane(lane[0], 0),
221 emitter.DereferenceIncrement(lane[1], None))
223 emitter.EmitVStore('1.8', emitter.Lane(lane[0], 4),
224 emitter.Dereference(lane[1], None))
227 emitter.EmitVStore('1.32', emitter.Lane(lane[0], 0),
228 emitter.DereferenceIncrement(lane[1], None))
230 emitter.EmitVStore('1.16', emitter.Lane(lane[0], 2),
231 emitter.Dereference(lane[1], None))
234 emitter.EmitVStore('1.32', emitter.Lane(lane[0], 0),
235 emitter.DereferenceIncrement(lane[1], None))
237 emitter.EmitVStore('1.16', emitter.Lane(lane[0], 2),
238 emitter.DereferenceIncrement(lane[1], None))
240 emitter.EmitVStore('1.8', emitter.Lane(lane[0], 6),
241 emitter.DereferenceIncrement(lane[1], None))
246 def GenerateLeftoverLoadQuantizeStore(emitter, registers, leftovers, lanes, argument
254 GenerateLoadLeftovers(emitter, registers, leftovers, lanes)
263 GenerateQuantize(emitter, registers, quantize_setup, lane_temps,
266 GenerateStoreLeftovers(emitter, registers, leftovers, lane_temps, lanes)
269 def GenerateQntNx8(emitter, qnt_lanes, leftovers, aligned): argument
278 emitter.EmitFunctionBeginA(
285 emitter.EmitAssert('count %% 8 == %d' % leftovers)
286 emitter.EmitAssert('count >= 8')
287 emitter.EmitAssert('reinterpret_cast<std::uintptr_t>(source) % 8 == 0')
289 emitter.EmitAssert('reinterpret_cast<std::uintptr_t>(destination) % 8 == 0')
291 emitter.EmitAssert('destination_stride % 8 == 0')
292 emitter.EmitAsmBegin()
299 emitter, registers, registers.MapParameter('multiplicative_offset'))
300 rounding_offset = DuplicateRegister(emitter, registers,
302 shift = DuplicateRegister(emitter, registers, registers.MapParameter('shift'))
305 emitter, registers, qnt_lanes, registers.MapParameter('source'),
311 emitter.EmitSubs(count, count, emitter.ImmediateConstant(leftovers))
312 emitter.EmitBeqFront(2)
314 emitter.EmitNewline()
315 emitter.EmitNumericalLabel(1)
316 emitter.EmitSubs(count, count, emitter.ImmediateConstant(8))
318 GenerateLoadQuantizeStore(emitter, registers, lanes, multiplicative_offset,
321 emitter.EmitNewline()
322 emitter.EmitBneBack(1)
325 emitter.EmitNumericalLabel(2)
326 GenerateLeftoverLoadQuantizeStore(emitter, registers, leftovers, lanes,
330 emitter.EmitAsmEnd(registers.MappedParameters(), [],
332 emitter.EmitFunctionEnd()
342 def GenerateMultiQuantize(emitter, aligned, rows): argument
345 emitter.EmitFunctionBeginA(
352 emitter.EmitSwitch('count % 8')
355 emitter.EmitCase(leftovers)
356 emitter.PushIndent()
357 emitter.EmitCall(
362 emitter.EmitBreak()
363 emitter.PopIndent()
365 emitter.EmitSwitchEnd()
366 emitter.EmitFunctionEnd()