9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 8c vlong bug
@ 2009-09-01  1:47 erik quanstrom
  2009-09-01  1:51 ` Bruce Ellis
  0 siblings, 1 reply; 4+ messages in thread
From: erik quanstrom @ 2009-09-01  1:47 UTC (permalink / raw)
  To: 9fans

temporarly out of time on this one.  it appears
from the assembly output that 8c multiplies by
0 and not 1 when computing z a second time.
nonetheless, i haven't yet seen the problem.

#include <u.h>
#include <libc.h>

void
main(void)
{
	int three, one;
	uvlong twelve, z;

	one = 1;
	three = 3;
	twelve = 12;

	z = one*(twelve - three);
	print("z = %llud\n", z);

	z = (twelve - three) * one;
	print("z = %llud\n", z);

	exits(0);
}

output:

z = 9
z = 0

- erik



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-01  3:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-01  1:47 [9fans] 8c vlong bug erik quanstrom
2009-09-01  1:51 ` Bruce Ellis
2009-09-01  3:10   ` Russ Cox
2009-09-01  3:24     ` Bruce Ellis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).