This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] sh-sim: pmuls


Fix a parenthesis error. Here's a testcase to verify.

2003-07-09  Michael Snyder  <msnyder@redhat.com>

	* gencode.c (pmuls): Expression is mis-parenthesized.

Index: gencode.c
===================================================================
RCS file: /cvs/src/src/sim/sh/gencode.c,v
retrieving revision 1.8
diff -p -r1.8 gencode.c
*** gencode.c	4 Jul 2003 00:03:52 -0000	1.8
--- gencode.c	9 Jul 2003 20:57:10 -0000
*************** op ppi_tab[] =
*** 1358,1364 ****
      "greater_equal = 0;",
    },
    { "","", "pmuls Se,Sf,Dg",	"0100eeffxxyygguu",
!     "res = (DSP_R (e)) >> 16 * (DSP_R (f) >> 16) * 2;",
      "if (res == 0x80000000)",
      "  res = 0x7fffffff;",
      "DSP_R (g) = res;",
--- 1358,1364 ----
      "greater_equal = 0;",
    },
    { "","", "pmuls Se,Sf,Dg",	"0100eeffxxyygguu",
!     "res = (DSP_R (e) >> 16) * (DSP_R (f) >> 16) * 2;",
      "if (res == 0x80000000)",
      "  res = 0x7fffffff;",
      "DSP_R (g) = res;",
*************** op ppi_tab[] =
*** 1371,1377 ****
      "int Sy = DSP_R (y);",
      "int Sy_grd = SIGN32 (Sy);",
      "",
!     "res = (DSP_R (e)) >> 16 * (DSP_R (f) >> 16) * 2;",
      "if (res == 0x80000000)",
      "  res = 0x7fffffff;",
      "DSP_R (g) = res;",
--- 1371,1377 ----
      "int Sy = DSP_R (y);",
      "int Sy_grd = SIGN32 (Sy);",
      "",
!     "res = (DSP_R (e) >> 16) * (DSP_R (f) >> 16) * 2;",
      "if (res == 0x80000000)",
      "  res = 0x7fffffff;",
      "DSP_R (g) = res;",
*************** op ppi_tab[] =
*** 1390,1396 ****
      "int Sy = DSP_R (y);",
      "int Sy_grd = SIGN32 (Sy);",
      "",
!     "res = (DSP_R (e)) >> 16 * (DSP_R (f) >> 16) * 2;",
      "if (res == 0x80000000)",
      "  res = 0x7fffffff;",
      "DSP_R (g) = res;",
--- 1390,1396 ----
      "int Sy = DSP_R (y);",
      "int Sy_grd = SIGN32 (Sy);",
      "",
!     "res = (DSP_R (e) >> 16) * (DSP_R (f) >> 16) * 2;",
      "if (res == 0x80000000)",
      "  res = 0x7fffffff;",
      "DSP_R (g) = res;",
# sh testcase for pmuls
# mach:	 shdsp
# as(shdsp):	-defsym sim_cpu=1 -dsp

	.include "testutils.inc"

	start
	set_grs_a5a5
	lds	r0, a0
	pcopy	a0, a1
	lds	r0, x0
	lds	r0, x1
	lds	r0, y0
	lds	r0, y1
	pcopy	x0, m0
	pcopy	y1, m1

	# 2 x 2 = 8 (?)
	# (I don't understand why the result is x2,
	# but that's what it says in the manual...)
	mov	#2, r0
	shll16	r0
	lds	r0, y0
	lds	r0, y1
	pmuls	y0, y1, a0

	assert_sreg	8, a0

	set_greg 0xa5a5a5a5, r0
	test_grs_a5a5
	pass
	exit 0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]