• Home
  • Raw
  • Download

Lines Matching refs:dst

87 def conditional_guard(src, dst):  argument
94 if dst in int64_types:
96 elif dst in float64_types:
181 def generate_default_conversion(src, dst, mode): argument
182 close_conditional = conditional_guard(src, dst)
190 """.format(SRC=src, DST=dst, M=mode))
199 """.format(SRC=src, DST=dst, N=size, H=half_size, M=mode))
206 }}""".format(SRC=src, DST=dst, M=mode))
213 for dst in types:
214 generate_default_conversion(src, dst, '')
217 for dst in int_types:
219 generate_default_conversion(src, dst, mode)
232 def generate_saturated_conversion(src, dst, size): argument
234 close_conditional = conditional_guard(src, dst)
237 {{""".format(DST=dst, SRC=src, N=size))
243 if dst in unsigned_types:
244 bool_prefix = "as_{DST}{N}(convert_{BOOL}{N}".format(DST=dst, BOOL=bool_type[dst], N=size);
247 bool_prefix = "convert_{BOOL}{N}".format(BOOL=bool_type[dst], N=size);
251 if src == dst:
262 return y;""".format(SRC=src, DST=dst, N=size,
263 DST_MIN=limit_min[dst], DST_MAX=limit_max[dst],
269 if sizeof_type[src] == sizeof_type[dst]:
271 print(" x = min(x, ({SRC}){DST_MAX});".format(SRC=src, DST_MAX=limit_max[dst]))
276 elif sizeof_type[src] > sizeof_type[dst]:
278 print(" x = min(x, ({SRC}){DST_MAX});".format(SRC=src, DST_MAX=limit_max[dst]))
281 .format(SRC=src, DST_MIN=limit_min[dst], DST_MAX=limit_max[dst]))
284 elif src not in unsigned_types and dst in unsigned_types:
287 print(" return convert_{DST}{N}(x);".format(DST=dst, N=size))
296 for dst in int_types:
298 generate_saturated_conversion(src, dst, size)
301 def generate_saturated_conversion_with_rounding(src, dst, size, mode): argument
303 close_conditional = conditional_guard(src, dst)
311 """.format(DST=dst, SRC=src, N=size, M=mode))
319 for dst in int_types:
322 generate_saturated_conversion_with_rounding(src, dst, size, mode)
338 def generate_float_conversion(src, dst, size, mode, sat): argument
340 close_conditional = conditional_guard(src, dst)
343 {{""".format(SRC=src, DST=dst, N=size, M=mode, S=sat))
346 if dst in int_types:
353 print(" return convert_{DST}{N}{S}(x);".format(DST=dst, N=size, S=sat))
355 print(" return convert_{DST}{N}(x);".format(DST=dst, N=size))
357 print(" {DST}{N} r = convert_{DST}{N}(x);".format(DST=dst, N=size))
367 .format(DST=dst, N=size, BOOL=bool_type[dst]))
370 .format(DST=dst, N=size, BOOL=bool_type[dst]))
373 .format(DST=dst, N=size, BOOL=bool_type[dst]))
382 for dst in int_types:
386 generate_float_conversion(src, dst, size, mode, sat)
390 for dst in float_types:
393 generate_float_conversion(src, dst, size, mode, '')