1*47821Sbostic /*- 2*47821Sbostic * Copyright (c) 1991 The Regents of the University of California. 3*47821Sbostic * All rights reserved. 4*47821Sbostic * 5*47821Sbostic * %sccs.include.proprietary.c% 6*47821Sbostic */ 7*47821Sbostic 88914Srrh #ifndef lint 9*47821Sbostic static char sccsid[] = "@(#)optab.c 4.6 (Berkeley) 04/04/91"; 10*47821Sbostic #endif /* not lint */ 113761Sroot 1236564Sbostic /* 1336564Sbostic * adb - (read-only) tables for VAX instruction decoding 1436564Sbostic */ 1536564Sbostic 1636564Sbostic #define ADB 178914Srrh #undef INSTTAB 183761Sroot 1936564Sbostic /* 2036564Sbostic * Pick up definitions for insttab from the assembler, and also 2136564Sbostic * the arrays ty_NORELOC and ty_nbyte (and soon ty_float); 2236564Sbostic * then, make insttab. 2336564Sbostic */ 2436564Sbostic #include <sys/types.h> 258914Srrh #include "instrs.h" 2636564Sbostic #include "assizetab.c" 273761Sroot 288914Srrh struct insttab insttab[] = { 298914Srrh #include "instrs.adb" 3036564Sbostic 0 313761Sroot }; 323761Sroot 3336564Sbostic /* 3436564Sbostic * Register names, and floating point immediate constants. 3536564Sbostic * The f.p. constants can be derived from the expression 3636564Sbostic * 3736564Sbostic * fp = (.5 + (n & 7) / 16.0) x (2 ^ (n >> 3)) 3836564Sbostic * 3936564Sbostic * or, alternatively, 4036564Sbostic * 4136564Sbostic * union { int i; float f; } u; u.i = (n << 3) | (1 << 14); u.f 4236564Sbostic * 4336564Sbostic * but there are only 64 of them, and this is simpler. 4436564Sbostic */ 4536564Sbostic char *regname[16] = { 4636564Sbostic "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", 4736564Sbostic "r8", "r9", "r10","r11","ap", "fp", "sp", "pc" 483761Sroot }; 4936564Sbostic char *fltimm[64] = { 5036564Sbostic "0.5", "0.5625", "0.625", "0.6875", "0.75", "0.8125", "0.875", "0.9375", 5136564Sbostic "1.0", "1.125", "1.25", "1.375", "1.5", "1.625", "1.75", "1.875", 5236564Sbostic "2.0", "2.25", "2.5", "2.75", "3.0", "3.25", "3.5", "3.75", 5336564Sbostic "4.0", "4.5", "5.0", "5.5", "6.0", "6.5", "7.0", "7.5", 5436564Sbostic "8.0", "9.0", "10.0", "11.0", "12.0", "13.0", "14.0", "15.0", 5536564Sbostic "16.0", "18.0", "20.0", "22.0", "24.0", "26.0", "28.0", "30.0", 5636564Sbostic "32.0", "36.0", "40.0", "44.0", "48.0", "52.0", "56.0", "60.0", 5736564Sbostic "64.0", "72.0", "80.0", "88.0", "96.0", "104.0", "112.0", "120.0" 588914Srrh }; 59