9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] MOVLQSX wrong operand order
@ 2014-01-17 20:07 cinap_lenrek
  2014-01-17 20:40 ` erik quanstrom
  2014-01-17 21:07 ` Steven Stallion
  0 siblings, 2 replies; 3+ messages in thread
From: cinap_lenrek @ 2014-01-17 20:07 UTC (permalink / raw)
  To: quanstro; +Cc: 9fans

just disassembled some code generated by 6c
and found something funny. the debugger seems
to print the operands of MOVLQSX in the wrong
order.

output of 6c -S:

	MOVLQSX	BP,CX
	ADDQ	CX,AX
	RET	,

output of acid:

foo+0x1a 0x00200042	MOVLQSX	CX,BP
foo+0x1d 0x00200045	ADDQ	CX,AX
foo+0x20 0x00200048	RET

fix:

diff -r 4e094627d459 sys/src/libmach/8db.c
--- a/sys/src/libmach/8db.c	Tue Jan 14 00:22:13 2014 +0100
+++ b/sys/src/libmach/8db.c	Fri Jan 17 21:06:42 2014 +0100
@@ -1223,7 +1223,7 @@
 [0xfd]	0,0,		"STD",
 [0xfe]	RMOPB,0,	optabFE,
 [0xff]	RMOP,0,		optabFF,
-[0x100]	RM,0,		"MOVLQSX	%r,%e",
+[0x100]	RM,0,		"MOVLQSX	%e,%r",
 };

--
cinap



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

* Re: [9fans] MOVLQSX wrong operand order
  2014-01-17 20:07 [9fans] MOVLQSX wrong operand order cinap_lenrek
@ 2014-01-17 20:40 ` erik quanstrom
  2014-01-17 21:07 ` Steven Stallion
  1 sibling, 0 replies; 3+ messages in thread
From: erik quanstrom @ 2014-01-17 20:40 UTC (permalink / raw)
  To: 9fans

On Fri Jan 17 15:09:33 EST 2014, cinap_lenrek@felloff.net wrote:
> just disassembled some code generated by 6c
> and found something funny. the debugger seems
> to print the operands of MOVLQSX in the wrong
> order.

there may be more of these.  maybe if , were replaced with → ....

- erik



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

* Re: [9fans] MOVLQSX wrong operand order
  2014-01-17 20:07 [9fans] MOVLQSX wrong operand order cinap_lenrek
  2014-01-17 20:40 ` erik quanstrom
@ 2014-01-17 21:07 ` Steven Stallion
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Stallion @ 2014-01-17 21:07 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Jan 17, 2014 at 12:07 PM,  <cinap_lenrek@felloff.net> wrote:
> just disassembled some code generated by 6c
> and found something funny. the debugger seems
> to print the operands of MOVLQSX in the wrong
> order.

*db.c are notoriously out of date an almost all platforms. I spent a
good chunk of time fixing up ARM (and adding a ton of ARMv7 stuff)
last year. The patch is still sitting in patch/arm-refresh. At least
my local copy is sane...

Steve



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

end of thread, other threads:[~2014-01-17 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-17 20:07 [9fans] MOVLQSX wrong operand order cinap_lenrek
2014-01-17 20:40 ` erik quanstrom
2014-01-17 21:07 ` Steven Stallion

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).