Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm Storing four-byte pointers to two-character...



details:   https://anonhg.NetBSD.org/src/rev/039f372d57cf
branches:  trunk
changeset: 502171:039f372d57cf
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Fri Jan 12 23:33:07 2001 +0000

description:
Storing four-byte pointers to two-character strings is silly.  All the
auxilliary tables used by the disassembler are now char[][].

The main table still uses pointers because:
 - the longest instruction name, "imbrange" is >7 characters long, which would
   make the field length wasteful.
 - GCC spots that most of the formats are shared and makes them pointers to the
   same string, so turning them into char[8] would be counter-productive.

diffstat:

 sys/arch/arm/arm/disassem.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (51 lines):

diff -r 6057497bf3a9 -r 039f372d57cf sys/arch/arm/arm/disassem.c
--- a/sys/arch/arm/arm/disassem.c       Fri Jan 12 23:03:52 2001 +0000
+++ b/sys/arch/arm/arm/disassem.c       Fri Jan 12 23:33:07 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disassem.c,v 1.5 2001/01/12 22:44:08 bjh21 Exp $       */
+/*     $NetBSD: disassem.c,v 1.6 2001/01/12 23:33:07 bjh21 Exp $       */
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -199,34 +199,34 @@
     { 0x00000000, 0x00000000, NULL,    NULL }
 };
 
-static char * const arm32_insn_conditions[] = {
+static char const arm32_insn_conditions[][4] = {
        "eq", "ne", "cs", "cc",
        "mi", "pl", "vs", "vc",
        "hi", "ls", "ge", "lt",
        "gt", "le", "",   "nv"
 };
 
-static char * const insn_block_transfers[] = {
+static char const insn_block_transfers[][4] = {
        "da", "ia", "db", "ib"
 };
 
-static char * const insn_stack_block_transfers[] = {
+static char const insn_stack_block_transfers[][4] = {
        "ed", "ea", "fd", "fa"
 };
 
-static char * const op_shifts[] = {
+static char const op_shifts[][4] = {
        "lsl", "lsr", "asr", "ror"
 };
 
-static char * const insn_fpa_rounding[] = {
+static char const insn_fpa_rounding[][2] = {
        "", "p", "m", "z"
 };
 
-static char * const insn_fpa_precision[] = {
+static char const insn_fpa_precision[][2] = {
        "s", "d", "e", "p"
 };
 
-static char * const insn_fpaconstants[] = {
+static char const insn_fpaconstants[][8] = {
        "0.0", "1.0", "2.0", "3.0",
        "4.0", "5.0", "0.5", "10.0"
 };



Home | Main Index | Thread Index | Old Index