コード例 #1
0
ファイル: clock.c プロジェクト: rcn-ee/xenomai-3
xnsticks_t xnclock_core_ticks_to_ns(xnsticks_t ticks)
{
	return xnarch_llimd(ticks, 1000000000, clockfreq);
}
コード例 #2
0
ファイル: clock.c プロジェクト: rcn-ee/xenomai-3
xnsticks_t xnclock_core_ticks_to_ns_rounded(xnsticks_t ticks)
{
	return (xnarch_llimd(ticks, 1000000000, clockfreq/2) + 1) / 2;
}
コード例 #3
0
ファイル: clock.c プロジェクト: rcn-ee/xenomai-3
xnsticks_t xnclock_core_ns_to_ticks(xnsticks_t ns)
{
	return xnarch_llimd(ns, clockfreq, 1000000000);
}
コード例 #4
0
ファイル: clock.c プロジェクト: rcn-ee/xenomai-3
long long xnclock_core_ns_to_ticks(long long ns)
{
	return xnarch_llimd(ns, 1 << tsc_shift, tsc_scale);
}
コード例 #5
0
ファイル: arith.c プロジェクト: rcn-ee/xenomai-3
static int run_arith(struct smokey_test *t, int argc, char *const argv[])
{
	unsigned int mul, shft, rejected;
	long long avg, calib = 0;
#ifdef XNARCH_HAVE_NODIV_LLIMD
	struct xnarch_u32frac frac;
#endif
	int i;

	/* Prepare. */
	xnarch_init_llmulshft(nsec_per_sec, sample_freq, &mul, &shft);
	smokey_trace("mul: 0x%08x, shft: %d", mul, shft);
#ifdef XNARCH_HAVE_NODIV_LLIMD
	xnarch_init_u32frac(&frac, nsec_per_sec, sample_freq);
	smokey_trace("integ: %d, frac: 0x%08llx", frac.integ, frac.frac);
#endif /* XNARCH_HAVE_NODIV_LLIMD */

	smokey_trace("\nsigned positive operation: 0x%016llx * %u / %d",
		arg, nsec_per_sec, sample_freq);
	bench("inline calibration", 0);
	calib = avg;
	bench("inlined llimd", xnarch_llimd(arg, nsec_per_sec, sample_freq));
	bench("inlined llmulshft", xnarch_llmulshft(arg, mul, shft));
#ifdef XNARCH_HAVE_NODIV_LLIMD
	bench("inlined nodiv_llimd",
	      xnarch_nodiv_llimd(arg, frac.frac, frac.integ));
#endif /* XNARCH_HAVE_NODIV_LLIMD */

	calib = 0;
	bench("out of line calibration", dummy());
	calib = avg;
	bench("out of line llimd",
	      do_llimd(arg, nsec_per_sec, sample_freq));
	bench("out of line llmulshft", do_llmulshft(arg, mul, shft));
#ifdef XNARCH_HAVE_NODIV_LLIMD
	bench("out of line nodiv_llimd",
	      do_nodiv_llimd(arg, frac.frac, frac.integ));
#endif /* XNARCH_HAVE_NODIV_LLIMD */


	smokey_trace("\nsigned negative operation: 0x%016llx * %u / %d",
		     -arg, nsec_per_sec, sample_freq);
	calib = 0;
	bench("inline calibration", 0);
	calib = avg;
	bench("inlined llimd", xnarch_llimd(-arg, nsec_per_sec, sample_freq));
	bench("inlined llmulshft", xnarch_llmulshft(-arg, mul, shft));
#ifdef XNARCH_HAVE_NODIV_LLIMD
	bench("inlined nodiv_llimd",
	      xnarch_nodiv_llimd(-arg, frac.frac, frac.integ));
#endif /* XNARCH_HAVE_NODIV_LLIMD */

	calib = 0;
	bench("out of line calibration", dummy());
	calib = avg;
	bench("out of line llimd",
	      do_llimd(-arg, nsec_per_sec, sample_freq));
	bench("out of line llmulshft", do_llmulshft(-arg, mul, shft));
#ifdef XNARCH_HAVE_NODIV_LLIMD
	bench("out of line nodiv_llimd",
	      do_nodiv_llimd(-arg, frac.frac, frac.integ));
#endif /* XNARCH_HAVE_NODIV_LLIMD */

#ifdef XNARCH_HAVE_NODIV_LLIMD
	smokey_trace("\nunsigned operation: 0x%016llx * %u / %d",
		     arg, nsec_per_sec, sample_freq);
	calib = 0;
	bench("inline calibration", 0);
	calib = avg;
	bench("inlined nodiv_ullimd",
	      xnarch_nodiv_ullimd(arg, frac.frac, frac.integ));

	calib = 0;
	bench("out of line calibration", dummy());
	calib = avg;
	bench("out of line nodiv_ullimd",
	      do_nodiv_ullimd(arg, frac.frac, frac.integ));
#endif /* XNARCH_HAVE_NODIV_LLIMD */
	return 0;
}
コード例 #6
0
ファイル: ticks.c プロジェクト: Lmaths/xenomai-forge
xnsticks_t cobalt_ns_to_ticks(xnsticks_t ns)
{
	return xnarch_llimd(ns, clockfreq, 1000000000);
}
コード例 #7
0
ファイル: ticks.c プロジェクト: Lmaths/xenomai-forge
xnsticks_t cobalt_ticks_to_ns_rounded(xnsticks_t ticks)
{
	return (xnarch_llimd(ticks, 1000000000, clockfreq/2) + 1) / 2;
}
コード例 #8
0
ファイル: ticks.c プロジェクト: Lmaths/xenomai-forge
xnsticks_t cobalt_ticks_to_ns(xnsticks_t ticks)
{
	return xnarch_llimd(ticks, 1000000000, clockfreq);
}
コード例 #9
0
ファイル: ticks.c プロジェクト: Lmaths/xenomai-forge
long long cobalt_ns_to_ticks(long long ns)
{
	return xnarch_llimd(ns, 1 << tsc_shift, tsc_scale);
}