OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [bfin-parse.c] - Blame information for rev 857

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* A Bison parser, made by GNU Bison 1.875c.  */
2
 
3
/* Skeleton parser for Yacc-like parsing with Bison,
4
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
 
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 2, or (at your option)
9
   any later version.
10
 
11
   This program is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
   GNU General Public License for more details.
15
 
16
   You should have received a copy of the GNU General Public License
17
   along with this program; if not, write to the Free Software
18
   Foundation, Inc., 59 Temple Place - Suite 330,
19
   Boston, MA 02111-1307, USA.  */
20
 
21
/* As a special exception, when this file is copied by Bison into a
22
   Bison output file, you may use that output file without restriction.
23
   This special exception was added by the Free Software Foundation
24
   in version 1.24 of Bison.  */
25
 
26
/* Written by Richard Stallman by simplifying the original so called
27
   ``semantic'' parser.  */
28
 
29
/* All symbols defined below should begin with yy or YY, to avoid
30
   infringing on user name space.  This should be done even for local
31
   variables, as they might otherwise be expanded by user macros.
32
   There are some unavoidable exceptions within include files to
33
   define necessary library symbols; they are noted "INFRINGES ON
34
   USER NAME SPACE" below.  */
35
 
36
/* Identify Bison output.  */
37
#define YYBISON 1
38
 
39
/* Skeleton name.  */
40
#define YYSKELETON_NAME "yacc.c"
41
 
42
/* Pure parsers.  */
43
#define YYPURE 0
44
 
45
/* Using locations.  */
46
#define YYLSP_NEEDED 0
47
 
48
 
49
 
50
/* Tokens.  */
51
#ifndef YYTOKENTYPE
52
# define YYTOKENTYPE
53
   /* Put the tokens into the symbol table, so that GDB and other debuggers
54
      know about them.  */
55
   enum yytokentype {
56
     BYTEOP16P = 258,
57
     BYTEOP16M = 259,
58
     BYTEOP1P = 260,
59
     BYTEOP2P = 261,
60
     BYTEOP2M = 262,
61
     BYTEOP3P = 263,
62
     BYTEUNPACK = 264,
63
     BYTEPACK = 265,
64
     PACK = 266,
65
     SAA = 267,
66
     ALIGN8 = 268,
67
     ALIGN16 = 269,
68
     ALIGN24 = 270,
69
     VIT_MAX = 271,
70
     EXTRACT = 272,
71
     DEPOSIT = 273,
72
     EXPADJ = 274,
73
     SEARCH = 275,
74
     ONES = 276,
75
     SIGN = 277,
76
     SIGNBITS = 278,
77
     LINK = 279,
78
     UNLINK = 280,
79
     REG = 281,
80
     PC = 282,
81
     CCREG = 283,
82
     BYTE_DREG = 284,
83
     REG_A_DOUBLE_ZERO = 285,
84
     REG_A_DOUBLE_ONE = 286,
85
     A_ZERO_DOT_L = 287,
86
     A_ZERO_DOT_H = 288,
87
     A_ONE_DOT_L = 289,
88
     A_ONE_DOT_H = 290,
89
     HALF_REG = 291,
90
     NOP = 292,
91
     RTI = 293,
92
     RTS = 294,
93
     RTX = 295,
94
     RTN = 296,
95
     RTE = 297,
96
     HLT = 298,
97
     IDLE = 299,
98
     STI = 300,
99
     CLI = 301,
100
     CSYNC = 302,
101
     SSYNC = 303,
102
     EMUEXCPT = 304,
103
     RAISE = 305,
104
     EXCPT = 306,
105
     LSETUP = 307,
106
     LOOP = 308,
107
     LOOP_BEGIN = 309,
108
     LOOP_END = 310,
109
     DISALGNEXCPT = 311,
110
     JUMP = 312,
111
     JUMP_DOT_S = 313,
112
     JUMP_DOT_L = 314,
113
     CALL = 315,
114
     ABORT = 316,
115
     NOT = 317,
116
     TILDA = 318,
117
     BANG = 319,
118
     AMPERSAND = 320,
119
     BAR = 321,
120
     PERCENT = 322,
121
     CARET = 323,
122
     BXOR = 324,
123
     MINUS = 325,
124
     PLUS = 326,
125
     STAR = 327,
126
     SLASH = 328,
127
     NEG = 329,
128
     MIN = 330,
129
     MAX = 331,
130
     ABS = 332,
131
     DOUBLE_BAR = 333,
132
     _PLUS_BAR_PLUS = 334,
133
     _PLUS_BAR_MINUS = 335,
134
     _MINUS_BAR_PLUS = 336,
135
     _MINUS_BAR_MINUS = 337,
136
     _MINUS_MINUS = 338,
137
     _PLUS_PLUS = 339,
138
     SHIFT = 340,
139
     LSHIFT = 341,
140
     ASHIFT = 342,
141
     BXORSHIFT = 343,
142
     _GREATER_GREATER_GREATER_THAN_ASSIGN = 344,
143
     ROT = 345,
144
     LESS_LESS = 346,
145
     GREATER_GREATER = 347,
146
     _GREATER_GREATER_GREATER = 348,
147
     _LESS_LESS_ASSIGN = 349,
148
     _GREATER_GREATER_ASSIGN = 350,
149
     DIVS = 351,
150
     DIVQ = 352,
151
     ASSIGN = 353,
152
     _STAR_ASSIGN = 354,
153
     _BAR_ASSIGN = 355,
154
     _CARET_ASSIGN = 356,
155
     _AMPERSAND_ASSIGN = 357,
156
     _MINUS_ASSIGN = 358,
157
     _PLUS_ASSIGN = 359,
158
     _ASSIGN_BANG = 360,
159
     _LESS_THAN_ASSIGN = 361,
160
     _ASSIGN_ASSIGN = 362,
161
     GE = 363,
162
     LT = 364,
163
     LE = 365,
164
     GT = 366,
165
     LESS_THAN = 367,
166
     FLUSHINV = 368,
167
     FLUSH = 369,
168
     IFLUSH = 370,
169
     PREFETCH = 371,
170
     PRNT = 372,
171
     OUTC = 373,
172
     WHATREG = 374,
173
     TESTSET = 375,
174
     ASL = 376,
175
     ASR = 377,
176
     B = 378,
177
     W = 379,
178
     NS = 380,
179
     S = 381,
180
     CO = 382,
181
     SCO = 383,
182
     TH = 384,
183
     TL = 385,
184
     BP = 386,
185
     BREV = 387,
186
     X = 388,
187
     Z = 389,
188
     M = 390,
189
     MMOD = 391,
190
     R = 392,
191
     RND = 393,
192
     RNDL = 394,
193
     RNDH = 395,
194
     RND12 = 396,
195
     RND20 = 397,
196
     V = 398,
197
     LO = 399,
198
     HI = 400,
199
     BITTGL = 401,
200
     BITCLR = 402,
201
     BITSET = 403,
202
     BITTST = 404,
203
     BITMUX = 405,
204
     DBGAL = 406,
205
     DBGAH = 407,
206
     DBGHALT = 408,
207
     DBG = 409,
208
     DBGA = 410,
209
     DBGCMPLX = 411,
210
     IF = 412,
211
     COMMA = 413,
212
     BY = 414,
213
     COLON = 415,
214
     SEMICOLON = 416,
215
     RPAREN = 417,
216
     LPAREN = 418,
217
     LBRACK = 419,
218
     RBRACK = 420,
219
     STATUS_REG = 421,
220
     MNOP = 422,
221
     SYMBOL = 423,
222
     NUMBER = 424,
223
     GOT = 425,
224
     GOT17M4 = 426,
225
     FUNCDESC_GOT17M4 = 427,
226
     AT = 428,
227
     PLTPC = 429
228
   };
229
#endif
230
#define BYTEOP16P 258
231
#define BYTEOP16M 259
232
#define BYTEOP1P 260
233
#define BYTEOP2P 261
234
#define BYTEOP2M 262
235
#define BYTEOP3P 263
236
#define BYTEUNPACK 264
237
#define BYTEPACK 265
238
#define PACK 266
239
#define SAA 267
240
#define ALIGN8 268
241
#define ALIGN16 269
242
#define ALIGN24 270
243
#define VIT_MAX 271
244
#define EXTRACT 272
245
#define DEPOSIT 273
246
#define EXPADJ 274
247
#define SEARCH 275
248
#define ONES 276
249
#define SIGN 277
250
#define SIGNBITS 278
251
#define LINK 279
252
#define UNLINK 280
253
#define REG 281
254
#define PC 282
255
#define CCREG 283
256
#define BYTE_DREG 284
257
#define REG_A_DOUBLE_ZERO 285
258
#define REG_A_DOUBLE_ONE 286
259
#define A_ZERO_DOT_L 287
260
#define A_ZERO_DOT_H 288
261
#define A_ONE_DOT_L 289
262
#define A_ONE_DOT_H 290
263
#define HALF_REG 291
264
#define NOP 292
265
#define RTI 293
266
#define RTS 294
267
#define RTX 295
268
#define RTN 296
269
#define RTE 297
270
#define HLT 298
271
#define IDLE 299
272
#define STI 300
273
#define CLI 301
274
#define CSYNC 302
275
#define SSYNC 303
276
#define EMUEXCPT 304
277
#define RAISE 305
278
#define EXCPT 306
279
#define LSETUP 307
280
#define LOOP 308
281
#define LOOP_BEGIN 309
282
#define LOOP_END 310
283
#define DISALGNEXCPT 311
284
#define JUMP 312
285
#define JUMP_DOT_S 313
286
#define JUMP_DOT_L 314
287
#define CALL 315
288
#define ABORT 316
289
#define NOT 317
290
#define TILDA 318
291
#define BANG 319
292
#define AMPERSAND 320
293
#define BAR 321
294
#define PERCENT 322
295
#define CARET 323
296
#define BXOR 324
297
#define MINUS 325
298
#define PLUS 326
299
#define STAR 327
300
#define SLASH 328
301
#define NEG 329
302
#define MIN 330
303
#define MAX 331
304
#define ABS 332
305
#define DOUBLE_BAR 333
306
#define _PLUS_BAR_PLUS 334
307
#define _PLUS_BAR_MINUS 335
308
#define _MINUS_BAR_PLUS 336
309
#define _MINUS_BAR_MINUS 337
310
#define _MINUS_MINUS 338
311
#define _PLUS_PLUS 339
312
#define SHIFT 340
313
#define LSHIFT 341
314
#define ASHIFT 342
315
#define BXORSHIFT 343
316
#define _GREATER_GREATER_GREATER_THAN_ASSIGN 344
317
#define ROT 345
318
#define LESS_LESS 346
319
#define GREATER_GREATER 347
320
#define _GREATER_GREATER_GREATER 348
321
#define _LESS_LESS_ASSIGN 349
322
#define _GREATER_GREATER_ASSIGN 350
323
#define DIVS 351
324
#define DIVQ 352
325
#define ASSIGN 353
326
#define _STAR_ASSIGN 354
327
#define _BAR_ASSIGN 355
328
#define _CARET_ASSIGN 356
329
#define _AMPERSAND_ASSIGN 357
330
#define _MINUS_ASSIGN 358
331
#define _PLUS_ASSIGN 359
332
#define _ASSIGN_BANG 360
333
#define _LESS_THAN_ASSIGN 361
334
#define _ASSIGN_ASSIGN 362
335
#define GE 363
336
#define LT 364
337
#define LE 365
338
#define GT 366
339
#define LESS_THAN 367
340
#define FLUSHINV 368
341
#define FLUSH 369
342
#define IFLUSH 370
343
#define PREFETCH 371
344
#define PRNT 372
345
#define OUTC 373
346
#define WHATREG 374
347
#define TESTSET 375
348
#define ASL 376
349
#define ASR 377
350
#define B 378
351
#define W 379
352
#define NS 380
353
#define S 381
354
#define CO 382
355
#define SCO 383
356
#define TH 384
357
#define TL 385
358
#define BP 386
359
#define BREV 387
360
#define X 388
361
#define Z 389
362
#define M 390
363
#define MMOD 391
364
#define R 392
365
#define RND 393
366
#define RNDL 394
367
#define RNDH 395
368
#define RND12 396
369
#define RND20 397
370
#define V 398
371
#define LO 399
372
#define HI 400
373
#define BITTGL 401
374
#define BITCLR 402
375
#define BITSET 403
376
#define BITTST 404
377
#define BITMUX 405
378
#define DBGAL 406
379
#define DBGAH 407
380
#define DBGHALT 408
381
#define DBG 409
382
#define DBGA 410
383
#define DBGCMPLX 411
384
#define IF 412
385
#define COMMA 413
386
#define BY 414
387
#define COLON 415
388
#define SEMICOLON 416
389
#define RPAREN 417
390
#define LPAREN 418
391
#define LBRACK 419
392
#define RBRACK 420
393
#define STATUS_REG 421
394
#define MNOP 422
395
#define SYMBOL 423
396
#define NUMBER 424
397
#define GOT 425
398
#define GOT17M4 426
399
#define FUNCDESC_GOT17M4 427
400
#define AT 428
401
#define PLTPC 429
402
 
403
 
404
 
405
 
406
/* Copy the first part of user declarations.  */
407
#line 21 "bfin-parse.y"
408
 
409
 
410
#include "as.h"
411
#include <obstack.h>
412
 
413
#include "bfin-aux.h"  // opcode generating auxiliaries
414
#include "libbfd.h"
415
#include "elf/common.h"
416
#include "elf/bfin.h"
417
 
418
#define DSP32ALU(aopcde, HL, dst1, dst0, src0, src1, s, x, aop) \
419
        bfin_gen_dsp32alu (HL, aopcde, aop, s, x, dst0, dst1, src0, src1)
420
 
421
#define DSP32MAC(op1, MM, mmod, w1, P, h01, h11, h00, h10, dst, op0, src0, src1, w0) \
422
        bfin_gen_dsp32mac (op1, MM, mmod, w1, P, h01, h11, h00, h10, op0, \
423
                           dst, src0, src1, w0)
424
 
425
#define DSP32MULT(op1, MM, mmod, w1, P, h01, h11, h00, h10, dst, op0, src0, src1, w0) \
426
        bfin_gen_dsp32mult (op1, MM, mmod, w1, P, h01, h11, h00, h10, op0, \
427
                            dst, src0, src1, w0)
428
 
429
#define DSP32SHIFT(sopcde, dst0, src0, src1, sop, hls)  \
430
        bfin_gen_dsp32shift (sopcde, dst0, src0, src1, sop, hls)
431
 
432
#define DSP32SHIFTIMM(sopcde, dst0, immag, src1, sop, hls)  \
433
        bfin_gen_dsp32shiftimm (sopcde, dst0, immag, src1, sop, hls)
434
 
435
#define LDIMMHALF_R(reg, h, s, z, hword) \
436
        bfin_gen_ldimmhalf (reg, h, s, z, hword, 1)
437
 
438
#define LDIMMHALF_R5(reg, h, s, z, hword) \
439
        bfin_gen_ldimmhalf (reg, h, s, z, hword, 2)
440
 
441
#define LDSTIDXI(ptr, reg, w, sz, z, offset)  \
442
        bfin_gen_ldstidxi (ptr, reg, w, sz, z, offset)
443
 
444
#define LDST(ptr, reg, aop, sz, z, w)  \
445
        bfin_gen_ldst (ptr, reg, aop, sz, z, w)
446
 
447
#define LDSTII(ptr, reg, offset, w, op)  \
448
        bfin_gen_ldstii (ptr, reg, offset, w, op)
449
 
450
#define DSPLDST(i, m, reg, aop, w) \
451
        bfin_gen_dspldst (i, reg, aop, w, m)
452
 
453
#define LDSTPMOD(ptr, reg, idx, aop, w) \
454
        bfin_gen_ldstpmod (ptr, reg, aop, w, idx)
455
 
456
#define LDSTIIFP(offset, reg, w)  \
457
        bfin_gen_ldstiifp (reg, offset, w)
458
 
459
#define LOGI2OP(dst, src, opc) \
460
        bfin_gen_logi2op (opc, src, dst.regno & CODE_MASK)
461
 
462
#define ALU2OP(dst, src, opc)  \
463
        bfin_gen_alu2op (dst, src, opc)
464
 
465
#define BRCC(t, b, offset) \
466
        bfin_gen_brcc (t, b, offset)
467
 
468
#define UJUMP(offset) \
469
        bfin_gen_ujump (offset)
470
 
471
#define PROGCTRL(prgfunc, poprnd) \
472
        bfin_gen_progctrl (prgfunc, poprnd)
473
 
474
#define PUSHPOPMULTIPLE(dr, pr, d, p, w) \
475
        bfin_gen_pushpopmultiple (dr, pr, d, p, w)
476
 
477
#define PUSHPOPREG(reg, w) \
478
        bfin_gen_pushpopreg (reg, w)
479
 
480
#define CALLA(addr, s)  \
481
        bfin_gen_calla (addr, s)
482
 
483
#define LINKAGE(r, framesize) \
484
        bfin_gen_linkage (r, framesize)
485
 
486
#define COMPI2OPD(dst, src, op)  \
487
        bfin_gen_compi2opd (dst, src, op)
488
 
489
#define COMPI2OPP(dst, src, op)  \
490
        bfin_gen_compi2opp (dst, src, op)
491
 
492
#define DAGMODIK(i, op)  \
493
        bfin_gen_dagmodik (i, op)
494
 
495
#define DAGMODIM(i, m, op, br)  \
496
        bfin_gen_dagmodim (i, m, op, br)
497
 
498
#define COMP3OP(dst, src0, src1, opc)   \
499
        bfin_gen_comp3op (src0, src1, dst, opc)
500
 
501
#define PTR2OP(dst, src, opc)   \
502
        bfin_gen_ptr2op (dst, src, opc)
503
 
504
#define CCFLAG(x, y, opc, i, g)  \
505
        bfin_gen_ccflag (x, y, opc, i, g)
506
 
507
#define CCMV(src, dst, t) \
508
        bfin_gen_ccmv (src, dst, t)
509
 
510
#define CACTRL(reg, a, op) \
511
        bfin_gen_cactrl (reg, a, op)
512
 
513
#define LOOPSETUP(soffset, c, rop, eoffset, reg) \
514
        bfin_gen_loopsetup (soffset, c, rop, eoffset, reg)
515
 
516
#define HL2(r1, r0)  (IS_H (r1) << 1 | IS_H (r0))
517
#define IS_RANGE(bits, expr, sign, mul)    \
518
        value_match(expr, bits, sign, mul, 1)
519
#define IS_URANGE(bits, expr, sign, mul)    \
520
        value_match(expr, bits, sign, mul, 0)
521
#define IS_CONST(expr) (expr->type == Expr_Node_Constant)
522
#define IS_RELOC(expr) (expr->type != Expr_Node_Constant)
523
#define IS_IMM(expr, bits)  value_match (expr, bits, 0, 1, 1)
524
#define IS_UIMM(expr, bits)  value_match (expr, bits, 0, 1, 0)
525
 
526
#define IS_PCREL4(expr) \
527
        (value_match (expr, 4, 0, 2, 0))
528
 
529
#define IS_LPPCREL10(expr) \
530
        (value_match (expr, 10, 0, 2, 0))
531
 
532
#define IS_PCREL10(expr) \
533
        (value_match (expr, 10, 0, 2, 1))
534
 
535
#define IS_PCREL12(expr) \
536
        (value_match (expr, 12, 0, 2, 1))
537
 
538
#define IS_PCREL24(expr) \
539
        (value_match (expr, 24, 0, 2, 1))
540
 
541
 
542
static int value_match (Expr_Node *expr, int sz, int sign, int mul, int issigned);
543
 
544
extern FILE *errorf;
545
extern INSTR_T insn;
546
 
547
static Expr_Node *binary (Expr_Op_Type, Expr_Node *, Expr_Node *);
548
static Expr_Node *unary  (Expr_Op_Type, Expr_Node *);
549
 
550
static void notethat (char *format, ...);
551
 
552
char *current_inputline;
553
extern char *yytext;
554
int yyerror (char *msg);
555
 
556
void error (char *format, ...)
557
{
558
    va_list ap;
559
    char buffer[2000];
560
 
561
    va_start (ap, format);
562
    vsprintf (buffer, format, ap);
563
    va_end (ap);
564
 
565
    as_bad (buffer);
566
}
567
 
568
int
569
yyerror (char *msg)
570
{
571
  if (msg[0] == '\0')
572
    error ("%s", msg);
573
 
574
  else if (yytext[0] != ';')
575
    error ("%s. Input text was %s.", msg, yytext);
576
  else
577
    error ("%s.", msg);
578
 
579
  return -1;
580
}
581
 
582
static int
583
in_range_p (Expr_Node *expr, int from, int to, unsigned int mask)
584
{
585
  int val = EXPR_VALUE (expr);
586
  if (expr->type != Expr_Node_Constant)
587
    return 0;
588
  if (val < from || val > to)
589
    return 0;
590
  return (val & mask) == 0;
591
}
592
 
593
extern int yylex (void);
594
 
595
#define imm3(x) EXPR_VALUE (x)
596
#define imm4(x) EXPR_VALUE (x)
597
#define uimm4(x) EXPR_VALUE (x)
598
#define imm5(x) EXPR_VALUE (x)
599
#define uimm5(x) EXPR_VALUE (x)
600
#define imm6(x) EXPR_VALUE (x)
601
#define imm7(x) EXPR_VALUE (x)
602
#define imm16(x) EXPR_VALUE (x)
603
#define uimm16s4(x) ((EXPR_VALUE (x)) >> 2)
604
#define uimm16(x) EXPR_VALUE (x)
605
 
606
/* Return true if a value is inside a range.  */
607
#define IN_RANGE(x, low, high) \
608
  (((EXPR_VALUE(x)) >= (low)) && (EXPR_VALUE(x)) <= ((high)))
609
 
610
/* Auxiliary functions.  */
611
 
612
static void
613
neg_value (Expr_Node *expr)
614
{
615
  expr->value.i_value = -expr->value.i_value;
616
}
617
 
618
static int
619
valid_dreg_pair (Register *reg1, Expr_Node *reg2)
620
{
621
  if (!IS_DREG (*reg1))
622
    {
623
      yyerror ("Dregs expected");
624
      return 0;
625
    }
626
 
627
  if (reg1->regno != 1 && reg1->regno != 3)
628
    {
629
      yyerror ("Bad register pair");
630
      return 0;
631
    }
632
 
633
  if (imm7 (reg2) != reg1->regno - 1)
634
    {
635
      yyerror ("Bad register pair");
636
      return 0;
637
    }
638
 
639
  reg1->regno--;
640
  return 1;
641
}
642
 
643
static int
644
check_multiply_halfregs (Macfunc *aa, Macfunc *ab)
645
{
646
  if ((!REG_EQUAL (aa->s0, ab->s0) && !REG_EQUAL (aa->s0, ab->s1))
647
      || (!REG_EQUAL (aa->s1, ab->s1) && !REG_EQUAL (aa->s1, ab->s0)))
648
    return yyerror ("Source multiplication register mismatch");
649
 
650
  return 0;
651
}
652
 
653
 
654
/* Check mac option.  */
655
 
656
static int
657
check_macfunc_option (Macfunc *a, Opt_mode *opt)
658
{
659
  /* Default option is always valid.  */
660
  if (opt->mod == 0)
661
    return 0;
662
 
663
  if ((a->op == 3 && a->w == 1 && a->P == 1
664
       && opt->mod != M_FU && opt->mod != M_S2RND && opt->mod != M_ISS2)
665
      || (a->op == 3 && a->w == 1 && a->P == 0
666
          && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_IU
667
          && opt->mod != M_T && opt->mod != M_S2RND && opt->mod != M_ISS2
668
          && opt->mod != M_IH)
669
      || (a->w == 0 && a->P == 0
670
          && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_W32)
671
      || (a->w == 1 && a->P == 1
672
          && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_S2RND
673
          && opt->mod != M_ISS2 && opt->mod != M_IU)
674
      || (a->w == 1 && a->P == 0
675
          && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_IU
676
          && opt->mod != M_T && opt->mod != M_TFU && opt->mod != M_S2RND
677
          && opt->mod != M_ISS2 && opt->mod != M_IH))
678
    return -1;
679
 
680
  return 0;
681
}
682
 
683
/* Check (vector) mac funcs and ops.  */
684
 
685
static int
686
check_macfuncs (Macfunc *aa, Opt_mode *opa,
687
                Macfunc *ab, Opt_mode *opb)
688
{
689
  /* Variables for swapping.  */
690
  Macfunc mtmp;
691
  Opt_mode otmp;
692
 
693
  /* The option mode should be put at the end of the second instruction
694
     of the vector except M, which should follow MAC1 instruction.  */
695
  if (opa->mod != 0)
696
    return yyerror ("Bad opt mode");
697
 
698
  /* If a0macfunc comes before a1macfunc, swap them.  */
699
 
700
  if (aa->n == 0)
701
    {
702
      /*  (M) is not allowed here.  */
703
      if (opa->MM != 0)
704
        return yyerror ("(M) not allowed with A0MAC");
705
      if (ab->n != 1)
706
        return yyerror ("Vector AxMACs can't be same");
707
 
708
      mtmp = *aa; *aa = *ab; *ab = mtmp;
709
      otmp = *opa; *opa = *opb; *opb = otmp;
710
    }
711
  else
712
    {
713
      if (opb->MM != 0)
714
        return yyerror ("(M) not allowed with A0MAC");
715
      if (ab->n != 0)
716
        return yyerror ("Vector AxMACs can't be same");
717
    }
718
 
719
  /*  If both ops are one of 0, 1, or 2, we have multiply_halfregs in both
720
  assignment_or_macfuncs.  */
721
  if ((aa->op == 0 || aa->op == 1 || aa->op == 2)
722
      && (ab->op == 0 || ab->op == 1 || ab->op == 2))
723
    {
724
      if (check_multiply_halfregs (aa, ab) < 0)
725
        return -1;
726
    }
727
  else
728
    {
729
      /*  Only one of the assign_macfuncs has a half reg multiply
730
      Evil trick: Just 'OR' their source register codes:
731
      We can do that, because we know they were initialized to 0
732
      in the rules that don't use multiply_halfregs.  */
733
      aa->s0.regno |= (ab->s0.regno & CODE_MASK);
734
      aa->s1.regno |= (ab->s1.regno & CODE_MASK);
735
    }
736
 
737
  if (aa->w == ab->w  && aa->P != ab->P)
738
    {
739
      return yyerror ("macfuncs must differ");
740
      if (aa->w && (aa->dst.regno - ab->dst.regno != 1))
741
        return yyerror ("Destination Dregs must differ by one");
742
    }
743
 
744
  /* Make sure mod flags get ORed, too.  */
745
  opb->mod |= opa->mod;
746
 
747
  /* Check option.  */
748
  if (check_macfunc_option (aa, opb) < 0
749
      && check_macfunc_option (ab, opb) < 0)
750
    return yyerror ("bad option");
751
 
752
  /* Make sure first macfunc has got both P flags ORed.  */
753
  aa->P |= ab->P;
754
 
755
  return 0;
756
}
757
 
758
 
759
static int
760
is_group1 (INSTR_T x)
761
{
762
  /* Group1 is dpsLDST, LDSTpmod, LDST, LDSTiiFP, LDSTii.  */
763
  if ((x->value & 0xc000) == 0x8000 || (x->value == 0x0000))
764
    return 1;
765
 
766
  return 0;
767
}
768
 
769
static int
770
is_group2 (INSTR_T x)
771
{
772
  if ((((x->value & 0xfc00) == 0x9c00)  /* dspLDST.  */
773
       && !((x->value & 0xfde0) == 0x9c60)  /* dagMODim.  */
774
       && !((x->value & 0xfde0) == 0x9ce0)  /* dagMODim with bit rev.  */
775
       && !((x->value & 0xfde0) == 0x9d60)) /* pick dagMODik.  */
776
      || (x->value == 0x0000))
777
    return 1;
778
  return 0;
779
}
780
 
781
 
782
 
783
/* Enabling traces.  */
784
#ifndef YYDEBUG
785
# define YYDEBUG 0
786
#endif
787
 
788
/* Enabling verbose error messages.  */
789
#ifdef YYERROR_VERBOSE
790
# undef YYERROR_VERBOSE
791
# define YYERROR_VERBOSE 1
792
#else
793
# define YYERROR_VERBOSE 0
794
#endif
795
 
796
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
797
#line 396 "bfin-parse.y"
798
typedef union YYSTYPE {
799
  INSTR_T instr;
800
  Expr_Node *expr;
801
  SYMBOL_T symbol;
802
  long value;
803
  Register reg;
804
  Macfunc macfunc;
805
  struct { int r0; int s0; int x0; int aop; } modcodes;
806
  struct { int r0; } r0;
807
  Opt_mode mod;
808
} YYSTYPE;
809
/* Line 191 of yacc.c.  */
810
#line 811 "bfin-parse.c"
811
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
812
# define YYSTYPE_IS_DECLARED 1
813
# define YYSTYPE_IS_TRIVIAL 1
814
#endif
815
 
816
 
817
 
818
/* Copy the second part of user declarations.  */
819
 
820
 
821
/* Line 214 of yacc.c.  */
822
#line 823 "bfin-parse.c"
823
 
824
#if ! defined (yyoverflow) || YYERROR_VERBOSE
825
 
826
# ifndef YYFREE
827
#  define YYFREE free
828
# endif
829
# ifndef YYMALLOC
830
#  define YYMALLOC malloc
831
# endif
832
 
833
/* The parser invokes alloca or malloc; define the necessary symbols.  */
834
 
835
# ifdef YYSTACK_USE_ALLOCA
836
#  if YYSTACK_USE_ALLOCA
837
#   define YYSTACK_ALLOC alloca
838
#  endif
839
# else
840
#  if defined (alloca) || defined (_ALLOCA_H)
841
#   define YYSTACK_ALLOC alloca
842
#  else
843
#   ifdef __GNUC__
844
#    define YYSTACK_ALLOC __builtin_alloca
845
#   endif
846
#  endif
847
# endif
848
 
849
# ifdef YYSTACK_ALLOC
850
   /* Pacify GCC's `empty if-body' warning. */
851
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
852
# else
853
#  if defined (__STDC__) || defined (__cplusplus)
854
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
855
#   define YYSIZE_T size_t
856
#  endif
857
#  define YYSTACK_ALLOC YYMALLOC
858
#  define YYSTACK_FREE YYFREE
859
# endif
860
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
861
 
862
 
863
#if (! defined (yyoverflow) \
864
     && (! defined (__cplusplus) \
865
         || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
866
 
867
/* A type that is properly aligned for any stack member.  */
868
union yyalloc
869
{
870
  short yyss;
871
  YYSTYPE yyvs;
872
  };
873
 
874
/* The size of the maximum gap between one aligned stack and the next.  */
875
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
876
 
877
/* The size of an array large to enough to hold all stacks, each with
878
   N elements.  */
879
# define YYSTACK_BYTES(N) \
880
     ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
881
      + YYSTACK_GAP_MAXIMUM)
882
 
883
/* Copy COUNT objects from FROM to TO.  The source and destination do
884
   not overlap.  */
885
# ifndef YYCOPY
886
#  if defined (__GNUC__) && 1 < __GNUC__
887
#   define YYCOPY(To, From, Count) \
888
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
889
#  else
890
#   define YYCOPY(To, From, Count)              \
891
      do                                        \
892
        {                                       \
893
          register YYSIZE_T yyi;                \
894
          for (yyi = 0; yyi < (Count); yyi++)    \
895
            (To)[yyi] = (From)[yyi];            \
896
        }                                       \
897
      while (0)
898
#  endif
899
# endif
900
 
901
/* Relocate STACK from its old location to the new one.  The
902
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
903
   elements in the stack, and YYPTR gives the new location of the
904
   stack.  Advance YYPTR to a properly aligned location for the next
905
   stack.  */
906
# define YYSTACK_RELOCATE(Stack)                                        \
907
    do                                                                  \
908
      {                                                                 \
909
        YYSIZE_T yynewbytes;                                            \
910
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
911
        Stack = &yyptr->Stack;                                          \
912
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
913
        yyptr += yynewbytes / sizeof (*yyptr);                          \
914
      }                                                                 \
915
    while (0)
916
 
917
#endif
918
 
919
#if defined (__STDC__) || defined (__cplusplus)
920
   typedef signed char yysigned_char;
921
#else
922
   typedef short yysigned_char;
923
#endif
924
 
925
/* YYFINAL -- State number of the termination state. */
926
#define YYFINAL  145
927
/* YYLAST -- Last index in YYTABLE.  */
928
#define YYLAST   1278
929
 
930
/* YYNTOKENS -- Number of terminals. */
931
#define YYNTOKENS  175
932
/* YYNNTS -- Number of nonterminals. */
933
#define YYNNTS  47
934
/* YYNRULES -- Number of rules. */
935
#define YYNRULES  348
936
/* YYNRULES -- Number of states. */
937
#define YYNSTATES  1021
938
 
939
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
940
#define YYUNDEFTOK  2
941
#define YYMAXUTOK   429
942
 
943
#define YYTRANSLATE(YYX)                                                \
944
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
945
 
946
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
947
static const unsigned char yytranslate[] =
948
{
949
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
950
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
951
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
952
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
953
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
954
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
955
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
956
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
957
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
958
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
959
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
960
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
961
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
962
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
963
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
964
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
965
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
966
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
967
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
968
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
969
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
970
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
971
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
972
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
973
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
974
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
975
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
976
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
977
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
978
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
979
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
980
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
981
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
982
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
983
      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
984
      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
985
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
986
     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
987
     125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
988
     135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
989
     145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
990
     155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
991
     165,   166,   167,   168,   169,   170,   171,   172,   173,   174
992
};
993
 
994
#if YYDEBUG
995
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
996
   YYRHS.  */
997
static const unsigned short yyprhs[] =
998
{
999
       0,     0,     3,     4,     6,     9,    16,    21,    23,    25,
1000
      28,    34,    36,    43,    50,    54,    58,    76,    94,   106,
1001
     118,   130,   143,   156,   169,   175,   179,   183,   187,   196,
1002
     210,   223,   237,   251,   265,   274,   292,   299,   309,   313,
1003
     320,   324,   330,   337,   346,   355,   358,   361,   366,   370,
1004
     373,   378,   382,   389,   394,   402,   410,   414,   418,   425,
1005
     429,   434,   438,   442,   446,   458,   470,   480,   486,   492,
1006
     502,   508,   514,   521,   528,   534,   540,   546,   553,   560,
1007
     566,   568,   572,   576,   580,   584,   589,   594,   604,   614,
1008
     620,   628,   633,   640,   646,   653,   661,   671,   680,   689,
1009
     701,   711,   716,   722,   729,   737,   744,   749,   756,   762,
1010
     769,   776,   781,   790,   801,   812,   825,   831,   838,   844,
1011
     851,   856,   861,   866,   874,   884,   894,   904,   911,   918,
1012
     925,   934,   943,   950,   956,   962,   971,   976,   984,   986,
1013
     988,   990,   992,   994,   996,   998,  1000,  1002,  1004,  1007,
1014
    1010,  1015,  1020,  1027,  1034,  1037,  1040,  1045,  1048,  1051,
1015
    1054,  1057,  1060,  1063,  1070,  1077,  1083,  1088,  1092,  1096,
1016
    1100,  1104,  1108,  1112,  1117,  1120,  1125,  1128,  1133,  1136,
1017
    1141,  1144,  1152,  1161,  1170,  1178,  1186,  1194,  1204,  1212,
1018
    1221,  1231,  1240,  1247,  1255,  1264,  1274,  1283,  1291,  1299,
1019
    1306,  1318,  1326,  1338,  1346,  1350,  1353,  1355,  1363,  1373,
1020
    1385,  1389,  1395,  1403,  1405,  1408,  1411,  1416,  1418,  1425,
1021
    1432,  1439,  1441,  1443,  1444,  1450,  1456,  1460,  1464,  1468,
1022
    1472,  1473,  1475,  1477,  1479,  1481,  1483,  1484,  1488,  1489,
1023
    1493,  1497,  1498,  1502,  1506,  1512,  1518,  1519,  1523,  1527,
1024
    1528,  1532,  1536,  1537,  1541,  1545,  1549,  1555,  1561,  1562,
1025
    1566,  1567,  1571,  1573,  1575,  1577,  1579,  1580,  1584,  1588,
1026
    1592,  1598,  1604,  1606,  1608,  1610,  1611,  1615,  1616,  1620,
1027
    1625,  1630,  1632,  1634,  1636,  1638,  1640,  1642,  1644,  1646,
1028
    1650,  1654,  1658,  1662,  1668,  1674,  1680,  1686,  1690,  1694,
1029
    1700,  1706,  1707,  1709,  1711,  1714,  1717,  1720,  1724,  1726,
1030
    1732,  1738,  1742,  1745,  1748,  1751,  1755,  1757,  1759,  1761,
1031
    1763,  1767,  1771,  1775,  1779,  1781,  1783,  1785,  1787,  1791,
1032
    1793,  1795,  1799,  1801,  1803,  1807,  1810,  1813,  1815,  1819,
1033
    1823,  1827,  1831,  1835,  1839,  1843,  1847,  1851,  1855
1034
};
1035
 
1036
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
1037
static const short yyrhs[] =
1038
{
1039
     176,     0,    -1,    -1,   177,    -1,   178,   161,    -1,   178,
1040
      78,   178,    78,   178,   161,    -1,   178,    78,   178,   161,
1041
      -1,     1,    -1,   167,    -1,   209,   180,    -1,   209,   180,
1042
     158,   209,   180,    -1,    56,    -1,    26,    98,   163,   208,
1043
     179,   162,    -1,    36,    98,   163,   208,   179,   162,    -1,
1044
      33,    98,    36,    -1,    35,    98,    36,    -1,   163,    26,
1045
     158,    26,   162,    98,     3,   163,    26,   160,   220,   158,
1046
      26,   160,   220,   162,   193,    -1,   163,    26,   158,    26,
1047
     162,    98,     4,   163,    26,   160,   220,   158,    26,   160,
1048
     220,   162,   193,    -1,   163,    26,   158,    26,   162,    98,
1049
       9,    26,   160,   220,   193,    -1,   163,    26,   158,    26,
1050
     162,    98,    20,    26,   163,   192,   162,    -1,    26,    98,
1051
      34,    71,    35,   158,    26,    98,    32,    71,    33,    -1,
1052
      26,    98,   179,    71,   179,   158,    26,    98,   179,    70,
1053
     179,   185,    -1,    26,    98,    26,   202,    26,   158,    26,
1054
      98,    26,   202,    26,   185,    -1,    26,    98,    26,   201,
1055
      26,   158,    26,    98,    26,   201,    26,   186,    -1,    26,
1056
      98,    77,    26,   190,    -1,   206,    77,   179,    -1,    32,
1057
      98,    36,    -1,    34,    98,    36,    -1,    26,    98,   195,
1058
     163,    26,   158,    26,   162,    -1,    26,    98,     5,   163,
1059
      26,   160,   220,   158,    26,   160,   220,   162,   194,    -1,
1060
      26,    98,     5,   163,    26,   160,   220,   158,    26,   160,
1061
     220,   162,    -1,    26,    98,     6,   163,    26,   160,   220,
1062
     158,    26,   160,   220,   162,   203,    -1,    26,    98,     7,
1063
     163,    26,   160,   220,   158,    26,   160,   220,   162,   203,
1064
      -1,    26,    98,     8,   163,    26,   160,   220,   158,    26,
1065
     160,   220,   162,   204,    -1,    26,    98,    10,   163,    26,
1066
     158,    26,   162,    -1,    36,    98,    36,    98,    22,   163,
1067
      36,   162,    72,    36,    71,    22,   163,    36,   162,    72,
1068
      36,    -1,    26,    98,    26,   202,    26,   185,    -1,    26,
1069
      98,   200,   163,    26,   158,    26,   162,   190,    -1,   206,
1070
      70,   179,    -1,    36,    98,    36,   202,    36,   185,    -1,
1071
     206,   206,   220,    -1,   206,   179,   163,   126,   162,    -1,
1072
      36,    98,    26,   163,   138,   162,    -1,    36,    98,    26,
1073
     202,    26,   163,   141,   162,    -1,    36,    98,    26,   202,
1074
      26,   163,   142,   162,    -1,   206,   179,    -1,   206,    26,
1075
      -1,    26,    98,    36,   187,    -1,    36,    98,   220,    -1,
1076
     206,   220,    -1,    26,    98,   220,   188,    -1,    36,    98,
1077
      26,    -1,    26,    98,    26,   201,    26,   184,    -1,    26,
1078
      98,    29,   187,    -1,   206,    77,   179,   158,   206,    77,
1079
     179,    -1,   206,    70,   179,   158,   206,    70,   179,    -1,
1080
     207,   179,   196,    -1,    26,   103,   220,    -1,    26,   104,
1081
      26,   163,   132,   162,    -1,    26,   103,    26,    -1,   179,
1082
     104,   179,   196,    -1,    26,   104,    26,    -1,    26,   104,
1083
     220,    -1,    26,    99,    26,    -1,    12,   163,    26,   160,
1084
     220,   158,    26,   160,   220,   162,   193,    -1,   206,   179,
1085
     163,   126,   162,   158,   206,   179,   163,   126,   162,    -1,
1086
      26,    98,   163,    26,    71,    26,   162,    91,   220,    -1,
1087
      26,    98,    26,    66,    26,    -1,    26,    98,    26,    68,
1088
      26,    -1,    26,    98,    26,    71,   163,    26,    91,   220,
1089
     162,    -1,    28,    98,   179,   107,   179,    -1,    28,    98,
1090
     179,   112,   179,    -1,    28,    98,    26,   112,    26,   197,
1091
      -1,    28,    98,    26,   112,   220,   197,    -1,    28,    98,
1092
      26,   107,    26,    -1,    28,    98,    26,   107,   220,    -1,
1093
      28,    98,   179,   106,   179,    -1,    28,    98,    26,   106,
1094
      26,   197,    -1,    28,    98,    26,   106,   220,   197,    -1,
1095
      26,    98,    26,    65,    26,    -1,   213,    -1,    26,    98,
1096
      26,    -1,    28,    98,    26,    -1,    26,    98,    28,    -1,
1097
      28,   105,    28,    -1,    36,    98,   211,   180,    -1,    26,
1098
      98,   211,   180,    -1,    36,    98,   211,   180,   158,    36,
1099
      98,   211,   180,    -1,    26,    98,   211,   180,   158,    26,
1100
      98,   211,   180,    -1,   206,    87,   179,   159,    36,    -1,
1101
      36,    98,    87,    36,   159,    36,   191,    -1,   206,   179,
1102
      91,   220,    -1,    26,    98,    26,    91,   220,   189,    -1,
1103
      36,    98,    36,    91,   220,    -1,    36,    98,    36,    91,
1104
     220,   191,    -1,    26,    98,    87,    26,   159,    36,   189,
1105
      -1,    36,    98,    19,   163,    26,   158,    36,   162,   190,
1106
      -1,    36,    98,    19,   163,    36,   158,    36,   162,    -1,
1107
      26,    98,    18,   163,    26,   158,    26,   162,    -1,    26,
1108
      98,    18,   163,    26,   158,    26,   162,   163,   133,   162,
1109
      -1,    26,    98,    17,   163,    26,   158,    36,   162,   187,
1110
      -1,   206,   179,    93,   220,    -1,   206,    86,   179,   159,
1111
      36,    -1,    36,    98,    86,    36,   159,    36,    -1,    26,
1112
      98,    86,    26,   159,    36,   190,    -1,    26,    98,    85,
1113
      26,   159,    36,    -1,   206,   179,    92,   220,    -1,    26,
1114
      98,    26,    92,   220,   190,    -1,    36,    98,    36,    92,
1115
     220,    -1,    36,    98,    36,    93,   220,   191,    -1,    26,
1116
      98,    26,    93,   220,   189,    -1,    36,    98,    21,    26,
1117
      -1,    26,    98,    11,   163,    36,   158,    36,   162,    -1,
1118
      36,    98,    28,    98,    88,   163,   179,   158,    26,   162,
1119
      -1,    36,    98,    28,    98,    69,   163,   179,   158,    26,
1120
     162,    -1,    36,    98,    28,    98,    69,   163,   179,   158,
1121
     179,   158,    28,   162,    -1,   206,    90,   179,   159,    36,
1122
      -1,    26,    98,    90,    26,   159,    36,    -1,   206,    90,
1123
     179,   159,   220,    -1,    26,    98,    90,    26,   159,   220,
1124
      -1,    36,    98,    23,   179,    -1,    36,    98,    23,    26,
1125
      -1,    36,    98,    23,    36,    -1,    36,    98,    16,   163,
1126
      26,   162,   181,    -1,    26,    98,    16,   163,    26,   158,
1127
      26,   162,   181,    -1,   150,   163,    26,   158,    26,   158,
1128
     179,   162,   181,    -1,   206,    88,   163,   179,   158,   179,
1129
     158,    28,   162,    -1,   147,   163,    26,   158,   220,   162,
1130
      -1,   148,   163,    26,   158,   220,   162,    -1,   146,   163,
1131
      26,   158,   220,   162,    -1,    28,   105,   149,   163,    26,
1132
     158,   220,   162,    -1,    28,    98,   149,   163,    26,   158,
1133
     220,   162,    -1,   157,    64,    28,    26,    98,    26,    -1,
1134
     157,    28,    26,    98,    26,    -1,   157,    64,    28,    57,
1135
     220,    -1,   157,    64,    28,    57,   220,   163,   131,   162,
1136
      -1,   157,    28,    57,   220,    -1,   157,    28,    57,   220,
1137
     163,   131,   162,    -1,    37,    -1,    39,    -1,    38,    -1,
1138
      40,    -1,    41,    -1,    42,    -1,    44,    -1,    47,    -1,
1139
      48,    -1,    49,    -1,    46,    26,    -1,    45,    26,    -1,
1140
      57,   163,    26,   162,    -1,    60,   163,    26,   162,    -1,
1141
      60,   163,    27,    71,    26,   162,    -1,    57,   163,    27,
1142
      71,    26,   162,    -1,    50,   220,    -1,    51,   220,    -1,
1143
     120,   163,    26,   162,    -1,    57,   220,    -1,    58,   220,
1144
      -1,    59,   220,    -1,    59,   218,    -1,    60,   220,    -1,
1145
      60,   218,    -1,    97,   163,    26,   158,    26,   162,    -1,
1146
      96,   163,    26,   158,    26,   162,    -1,    26,    98,    70,
1147
      26,   189,    -1,    26,    98,    63,    26,    -1,    26,    95,
1148
      26,    -1,    26,    95,   220,    -1,    26,    89,    26,    -1,
1149
      26,    94,    26,    -1,    26,    94,   220,    -1,    26,    89,
1150
     220,    -1,   114,   164,    26,   165,    -1,   114,   199,    -1,
1151
     113,   164,    26,   165,    -1,   113,   199,    -1,   115,   164,
1152
      26,   165,    -1,   115,   199,    -1,   116,   164,    26,   165,
1153
      -1,   116,   199,    -1,   123,   164,    26,   205,   165,    98,
1154
      26,    -1,   123,   164,    26,   202,   220,   165,    98,    26,
1155
      -1,   124,   164,    26,   202,   220,   165,    98,    26,    -1,
1156
     124,   164,    26,   205,   165,    98,    26,    -1,   124,   164,
1157
      26,   205,   165,    98,    36,    -1,   164,    26,   202,   220,
1158
     165,    98,    26,    -1,    26,    98,   124,   164,    26,   202,
1159
     220,   165,   187,    -1,    36,    98,   124,   164,    26,   205,
1160
     165,    -1,    26,    98,   124,   164,    26,   205,   165,   187,
1161
      -1,    26,    98,   124,   164,    26,    84,    26,   165,   187,
1162
      -1,    36,    98,   124,   164,    26,    84,    26,   165,    -1,
1163
     164,    26,   205,   165,    98,    26,    -1,   164,    26,    84,
1164
      26,   165,    98,    26,    -1,   124,   164,    26,    84,    26,
1165
     165,    98,    36,    -1,    26,    98,   123,   164,    26,   202,
1166
     220,   165,   187,    -1,    26,    98,   123,   164,    26,   205,
1167
     165,   187,    -1,    26,    98,   164,    26,    84,    26,   165,
1168
      -1,    26,    98,   164,    26,   202,   217,   165,    -1,    26,
1169
      98,   164,    26,   205,   165,    -1,   198,    98,   163,    26,
1170
     160,   220,   158,    26,   160,   220,   162,    -1,   198,    98,
1171
     163,    26,   160,   220,   162,    -1,   163,    26,   160,   220,
1172
     158,    26,   160,   220,   162,    98,   199,    -1,   163,    26,
1173
     160,   220,   162,    98,   199,    -1,   198,    98,    26,    -1,
1174
      24,   220,    -1,    25,    -1,    52,   163,   220,   158,   220,
1175
     162,    26,    -1,    52,   163,   220,   158,   220,   162,    26,
1176
      98,    26,    -1,    52,   163,   220,   158,   220,   162,    26,
1177
      98,    26,    92,   220,    -1,    53,   220,    26,    -1,    53,
1178
     220,    26,    98,    26,    -1,    53,   220,    26,    98,    26,
1179
      92,   220,    -1,   154,    -1,   154,   179,    -1,   154,    26,
1180
      -1,   156,   163,    26,   162,    -1,   153,    -1,   155,   163,
1181
      36,   158,   220,   162,    -1,   152,   163,    26,   158,   220,
1182
     162,    -1,   151,   163,    26,   158,   220,   162,    -1,    30,
1183
      -1,    31,    -1,    -1,   163,   135,   158,   136,   162,    -1,
1184
     163,   136,   158,   135,   162,    -1,   163,   136,   162,    -1,
1185
     163,   135,   162,    -1,   163,   121,   162,    -1,   163,   122,
1186
     162,    -1,    -1,   126,    -1,   127,    -1,   128,    -1,   121,
1187
      -1,   122,    -1,    -1,   163,   182,   162,    -1,    -1,   163,
1188
     125,   162,    -1,   163,   126,   162,    -1,    -1,   163,   183,
1189
     162,    -1,   163,   182,   162,    -1,   163,   183,   158,   182,
1190
     162,    -1,   163,   182,   158,   183,   162,    -1,    -1,   163,
1191
     134,   162,    -1,   163,   133,   162,    -1,    -1,   163,   133,
1192
     162,    -1,   163,   134,   162,    -1,    -1,   163,   125,   162,
1193
      -1,   163,   126,   162,    -1,   163,   143,   162,    -1,   163,
1194
     143,   158,   126,   162,    -1,   163,   126,   158,   143,   162,
1195
      -1,    -1,   163,   143,   162,    -1,    -1,   163,   126,   162,
1196
      -1,   108,    -1,   111,    -1,   110,    -1,   109,    -1,    -1,
1197
     163,   137,   162,    -1,   163,   137,   162,    -1,   163,   136,
1198
     162,    -1,   163,   136,   158,   137,   162,    -1,   163,   137,
1199
     158,   136,   162,    -1,    13,    -1,    14,    -1,    15,    -1,
1200
      -1,   163,   136,   162,    -1,    -1,   163,   136,   162,    -1,
1201
     164,    83,    26,   165,    -1,   164,    26,    84,   165,    -1,
1202
      75,    -1,    76,    -1,    79,    -1,    80,    -1,    81,    -1,
1203
      82,    -1,    71,    -1,    70,    -1,   163,   140,   162,    -1,
1204
     163,   129,   162,    -1,   163,   139,   162,    -1,   163,   130,
1205
     162,    -1,   163,   140,   158,   137,   162,    -1,   163,   129,
1206
     158,   137,   162,    -1,   163,   139,   158,   137,   162,    -1,
1207
     163,   130,   158,   137,   162,    -1,   163,   144,   162,    -1,
1208
     163,   145,   162,    -1,   163,   144,   158,   137,   162,    -1,
1209
     163,   145,   158,   137,   162,    -1,    -1,    84,    -1,    83,
1210
      -1,   179,    98,    -1,   179,   103,    -1,   179,   104,    -1,
1211
      26,    98,   179,    -1,   210,    -1,    26,    98,   163,   210,
1212
     162,    -1,    36,    98,   163,   210,   162,    -1,    36,    98,
1213
     179,    -1,   206,   211,    -1,   208,   211,    -1,   207,   211,
1214
      -1,    36,    72,    36,    -1,    98,    -1,   100,    -1,   102,
1215
      -1,   101,    -1,    28,   212,   166,    -1,    28,   212,   143,
1216
      -1,   166,   212,    28,    -1,   143,   212,    28,    -1,   168,
1217
      -1,   170,    -1,   171,    -1,   172,    -1,   214,   173,   215,
1218
      -1,   216,    -1,   220,    -1,   214,   173,   174,    -1,   169,
1219
      -1,   214,    -1,   163,   221,   162,    -1,    63,   221,    -1,
1220
      70,   221,    -1,   221,    -1,   221,    72,   221,    -1,   221,
1221
      73,   221,    -1,   221,    67,   221,    -1,   221,    71,   221,
1222
      -1,   221,    70,   221,    -1,   221,    91,   221,    -1,   221,
1223
      92,   221,    -1,   221,    65,   221,    -1,   221,    68,   221,
1224
      -1,   221,    66,   221,    -1,   219,    -1
1225
};
1226
 
1227
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
1228
static const unsigned short yyrline[] =
1229
{
1230
       0,   597,   597,   598,   610,   612,   645,   672,   683,   687,
1231
     725,   745,   750,   760,   770,   775,   780,   796,   812,   824,
1232
     834,   847,   866,   884,   907,   929,   934,   944,   955,   966,
1233
     980,   995,  1011,  1027,  1043,  1054,  1068,  1094,  1112,  1117,
1234
    1123,  1135,  1146,  1157,  1168,  1179,  1190,  1201,  1227,  1241,
1235
    1251,  1296,  1315,  1326,  1337,  1348,  1359,  1370,  1386,  1403,
1236
    1419,  1430,  1441,  1474,  1485,  1498,  1509,  1548,  1558,  1568,
1237
    1588,  1598,  1608,  1618,  1629,  1639,  1649,  1659,  1670,  1694,
1238
    1705,  1711,  1722,  1733,  1744,  1752,  1773,  1799,  1828,  1859,
1239
    1873,  1884,  1898,  1932,  1942,  1952,  1977,  1989,  2007,  2018,
1240
    2029,  2040,  2053,  2064,  2075,  2086,  2097,  2108,  2141,  2151,
1241
    2164,  2184,  2195,  2206,  2219,  2232,  2243,  2254,  2265,  2276,
1242
    2286,  2297,  2308,  2320,  2331,  2342,  2353,  2366,  2378,  2390,
1243
    2401,  2412,  2423,  2435,  2447,  2458,  2469,  2480,  2490,  2496,
1244
    2502,  2508,  2514,  2520,  2526,  2532,  2538,  2544,  2550,  2561,
1245
    2572,  2583,  2594,  2605,  2616,  2627,  2633,  2644,  2655,  2666,
1246
    2677,  2688,  2698,  2711,  2719,  2727,  2751,  2762,  2773,  2784,
1247
    2795,  2806,  2818,  2831,  2840,  2851,  2862,  2874,  2885,  2896,
1248
    2907,  2921,  2933,  2948,  2967,  2978,  2996,  3030,  3048,  3065,
1249
    3076,  3087,  3098,  3119,  3138,  3151,  3165,  3177,  3193,  3233,
1250
    3264,  3280,  3299,  3313,  3332,  3348,  3356,  3365,  3376,  3388,
1251
    3402,  3410,  3420,  3432,  3437,  3442,  3448,  3456,  3462,  3468,
1252
    3474,  3487,  3491,  3501,  3505,  3510,  3515,  3520,  3527,  3531,
1253
    3538,  3542,  3547,  3552,  3560,  3564,  3571,  3575,  3583,  3588,
1254
    3594,  3603,  3608,  3614,  3620,  3626,  3635,  3638,  3642,  3649,
1255
    3652,  3656,  3663,  3668,  3674,  3680,  3686,  3691,  3699,  3702,
1256
    3709,  3712,  3719,  3723,  3727,  3731,  3738,  3741,  3748,  3753,
1257
    3760,  3767,  3779,  3783,  3787,  3794,  3797,  3807,  3810,  3819,
1258
    3825,  3834,  3838,  3845,  3849,  3853,  3857,  3864,  3868,  3875,
1259
    3883,  3891,  3899,  3907,  3914,  3921,  3929,  3939,  3944,  3949,
1260
    3954,  3962,  3965,  3969,  3978,  3985,  3992,  3999,  4014,  4020,
1261
    4033,  4046,  4064,  4071,  4078,  4088,  4101,  4105,  4109,  4113,
1262
    4120,  4126,  4132,  4138,  4148,  4157,  4159,  4161,  4165,  4173,
1263
    4177,  4184,  4190,  4196,  4200,  4204,  4208,  4214,  4220,  4224,
1264
    4228,  4232,  4236,  4240,  4244,  4248,  4252,  4256,  4260
1265
};
1266
#endif
1267
 
1268
#if YYDEBUG || YYERROR_VERBOSE
1269
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1270
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1271
static const char *const yytname[] =
1272
{
1273
  "$end", "error", "$undefined", "BYTEOP16P", "BYTEOP16M", "BYTEOP1P",
1274
  "BYTEOP2P", "BYTEOP2M", "BYTEOP3P", "BYTEUNPACK", "BYTEPACK", "PACK",
1275
  "SAA", "ALIGN8", "ALIGN16", "ALIGN24", "VIT_MAX", "EXTRACT", "DEPOSIT",
1276
  "EXPADJ", "SEARCH", "ONES", "SIGN", "SIGNBITS", "LINK", "UNLINK", "REG",
1277
  "PC", "CCREG", "BYTE_DREG", "REG_A_DOUBLE_ZERO", "REG_A_DOUBLE_ONE",
1278
  "A_ZERO_DOT_L", "A_ZERO_DOT_H", "A_ONE_DOT_L", "A_ONE_DOT_H", "HALF_REG",
1279
  "NOP", "RTI", "RTS", "RTX", "RTN", "RTE", "HLT", "IDLE", "STI", "CLI",
1280
  "CSYNC", "SSYNC", "EMUEXCPT", "RAISE", "EXCPT", "LSETUP", "LOOP",
1281
  "LOOP_BEGIN", "LOOP_END", "DISALGNEXCPT", "JUMP", "JUMP_DOT_S",
1282
  "JUMP_DOT_L", "CALL", "ABORT", "NOT", "TILDA", "BANG", "AMPERSAND",
1283
  "BAR", "PERCENT", "CARET", "BXOR", "MINUS", "PLUS", "STAR", "SLASH",
1284
  "NEG", "MIN", "MAX", "ABS", "DOUBLE_BAR", "_PLUS_BAR_PLUS",
1285
  "_PLUS_BAR_MINUS", "_MINUS_BAR_PLUS", "_MINUS_BAR_MINUS", "_MINUS_MINUS",
1286
  "_PLUS_PLUS", "SHIFT", "LSHIFT", "ASHIFT", "BXORSHIFT",
1287
  "_GREATER_GREATER_GREATER_THAN_ASSIGN", "ROT", "LESS_LESS",
1288
  "GREATER_GREATER", "_GREATER_GREATER_GREATER", "_LESS_LESS_ASSIGN",
1289
  "_GREATER_GREATER_ASSIGN", "DIVS", "DIVQ", "ASSIGN", "_STAR_ASSIGN",
1290
  "_BAR_ASSIGN", "_CARET_ASSIGN", "_AMPERSAND_ASSIGN", "_MINUS_ASSIGN",
1291
  "_PLUS_ASSIGN", "_ASSIGN_BANG", "_LESS_THAN_ASSIGN", "_ASSIGN_ASSIGN",
1292
  "GE", "LT", "LE", "GT", "LESS_THAN", "FLUSHINV", "FLUSH", "IFLUSH",
1293
  "PREFETCH", "PRNT", "OUTC", "WHATREG", "TESTSET", "ASL", "ASR", "B", "W",
1294
  "NS", "S", "CO", "SCO", "TH", "TL", "BP", "BREV", "X", "Z", "M", "MMOD",
1295
  "R", "RND", "RNDL", "RNDH", "RND12", "RND20", "V", "LO", "HI", "BITTGL",
1296
  "BITCLR", "BITSET", "BITTST", "BITMUX", "DBGAL", "DBGAH", "DBGHALT",
1297
  "DBG", "DBGA", "DBGCMPLX", "IF", "COMMA", "BY", "COLON", "SEMICOLON",
1298
  "RPAREN", "LPAREN", "LBRACK", "RBRACK", "STATUS_REG", "MNOP", "SYMBOL",
1299
  "NUMBER", "GOT", "GOT17M4", "FUNCDESC_GOT17M4", "AT", "PLTPC", "$accept",
1300
  "statement", "asm", "asm_1", "REG_A", "opt_mode", "asr_asl", "sco",
1301
  "asr_asl_0", "amod0", "amod1", "amod2", "xpmod", "xpmod1", "vsmod",
1302
  "vmod", "smod", "searchmod", "aligndir", "byteop_mod", "c_align",
1303
  "w32_or_nothing", "iu_or_nothing", "reg_with_predec", "reg_with_postinc",
1304
  "min_max", "op_bar_op", "plus_minus", "rnd_op", "b3_op", "post_op",
1305
  "a_assign", "a_minusassign", "a_plusassign", "assign_macfunc",
1306
  "a_macfunc", "multiply_halfregs", "cc_op", "ccstat", "symbol",
1307
  "any_gotrel", "got", "got_or_expr", "pltpc", "eterm", "expr", "expr_1", 0
1308
};
1309
#endif
1310
 
1311
# ifdef YYPRINT
1312
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1313
   token YYLEX-NUM.  */
1314
static const unsigned short yytoknum[] =
1315
{
1316
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
1317
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
1318
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
1319
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
1320
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
1321
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
1322
     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
1323
     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
1324
     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
1325
     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
1326
     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
1327
     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
1328
     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
1329
     385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
1330
     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
1331
     405,   406,   407,   408,   409,   410,   411,   412,   413,   414,
1332
     415,   416,   417,   418,   419,   420,   421,   422,   423,   424,
1333
     425,   426,   427,   428,   429
1334
};
1335
# endif
1336
 
1337
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1338
static const unsigned char yyr1[] =
1339
{
1340
       0,   175,   176,   176,   177,   177,   177,   177,   178,   178,
1341
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1342
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1343
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1344
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1345
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1346
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1347
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1348
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1349
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1350
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1351
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1352
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1353
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1354
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1355
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1356
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1357
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1358
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1359
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1360
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1361
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
1362
     178,   179,   179,   180,   180,   180,   180,   180,   181,   181,
1363
     182,   182,   182,   182,   183,   183,   184,   184,   185,   185,
1364
     185,   186,   186,   186,   186,   186,   187,   187,   187,   188,
1365
     188,   188,   189,   189,   189,   189,   189,   189,   190,   190,
1366
     191,   191,   192,   192,   192,   192,   193,   193,   194,   194,
1367
     194,   194,   195,   195,   195,   196,   196,   197,   197,   198,
1368
     199,   200,   200,   201,   201,   201,   201,   202,   202,   203,
1369
     203,   203,   203,   203,   203,   203,   203,   204,   204,   204,
1370
     204,   205,   205,   205,   206,   207,   208,   209,   209,   209,
1371
     209,   209,   210,   210,   210,   211,   212,   212,   212,   212,
1372
     213,   213,   213,   213,   214,   215,   215,   215,   216,   217,
1373
     217,   218,   219,   219,   219,   219,   219,   220,   221,   221,
1374
     221,   221,   221,   221,   221,   221,   221,   221,   221
1375
};
1376
 
1377
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
1378
static const unsigned char yyr2[] =
1379
{
1380
       0,     2,     0,     1,     2,     6,     4,     1,     1,     2,
1381
       5,     1,     6,     6,     3,     3,    17,    17,    11,    11,
1382
      11,    12,    12,    12,     5,     3,     3,     3,     8,    13,
1383
      12,    13,    13,    13,     8,    17,     6,     9,     3,     6,
1384
       3,     5,     6,     8,     8,     2,     2,     4,     3,     2,
1385
       4,     3,     6,     4,     7,     7,     3,     3,     6,     3,
1386
       4,     3,     3,     3,    11,    11,     9,     5,     5,     9,
1387
       5,     5,     6,     6,     5,     5,     5,     6,     6,     5,
1388
       1,     3,     3,     3,     3,     4,     4,     9,     9,     5,
1389
       7,     4,     6,     5,     6,     7,     9,     8,     8,    11,
1390
       9,     4,     5,     6,     7,     6,     4,     6,     5,     6,
1391
       6,     4,     8,    10,    10,    12,     5,     6,     5,     6,
1392
       4,     4,     4,     7,     9,     9,     9,     6,     6,     6,
1393
       8,     8,     6,     5,     5,     8,     4,     7,     1,     1,
1394
       1,     1,     1,     1,     1,     1,     1,     1,     2,     2,
1395
       4,     4,     6,     6,     2,     2,     4,     2,     2,     2,
1396
       2,     2,     2,     6,     6,     5,     4,     3,     3,     3,
1397
       3,     3,     3,     4,     2,     4,     2,     4,     2,     4,
1398
       2,     7,     8,     8,     7,     7,     7,     9,     7,     8,
1399
       9,     8,     6,     7,     8,     9,     8,     7,     7,     6,
1400
      11,     7,    11,     7,     3,     2,     1,     7,     9,    11,
1401
       3,     5,     7,     1,     2,     2,     4,     1,     6,     6,
1402
       6,     1,     1,     0,     5,     5,     3,     3,     3,     3,
1403
       0,     1,     1,     1,     1,     1,     0,     3,     0,     3,
1404
       3,     0,     3,     3,     5,     5,     0,     3,     3,     0,
1405
       3,     3,     0,     3,     3,     3,     5,     5,     0,     3,
1406
       0,     3,     1,     1,     1,     1,     0,     3,     3,     3,
1407
       5,     5,     1,     1,     1,     0,     3,     0,     3,     4,
1408
       4,     1,     1,     1,     1,     1,     1,     1,     1,     3,
1409
       3,     3,     3,     5,     5,     5,     5,     3,     3,     5,
1410
       5,     0,     1,     1,     2,     2,     2,     3,     1,     5,
1411
       5,     3,     2,     2,     2,     3,     1,     1,     1,     1,
1412
       3,     3,     3,     3,     1,     1,     1,     1,     3,     1,
1413
       1,     3,     1,     1,     3,     2,     2,     1,     3,     3,
1414
       3,     3,     3,     3,     3,     3,     3,     3,     1
1415
};
1416
 
1417
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1418
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
1419
   means the default is an error.  */
1420
static const unsigned short yydefact[] =
1421
{
1422
       0,     7,     0,     0,   206,     0,     0,   221,   222,     0,
1423
       0,     0,     0,     0,   138,   140,   139,   141,   142,   143,
1424
     144,     0,     0,   145,   146,   147,     0,     0,     0,     0,
1425
      11,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1426
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1427
       0,   217,   213,     0,     0,     0,     0,     0,     0,     8,
1428
       0,     3,     0,     0,     0,     0,     0,     0,   223,   308,
1429
      80,     0,     0,     0,     0,   324,   332,   333,   348,   205,
1430
     337,     0,     0,     0,     0,     0,     0,     0,   316,   317,
1431
     319,   318,     0,     0,     0,     0,     0,     0,     0,   149,
1432
     148,   154,   155,     0,     0,     0,   157,   158,   333,   160,
1433
     159,     0,   162,   161,     0,     0,     0,   176,     0,   174,
1434
       0,   178,     0,   180,     0,     0,     0,   316,     0,     0,
1435
       0,     0,     0,     0,     0,   215,   214,     0,     0,     0,
1436
       0,     0,   301,     0,     0,     1,     0,     4,   304,   305,
1437
     306,     0,    46,     0,     0,     0,     0,     0,     0,     0,
1438
      45,     0,   312,    49,   275,   314,   313,     0,     9,     0,
1439
     335,   336,     0,     0,     0,     0,     0,     0,     0,     0,
1440
       0,     0,     0,   169,   172,   170,   171,   167,   168,     0,
1441
       0,     0,     0,     0,     0,   272,   273,   274,     0,     0,
1442
       0,    81,    83,   246,     0,   246,     0,     0,   281,   282,
1443
       0,     0,     0,     0,     0,     0,     0,     0,     0,   307,
1444
       0,     0,   223,   249,    63,    59,    57,    61,    62,    82,
1445
       0,     0,    84,     0,   321,   320,    26,    14,    27,    15,
1446
       0,     0,     0,     0,    51,     0,     0,     0,     0,     0,
1447
       0,   311,   223,    48,     0,   210,     0,     0,     0,     0,
1448
       0,     0,     0,     0,     0,     0,     0,     0,   301,   301,
1449
     323,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1450
       0,     0,     0,     0,   288,   287,   303,   302,     0,     0,
1451
       0,   322,     0,   275,   204,     0,     0,    38,    25,     0,
1452
       0,     0,     0,     0,     0,     0,     0,    40,     0,    56,
1453
       0,     0,     0,     0,   334,   345,   347,   340,   346,   342,
1454
     341,   338,   339,   343,   344,     0,     0,     0,     0,     0,
1455
       0,     0,     0,     0,     0,     0,     0,   287,   283,   284,
1456
     285,   286,     0,     0,     0,     0,     0,     0,    53,     0,
1457
      47,   166,   252,   258,     0,     0,     0,     0,     0,     0,
1458
       0,     0,     0,     0,     0,     0,   301,     0,     0,     0,
1459
      86,     0,    50,     0,     0,     0,     0,     0,     0,     0,
1460
       0,     0,     0,     0,   111,   121,   122,   120,     0,     0,
1461
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1462
       0,    85,     0,     0,   150,     0,   331,   151,     0,     0,
1463
       0,     0,   175,   173,   177,   179,   156,   302,     0,     0,
1464
     302,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1465
     216,     0,   136,     0,     0,     0,     0,     0,     0,     0,
1466
     279,     0,     6,    60,     0,   315,     0,     0,     0,     0,
1467
       0,     0,    91,   106,   101,     0,     0,     0,   227,     0,
1468
     226,     0,     0,   223,     0,     0,     0,     0,     0,     0,
1469
       0,     0,     0,     0,    79,    67,    68,     0,   252,   258,
1470
     252,   236,   238,     0,     0,     0,     0,   165,     0,    24,
1471
       0,     0,     0,     0,   301,   301,     0,   306,     0,   309,
1472
     302,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1473
     277,   277,    74,    75,   277,   277,     0,    76,    70,    71,
1474
       0,     0,     0,     0,     0,     0,     0,     0,    93,   108,
1475
     260,     0,   238,     0,     0,   301,     0,   310,     0,     0,
1476
     211,     0,     0,     0,     0,   280,     0,     0,     0,     0,
1477
       0,     0,     0,     0,     0,     0,     0,     0,   133,     0,
1478
       0,   134,     0,     0,     0,     0,     0,     0,     0,     0,
1479
       0,     0,     0,   102,    89,     0,   116,   118,    41,   276,
1480
       0,     0,     0,     0,    10,     0,     0,     0,     0,     0,
1481
       0,     0,     0,     0,     0,     0,    92,   107,   110,     0,
1482
     230,    52,     0,     0,    36,   248,   247,     0,     0,     0,
1483
       0,     0,   105,   258,   252,   117,   119,     0,     0,   302,
1484
       0,     0,     0,    12,     0,   333,   329,     0,   330,   199,
1485
       0,     0,     0,     0,   250,   251,    58,     0,    77,    78,
1486
      72,    73,     0,     0,     0,     0,     0,    42,     0,     0,
1487
       0,     0,    94,   109,     0,    39,   103,   260,   302,     0,
1488
      13,     0,     0,     0,   153,   152,   164,   163,     0,     0,
1489
       0,     0,     0,   129,   127,   128,     0,   220,   219,   218,
1490
       0,   132,     0,     0,     0,     0,     0,     0,   192,     5,
1491
       0,     0,     0,     0,     0,   224,   225,     0,   307,     0,
1492
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1493
       0,     0,   231,   232,   233,     0,     0,     0,     0,     0,
1494
     253,     0,   254,     0,   255,   259,   104,    95,     0,   246,
1495
       0,     0,   246,     0,   197,     0,   198,     0,     0,     0,
1496
       0,     0,     0,     0,     0,   123,     0,     0,     0,     0,
1497
       0,     0,     0,     0,    90,     0,   188,     0,   207,   212,
1498
       0,   181,     0,     0,   184,   185,     0,   137,     0,     0,
1499
       0,     0,     0,     0,     0,   203,   193,   186,     0,   201,
1500
      55,    54,     0,     0,     0,     0,     0,     0,     0,    34,
1501
     112,     0,   246,    98,     0,     0,   237,     0,   239,   240,
1502
       0,     0,     0,   246,   196,   246,   246,   189,     0,   325,
1503
     326,   327,   328,     0,    28,   258,   223,   278,   131,   130,
1504
       0,     0,   258,    97,    43,    44,     0,     0,   261,     0,
1505
     191,   223,     0,   182,   194,   183,     0,   135,     0,     0,
1506
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1507
       0,     0,   124,   100,     0,    69,     0,     0,     0,   257,
1508
     256,   195,   190,   187,    66,     0,    37,    88,   228,   229,
1509
      96,     0,     0,     0,     0,    87,   208,   125,     0,     0,
1510
       0,     0,     0,     0,   126,     0,   266,     0,     0,     0,
1511
       0,     0,     0,     0,     0,     0,   114,     0,   113,     0,
1512
       0,     0,     0,   266,   262,   265,   264,   263,     0,     0,
1513
       0,     0,     0,    64,     0,     0,     0,     0,    99,   241,
1514
     238,    20,   238,     0,     0,   209,     0,     0,    18,    19,
1515
     202,   200,    65,     0,    30,     0,     0,     0,   230,    23,
1516
      22,    21,   115,     0,     0,     0,   267,     0,    29,     0,
1517
      31,    32,     0,    33,   234,   235,     0,     0,     0,     0,
1518
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1519
     243,   230,   242,     0,     0,     0,     0,   269,     0,   268,
1520
       0,   290,     0,   292,     0,   291,     0,   289,     0,   297,
1521
       0,   298,     0,     0,     0,     0,     0,     0,     0,     0,
1522
       0,     0,     0,     0,     0,   245,   244,     0,   266,   266,
1523
     270,   271,   294,   296,   295,   293,   299,   300,    35,    16,
1524
      17
1525
};
1526
 
1527
/* YYDEFGOTO[NTERM-NUM]. */
1528
static const short yydefgoto[] =
1529
{
1530
      -1,    60,    61,    62,   361,   168,   745,   715,   957,   601,
1531
     604,   939,   348,   372,   487,   489,   652,   908,   913,   948,
1532
     220,   309,   638,    64,   117,   221,   345,   288,   950,   953,
1533
     289,   362,   363,    67,    68,    69,   166,    93,    70,    77,
1534
     812,   626,   627,   109,    78,    79,    80
1535
};
1536
 
1537
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1538
   STATE-NUM.  */
1539
#define YYPACT_NINF -907
1540
static const short yypact[] =
1541
{
1542
     878,  -907,  -120,   291,  -907,   614,   439,  -907,  -907,   -35,
1543
     -11,    31,    61,    81,  -907,  -907,  -907,  -907,  -907,  -907,
1544
    -907,   183,   202,  -907,  -907,  -907,   291,   291,   -56,   291,
1545
    -907,   351,   291,   291,   354,    96,   111,    86,   160,   162,
1546
     168,   122,   170,   172,   318,   134,   146,   196,   200,   217,
1547
     228,  -907,   230,   233,   252,    46,   207,    26,   318,  -907,
1548
     412,  -907,   -48,   195,   324,   270,   274,   394,   271,  -907,
1549
    -907,   418,   291,   291,   291,  -907,  -907,  -907,  -907,  -907,
1550
     561,    55,    69,    71,   482,   421,    80,   107,    70,  -907,
1551
    -907,  -907,     5,  -107,   414,   419,   422,   440,   121,  -907,
1552
    -907,  -907,  -907,   291,   465,    42,  -907,  -907,   321,  -907,
1553
    -907,    52,  -907,  -907,   479,   489,   495,  -907,   502,  -907,
1554
     520,  -907,   558,  -907,   560,   569,   593,  -907,   594,   599,
1555
     604,   609,   630,   640,   643,  -907,  -907,   638,   650,    27,
1556
     657,   -22,   237,   663,   667,  -907,  1024,  -907,  -907,  -907,
1557
     186,     9,  -907,   568,   272,   186,   186,   186,   547,   186,
1558
     174,   291,  -907,  -907,   548,  -907,  -907,   147,   556,   555,
1559
    -907,  -907,   459,   291,   291,   291,   291,   291,   291,   291,
1560
     291,   291,   291,  -907,  -907,  -907,  -907,  -907,  -907,   562,
1561
     563,   564,   565,   567,   570,  -907,  -907,  -907,   572,   573,
1562
     574,   508,  -907,   575,   645,   -52,   159,   201,  -907,  -907,
1563
     697,   698,   703,   705,   706,   576,   577,    20,   708,   668,
1564
     579,   580,   271,   581,  -907,  -907,  -907,   582,  -907,   239,
1565
     583,   320,  -907,   585,  -907,  -907,  -907,  -907,  -907,  -907,
1566
     586,   587,   725,   145,    15,   654,   411,   717,   718,   591,
1567
     272,  -907,   271,  -907,   598,   659,   597,   689,   588,   601,
1568
     690,   606,   607,   -46,   -39,   -37,    -4,   605,   301,   323,
1569
    -907,   610,   613,   615,   616,   617,   618,   619,   621,   671,
1570
     291,    47,   740,   291,  -907,  -907,  -907,   744,   291,   620,
1571
     622,  -907,   -47,   548,  -907,   746,   742,   623,   626,   627,
1572
     629,   186,   631,   291,   291,   291,   653,  -907,   644,  -907,
1573
     -42,   -31,   374,   291,  -907,   608,   571,  -907,   600,   397,
1574
     397,  -907,  -907,   510,   510,   763,   765,   766,   768,   769,
1575
     760,   771,   772,   773,   774,   775,   776,   641,  -907,  -907,
1576
    -907,  -907,   291,   291,   291,   777,   779,   219,  -907,   778,
1577
    -907,  -907,   646,   647,   648,   649,   652,   655,   780,   786,
1578
     745,   403,   394,   394,   274,   656,   382,   186,   789,   791,
1579
     661,   249,  -907,   688,   218,   260,   268,   795,   186,   186,
1580
     186,   796,   798,   154,  -907,  -907,  -907,  -907,   687,   800,
1581
      33,   291,   291,   291,   805,   792,   670,   672,   804,   274,
1582
     673,   674,   291,   807,  -907,   808,  -907,  -907,   811,   812,
1583
     813,   675,  -907,  -907,  -907,  -907,  -907,  -907,   291,   676,
1584
     816,   291,   678,   291,   291,   291,   818,   291,   291,   291,
1585
    -907,   819,   683,   749,   291,   686,     0,   684,   685,   753,
1586
    -907,  1024,  -907,  -907,   692,  -907,   186,   186,   817,   820,
1587
     700,   210,  -907,  -907,  -907,   693,   704,   723,  -907,   730,
1588
    -907,   762,   770,   271,   709,   710,   711,   712,   713,   719,
1589
     722,   726,   727,   728,  -907,  -907,  -907,   843,   646,   647,
1590
     646,    24,   105,   721,   729,   731,    87,  -907,   738,  -907,
1591
     851,   852,   856,   305,   301,   464,   867,  -907,   732,  -907,
1592
     869,   291,   733,   739,   741,   743,   870,   759,   781,   782,
1593
     737,   737,  -907,  -907,   737,   737,   783,  -907,  -907,  -907,
1594
     784,   785,   787,   788,   790,   793,   794,   797,   799,  -907,
1595
     799,   801,   802,   871,   896,   481,   806,  -907,   897,   809,
1596
     847,   810,   814,   815,   821,  -907,   822,   842,   823,   824,
1597
     853,   828,   833,   834,   803,   835,   837,   838,  -907,   827,
1598
     924,   840,   855,   928,   857,   861,   865,   940,   825,   291,
1599
     872,   899,   890,  -907,  -907,   186,  -907,  -907,   826,  -907,
1600
     844,   845,    11,    40,  -907,   947,   291,   291,   291,   291,
1601
     952,   943,   954,   945,   956,   894,  -907,  -907,  -907,   978,
1602
     428,  -907,   979,   487,  -907,  -907,  -907,   982,   848,    44,
1603
      73,   849,  -907,   647,   646,  -907,  -907,   291,   850,   983,
1604
     291,   854,   858,  -907,   862,   839,  -907,   873,  -907,  -907,
1605
     987,   988,   990,   919,  -907,  -907,  -907,   882,  -907,  -907,
1606
    -907,  -907,   291,   291,   859,  1001,  1003,  -907,   513,   186,
1607
     186,   914,  -907,  -907,  1007,  -907,  -907,   799,   997,   881,
1608
    -907,   949,  1025,   291,  -907,  -907,  -907,  -907,   955,  1041,
1609
     980,   981,   178,  -907,  -907,  -907,   186,  -907,  -907,  -907,
1610
     923,  -907,   957,   238,   926,   925,  1061,  1064,  -907,  -907,
1611
     133,   186,   186,   933,   186,  -907,  -907,   186,  -907,   186,
1612
     932,   935,   936,   937,   938,   939,   941,   942,   944,   946,
1613
     291,   999,  -907,  -907,  -907,   948,  1000,   950,   951,  1002,
1614
    -907,   959,  -907,   973,  -907,  -907,  -907,  -907,   953,   575,
1615
     958,   960,   575,  1014,  -907,   477,  -907,  1009,   962,   964,
1616
     394,   965,   966,   967,   566,  -907,   968,   969,   970,   971,
1617
     961,   976,   974,   984,  -907,   977,  -907,   394,  1011,  -907,
1618
    1085,  -907,  1078,  1089,  -907,  -907,   989,  -907,   991,   972,
1619
     986,  1090,  1091,   291,  1096,  -907,  -907,  -907,  1115,  -907,
1620
    -907,  -907,  1117,   186,   291,  1124,  1126,  1128,  1129,  -907,
1621
    -907,   859,   575,   993,   995,  1132,  -907,  1133,  -907,  -907,
1622
    1111,   998,  1004,   575,  -907,   575,   575,  -907,   291,  -907,
1623
    -907,  -907,  -907,   186,  -907,   647,   271,  -907,  -907,  -907,
1624
    1006,  1020,   647,  -907,  -907,  -907,   313,  1135,  -907,  1092,
1625
    -907,   271,  1136,  -907,  -907,  -907,   859,  -907,  1137,  1139,
1626
    1013,  1021,  1023,  1099,  1026,  1027,  1029,  1031,  1034,  1035,
1627
    1036,  1037,  -907,  -907,  1065,  -907,   398,   612,  1098,  -907,
1628
    -907,  -907,  -907,  -907,  -907,  1130,  -907,  -907,  -907,  -907,
1629
    -907,  1039,  1044,  1042,  1163,  -907,  1113,  -907,  1043,  1046,
1630
     291,   611,  1109,   291,  -907,  1082,  1047,   291,   291,   291,
1631
     291,  1049,  1183,  1186,  1180,   186,  -907,  1187,  -907,  1143,
1632
     291,   291,   291,  1047,  -907,  -907,  -907,  -907,  1054,   925,
1633
    1055,  1056,  1083,  -907,  1057,  1059,  1060,  1062,  -907,  1063,
1634
     802,  -907,   802,  1066,  1201,  -907,  1067,  1069,  -907,  -907,
1635
    -907,  -907,  -907,  1068,  1070,  1071,  1071,  1072,   476,  -907,
1636
    -907,  -907,  -907,  1073,  1203,  1205,  -907,   557,  -907,   332,
1637
    -907,  -907,   553,  -907,  -907,  -907,   167,   380,  1196,  1077,
1638
    1079,   391,   408,   413,   453,   456,   462,   499,   506,   584,
1639
    -907,   428,  -907,  1076,   291,   291,  1103,  -907,  1105,  -907,
1640
    1106,  -907,  1107,  -907,  1108,  -907,  1110,  -907,  1112,  -907,
1641
    1114,  -907,  1080,  1084,  1176,  1088,  1093,  1094,  1095,  1097,
1642
    1100,  1101,  1102,  1104,  1116,  -907,  -907,  1216,  1047,  1047,
1643
    -907,  -907,  -907,  -907,  -907,  -907,  -907,  -907,  -907,  -907,
1644
    -907
1645
};
1646
 
1647
/* YYPGOTO[NTERM-NUM].  */
1648
static const short yypgoto[] =
1649
{
1650
    -907,  -907,  -907,  -122,    10,  -208,  -737,  -906,   284,  -907,
1651
    -509,  -907,  -196,  -907,  -451,  -460,  -502,  -907,  -863,  -907,
1652
    -907,   975,   -69,  -907,   -27,  -907,   402,  -180,   325,  -907,
1653
    -243,     2,    22,  -168,   963,  -213,   -50,    59,  -907,   -16,
1654
    -907,  -907,  -907,  1220,  -907,   -26,    19
1655
};
1656
 
1657
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
1658
   positive, shift that token.  If negative, reduce the rule which
1659
   number is the opposite.  If zero, do what YYDEFACT says.
1660
   If YYTABLE_NINF, syntax error.  */
1661
#define YYTABLE_NINF -3
1662
static const short yytable[] =
1663
{
1664
     101,   102,    65,   104,   365,   106,   107,   110,   113,   350,
1665
      63,   119,   121,   123,   370,   162,   165,   108,   108,   597,
1666
     296,   346,    66,   655,   292,   419,   422,   596,   653,   598,
1667
     146,   441,   956,   232,   222,   294,   234,   400,   411,   163,
1668
     928,     7,     8,    71,   401,   411,   360,   411,   252,   364,
1669
       7,     8,   142,   279,   852,   184,   186,   188,   223,   235,
1670
     226,   228,   136,    94,   389,   993,   395,   161,   256,   257,
1671
       7,     8,   253,   433,   139,   160,   164,   254,   259,   260,
1672
     411,   183,   399,    72,   280,   284,   285,    95,   418,   421,
1673
      73,   170,   171,   172,   219,   185,   229,   187,   231,   877,
1674
       7,     8,   526,   128,   434,    72,   225,   103,   251,   143,
1675
     140,   347,    73,   147,   442,    72,   457,   144,    72,   412,
1676
     458,   527,    73,   502,   172,    73,   413,   459,   414,    96,
1677
     172,   460,    72,   227,    72,   307,   282,   240,   283,    73,
1678
     241,    73,   242,    72,   243,  1019,  1020,   244,    65,   245,
1679
      73,     7,     8,   726,   233,   754,    63,   246,   563,    97,
1680
     293,   415,   564,   727,   297,   298,   299,   300,    66,   302,
1681
      72,   385,   295,   171,   697,     7,     8,    73,   388,    98,
1682
     522,   386,   599,    74,    72,   351,   501,   600,    75,    76,
1683
     523,    73,   315,   316,   317,   318,   319,   320,   321,   322,
1684
     323,   324,   721,   699,   764,    74,   722,   247,   248,    99,
1685
      75,    76,   608,   609,   765,    74,     7,     8,    74,   230,
1686
      75,    76,    72,    75,    76,   170,   171,   352,   100,    73,
1687
     610,   723,    74,   141,    74,   724,   172,    75,    76,    75,
1688
      76,   769,   770,    74,   510,   249,   576,   771,    75,    76,
1689
     116,   618,   621,   387,   432,   584,   135,   436,   772,   114,
1690
       7,     8,   438,   602,    72,   303,   304,   305,   603,   172,
1691
      74,    73,   148,    72,   115,    75,    76,   452,   453,   454,
1692
      73,    72,   310,   311,   250,   124,   512,   464,    73,    75,
1693
      76,   778,   659,   148,   514,   779,   152,   129,   149,   150,
1694
       7,     8,     7,     8,     7,     8,   153,   284,   285,   130,
1695
     153,   450,   162,   165,   617,   620,   478,   479,   480,   568,
1696
     286,   287,    74,    72,   118,   969,   120,    75,    76,   970,
1697
      73,    72,   122,    72,   125,    72,   126,   306,    73,   871,
1698
     154,   615,    73,     7,     8,   374,   375,   155,   511,   513,
1699
     515,   376,   483,   484,    72,   866,   156,   157,   158,   131,
1700
     159,    73,   870,   132,    74,   528,   529,   530,    72,    75,
1701
      76,   284,   285,    74,   498,    73,   539,   503,    75,    76,
1702
     133,    74,   507,   508,   286,   417,    75,    76,   517,   518,
1703
     519,   134,   546,   284,   285,   549,   137,   551,   552,   553,
1704
     461,   555,   556,   557,     7,     8,   286,   420,   561,   536,
1705
     462,   940,   145,   941,    72,   138,   127,    72,    89,    90,
1706
      91,    73,   151,    74,    73,   577,   378,   379,    75,    76,
1707
     153,    74,   380,    74,   167,    74,    75,    76,    75,    76,
1708
      75,    76,   639,    65,   169,   640,   641,   224,   571,   572,
1709
     236,    63,   284,   285,    74,   237,   570,   570,   238,    75,
1710
      76,   963,   964,    66,   175,   286,   500,   616,    74,   179,
1711
     180,   965,   966,    75,    76,   628,   239,   338,   339,   340,
1712
     341,   284,   285,   296,   365,   625,   400,   189,   190,   191,
1713
     192,   255,   193,   194,   258,   195,   196,   197,   198,   199,
1714
     200,   148,   391,   392,   393,   261,   149,   497,   201,   394,
1715
     202,   203,     7,     8,   105,   262,   204,   111,   205,    75,
1716
      76,   263,    75,    76,   173,   174,   175,   176,   264,   177,
1717
     178,   179,   180,   804,   284,   285,   807,    88,   971,    89,
1718
      90,    91,   972,   690,    92,   206,   265,   286,   619,   976,
1719
     181,   182,   207,   977,   712,   713,   714,   208,   209,   210,
1720
     701,   702,   703,   704,   286,   658,   978,   211,   212,   213,
1721
     979,   980,   214,   334,   335,   981,   336,   175,   284,   337,
1722
     177,   178,   179,   180,   266,   693,   267,   338,   339,   340,
1723
     341,   728,   698,   251,   731,   268,   853,   954,   955,   342,
1724
     343,   344,   712,   713,   714,   215,   216,   861,   867,   862,
1725
     863,   982,   717,   718,   984,   983,   742,   743,   985,   269,
1726
     986,   314,   270,   875,   987,   271,   173,   174,   175,   176,
1727
     272,   177,   178,   179,   180,   273,   173,   759,   175,   176,
1728
     296,   177,   178,   179,   180,   217,   218,   809,   810,   811,
1729
      75,    76,   181,   182,   748,   749,   274,   988,   775,   750,
1730
     751,   989,   181,   182,   990,   173,   275,   175,   991,   276,
1731
     177,   178,   179,   180,   277,   175,   278,   893,   177,   178,
1732
     179,   180,   284,   285,   794,   281,   766,   820,   821,   290,
1733
     816,   181,   182,   961,   962,   291,   783,   967,   968,   181,
1734
     182,   780,   781,    81,   570,   954,   955,   831,    82,    83,
1735
     301,   308,    84,    85,   312,   313,   349,    86,    87,   904,
1736
     905,   906,   907,   353,   354,   325,   326,   327,   328,   355,
1737
     329,   356,   357,   330,   366,   331,   332,   333,   347,   367,
1738
     358,   359,   368,   369,   371,   373,   377,   842,   381,   382,
1739
     383,   384,   390,   396,   397,   398,   402,   403,   847,   404,
1740
     405,   408,   406,   407,   409,   410,   435,   416,   423,   431,
1741
     437,   424,   444,   425,   426,   427,   428,   429,   445,   455,
1742
     456,   446,   864,   430,   447,   439,   448,   440,   449,   465,
1743
     451,   466,   467,   846,   468,   469,   470,   471,   472,   473,
1744
     474,   475,   476,   481,   477,   482,   494,   490,   491,   486,
1745
     488,   492,   495,   485,   493,   504,   496,   505,   499,   506,
1746
     509,   516,   520,   865,   521,   524,   525,   531,   532,   533,
1747
     535,   534,   538,   540,   541,   537,   872,   542,   543,   544,
1748
     545,   547,   548,   550,   554,   558,   559,   560,   562,   565,
1749
     566,   567,   569,   573,   903,   578,   574,   910,   575,   580,
1750
     582,   914,   915,   916,   917,   581,   579,   585,   583,   595,
1751
     586,   587,   588,   589,   925,   926,   927,   590,    -2,     1,
1752
     591,   611,   930,   605,   592,   593,   594,   612,   613,   607,
1753
       2,   606,   614,   622,   623,   624,   633,   630,   629,   631,
1754
     637,   632,     3,     4,     5,   922,     6,   656,     7,     8,
1755
       9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
1756
      19,   634,    20,    21,    22,    23,    24,    25,    26,    27,
1757
      28,    29,   657,   661,    30,    31,    32,    33,    34,   663,
1758
     669,   642,   643,   635,   636,   645,   646,   644,   995,   996,
1759
     681,   672,   647,   683,   684,   685,   648,   649,   680,   686,
1760
     650,   676,   651,   687,   654,   603,   688,   692,   660,   691,
1761
     148,   662,   664,   700,    35,    36,   665,   666,   705,   706,
1762
     707,   708,   709,   667,   694,   710,   689,   668,   670,   671,
1763
     673,    37,    38,    39,    40,   674,   675,   677,    41,   678,
1764
     679,    42,    43,   682,   711,   716,   695,   696,   719,   730,
1765
     720,   725,   735,   737,   738,   729,   739,   740,   741,   732,
1766
     733,    44,   744,   755,    45,    46,    47,   734,    48,    49,
1767
      50,    51,    52,    53,    54,    55,     2,   746,   736,   747,
1768
     752,    56,    57,   753,    58,    59,   756,   757,     3,     4,
1769
       5,   758,     6,   760,     7,     8,     9,    10,    11,    12,
1770
      13,    14,    15,    16,    17,    18,    19,   761,    20,    21,
1771
      22,    23,    24,    25,    26,    27,    28,    29,   762,   763,
1772
      30,    31,    32,    33,    34,   767,   773,   776,   768,   774,
1773
     777,   782,   784,   785,   786,   787,   788,   795,   797,   802,
1774
     800,   789,   801,   790,   791,   808,   792,   813,   793,   832,
1775
     796,   833,   798,   799,   834,   835,   840,   841,   803,   826,
1776
      35,    36,   843,   805,   814,   806,   815,   817,   818,   819,
1777
     822,   823,   824,   825,   827,   838,   828,    37,    38,    39,
1778
      40,   844,   830,   858,    41,   845,   829,    42,    43,   839,
1779
     848,   836,   849,   837,   850,   851,   854,   855,   856,   857,
1780
     859,   873,   876,   878,   874,   879,   860,    44,   868,   894,
1781
      45,    46,    47,   880,    48,    49,    50,    51,    52,    53,
1782
      54,    55,   869,   411,   881,   882,   883,    56,    57,   884,
1783
      58,    59,   885,   886,   887,   888,   889,   890,   891,   899,
1784
     895,   896,   897,   901,   898,   900,   902,   909,   911,   919,
1785
     912,   918,   920,   921,   924,   923,   929,   931,   932,   934,
1786
     933,   935,   936,   943,   937,   944,   938,   945,   942,   959,
1787
     946,   960,   973,   947,   949,   952,   958,   974,   994,   975,
1788
     997,   998,  1005,   999,  1000,  1001,  1006,  1002,  1007,  1003,
1789
    1008,  1004,  1018,   992,   112,  1009,  1010,  1011,   892,  1012,
1790
       0,   951,  1013,  1014,  1015,     0,  1016,     0,   443,     0,
1791
       0,     0,     0,     0,     0,   463,     0,     0,  1017
1792
};
1793
 
1794
static const short yycheck[] =
1795
{
1796
      26,    27,     0,    29,   217,    31,    32,    33,    34,   205,
1797
       0,    38,    39,    40,   222,    65,    66,    33,    34,   479,
1798
      72,   201,     0,   532,   146,   268,   269,   478,   530,   480,
1799
      78,    78,   938,    28,    84,    26,   143,   250,    84,    65,
1800
     903,    30,    31,   163,   252,    84,    26,    84,    98,   217,
1801
      30,    31,    26,    26,   791,    81,    82,    83,    84,   166,
1802
      86,    87,    52,    98,   244,   971,   246,    65,    26,    27,
1803
      30,    31,    98,    26,    28,    65,    66,   103,    26,    27,
1804
      84,    26,   250,    63,    57,    70,    71,    98,   268,   269,
1805
      70,    72,    73,    74,    84,    26,    26,    26,    88,   836,
1806
      30,    31,    69,    44,    57,    63,    26,   163,    98,    83,
1807
      64,   163,    70,   161,   161,    63,   158,    58,    63,   165,
1808
     162,    88,    70,   366,   105,    70,   165,   158,   165,    98,
1809
     111,   162,    63,    26,    63,   161,   158,    16,   160,    70,
1810
      19,    70,    21,    63,    23,  1008,  1009,    26,   146,    28,
1811
      70,    30,    31,   613,   149,   657,   146,    36,   158,    98,
1812
     150,   165,   162,   614,   154,   155,   156,   157,   146,   159,
1813
      63,    26,   163,   154,   163,    30,    31,    70,   163,    98,
1814
      26,    36,   158,   163,    63,    26,   366,   163,   168,   169,
1815
      36,    70,   173,   174,   175,   176,   177,   178,   179,   180,
1816
     181,   182,   158,   163,    26,   163,   162,    86,    87,    26,
1817
     168,   169,   125,   126,    36,   163,    30,    31,   163,   149,
1818
     168,   169,    63,   168,   169,   206,   207,    26,    26,    70,
1819
     143,   158,   163,    26,   163,   162,   217,   168,   169,   168,
1820
     169,     3,     4,   163,    26,   124,    36,     9,   168,   169,
1821
     164,   494,   495,   243,   280,   463,    26,   283,    20,   163,
1822
      30,    31,   288,   158,    63,    91,    92,    93,   163,   250,
1823
     163,    70,    98,    63,   163,   168,   169,   303,   304,   305,
1824
      70,    63,   135,   136,   163,   163,    26,   313,    70,   168,
1825
     169,   158,   535,    98,    26,   162,    26,   163,   103,   104,
1826
      30,    31,    30,    31,    30,    31,    36,    70,    71,   163,
1827
      36,   301,   362,   363,   494,   495,   342,   343,   344,   441,
1828
      83,    84,   163,    63,   164,   158,   164,   168,   169,   162,
1829
      70,    63,   164,    63,   164,    63,   164,   163,    70,    26,
1830
      70,    36,    70,    30,    31,   106,   107,    77,   374,   375,
1831
     376,   112,   133,   134,    63,   815,    86,    87,    88,   163,
1832
      90,    70,   822,   163,   163,   391,   392,   393,    63,   168,
1833
     169,    70,    71,   163,   364,    70,   402,   367,   168,   169,
1834
     163,   163,   133,   134,    83,    84,   168,   169,   378,   379,
1835
     380,   163,   418,    70,    71,   421,   163,   423,   424,   425,
1836
      26,   427,   428,   429,    30,    31,    83,    84,   434,   399,
1837
      36,   920,     0,   922,    63,   163,    98,    63,   100,   101,
1838
     102,    70,    98,   163,    70,   451,   106,   107,   168,   169,
1839
      36,   163,   112,   163,   163,   163,   168,   169,   168,   169,
1840
     168,   169,   511,   441,    26,   514,   515,    26,   446,   447,
1841
      36,   441,    70,    71,   163,    36,   446,   447,    36,   168,
1842
     169,   129,   130,   441,    67,    83,    84,   493,   163,    72,
1843
      73,   139,   140,   168,   169,   501,    36,    79,    80,    81,
1844
      82,    70,    71,    72,   697,   501,   699,     5,     6,     7,
1845
       8,    26,    10,    11,   173,    13,    14,    15,    16,    17,
1846
      18,    98,    91,    92,    93,    26,   103,   104,    26,    98,
1847
      28,    29,    30,    31,   163,    26,    34,   163,    36,   168,
1848
     169,    26,   168,   169,    65,    66,    67,    68,    26,    70,
1849
      71,    72,    73,   729,    70,    71,   732,    98,   158,   100,
1850
     101,   102,   162,   569,   105,    63,    26,    83,    84,   158,
1851
      91,    92,    70,   162,   126,   127,   128,    75,    76,    77,
1852
     586,   587,   588,   589,    83,    84,   158,    85,    86,    87,
1853
     162,   158,    90,    65,    66,   162,    68,    67,    70,    71,
1854
      70,    71,    72,    73,    26,   575,    26,    79,    80,    81,
1855
      82,   617,   582,   583,   620,    26,   792,   121,   122,    91,
1856
      92,    93,   126,   127,   128,   123,   124,   803,   816,   805,
1857
     806,   158,   125,   126,   158,   162,   642,   643,   162,    26,
1858
     158,   162,    28,   831,   162,    26,    65,    66,    67,    68,
1859
      26,    70,    71,    72,    73,    26,    65,   663,    67,    68,
1860
      72,    70,    71,    72,    73,   163,   164,   170,   171,   172,
1861
     168,   169,    91,    92,   141,   142,    26,   158,   685,   649,
1862
     650,   162,    91,    92,   158,    65,    26,    67,   162,    26,
1863
      70,    71,    72,    73,    36,    67,    26,   857,    70,    71,
1864
      72,    73,    70,    71,   710,    28,   676,   121,   122,    26,
1865
     740,    91,    92,   136,   137,    28,   694,   144,   145,    91,
1866
      92,   691,   692,    89,   694,   121,   122,   757,    94,    95,
1867
     163,   163,    98,    99,   158,   160,    71,   103,   104,   108,
1868
     109,   110,   111,    26,    26,   163,   163,   163,   163,    26,
1869
     163,    26,    26,   163,    26,   163,   163,   163,   163,    71,
1870
     164,   164,   163,   163,   163,   163,   163,   773,   163,   163,
1871
     163,    26,    98,    36,    36,   164,   158,    98,   784,   162,
1872
      71,    71,   174,   162,   158,   158,    26,   162,   158,    98,
1873
      26,   158,    26,   158,   158,   158,   158,   158,    36,   126,
1874
     136,   158,   808,   162,   158,   165,   159,   165,   159,    26,
1875
     159,    26,    26,   783,    26,    26,    36,    26,    26,    26,
1876
      26,    26,    26,    26,   163,    26,    26,   159,   159,   163,
1877
     163,   159,    26,    35,   159,    26,    71,    26,   162,   158,
1878
     132,    26,    26,   813,    26,   138,    26,    22,    36,   159,
1879
      26,   159,   158,    26,    26,   162,   826,    26,    26,    26,
1880
     165,   165,    26,   165,    26,    26,   163,    98,   162,   165,
1881
     165,    98,   160,    36,   880,   162,    36,   883,   158,   136,
1882
      98,   887,   888,   889,   890,   135,   162,   158,    98,    26,
1883
     160,   160,   160,   160,   900,   901,   902,   158,     0,     1,
1884
     158,   143,   909,   162,   158,   158,   158,    36,    36,   158,
1885
      12,   162,    36,    26,   162,    26,    26,   158,   165,   158,
1886
     163,   158,    24,    25,    26,   895,    28,    36,    30,    31,
1887
      32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
1888
      42,   162,    44,    45,    46,    47,    48,    49,    50,    51,
1889
      52,    53,    36,    36,    56,    57,    58,    59,    60,    92,
1890
      98,   158,   158,   162,   162,   158,   158,   162,   974,   975,
1891
      26,    98,   162,    98,    26,    98,   163,   163,   131,    98,
1892
     163,   158,   163,    98,   163,   163,    26,    77,   162,    70,
1893
      98,   162,   162,    26,    96,    97,   162,   162,    26,    36,
1894
      26,    36,    26,   162,   158,    91,   161,   165,   165,   165,
1895
     162,   113,   114,   115,   116,   162,   162,   162,   120,   162,
1896
     162,   123,   124,   163,    26,    26,   162,   162,    26,    26,
1897
     162,   162,   173,    26,    26,   165,    26,    98,   136,   165,
1898
     162,   143,   163,    26,   146,   147,   148,   165,   150,   151,
1899
     152,   153,   154,   155,   156,   157,    12,    36,   165,    36,
1900
     126,   163,   164,    36,   166,   167,   165,    98,    24,    25,
1901
      26,    26,    28,    98,    30,    31,    32,    33,    34,    35,
1902
      36,    37,    38,    39,    40,    41,    42,    26,    44,    45,
1903
      46,    47,    48,    49,    50,    51,    52,    53,    98,    98,
1904
      56,    57,    58,    59,    60,   162,   160,    26,   131,   164,
1905
      26,   158,   160,   158,   158,   158,   158,    98,    98,   126,
1906
      98,   162,   143,   162,   162,    91,   162,    98,   162,    98,
1907
     162,    26,   162,   162,    36,    26,    26,    26,   165,   158,
1908
      96,    97,    26,   165,   162,   165,   162,   162,   162,   162,
1909
     162,   162,   162,   162,   158,   163,   162,   113,   114,   115,
1910
     116,    26,   165,    32,   120,    28,   162,   123,   124,   163,
1911
      26,   162,    26,   162,    26,    26,   163,   162,    26,    26,
1912
     162,    26,    26,    26,    72,    26,   162,   143,   162,    71,
1913
     146,   147,   148,   160,   150,   151,   152,   153,   154,   155,
1914
     156,   157,   162,    84,   163,   162,   160,   163,   164,   162,
1915
     166,   167,   163,   162,   160,   160,   160,   160,   133,    36,
1916
      70,   162,   158,   160,   162,    92,   160,    98,   126,    26,
1917
     163,   162,    26,    33,    71,    28,   162,   162,   162,   162,
1918
     137,   162,   162,    22,   162,   158,   163,   158,   162,    26,
1919
     162,    26,    36,   163,   163,   163,   163,   160,   162,   160,
1920
     137,   136,   162,   137,   137,   137,   162,   137,    72,   137,
1921
     162,   137,    36,   969,    34,   162,   162,   162,   856,   162,
1922
      -1,   936,   162,   162,   162,    -1,   162,    -1,   293,    -1,
1923
      -1,    -1,    -1,    -1,    -1,   312,    -1,    -1,   162
1924
};
1925
 
1926
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1927
   symbol of state STATE-NUM.  */
1928
static const unsigned char yystos[] =
1929
{
1930
       0,     1,    12,    24,    25,    26,    28,    30,    31,    32,
1931
      33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
1932
      44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
1933
      56,    57,    58,    59,    60,    96,    97,   113,   114,   115,
1934
     116,   120,   123,   124,   143,   146,   147,   148,   150,   151,
1935
     152,   153,   154,   155,   156,   157,   163,   164,   166,   167,
1936
     176,   177,   178,   179,   198,   206,   207,   208,   209,   210,
1937
     213,   163,    63,    70,   163,   168,   169,   214,   219,   220,
1938
     221,    89,    94,    95,    98,    99,   103,   104,    98,   100,
1939
     101,   102,   105,   212,    98,    98,    98,    98,    98,    26,
1940
      26,   220,   220,   163,   220,   163,   220,   220,   214,   218,
1941
     220,   163,   218,   220,   163,   163,   164,   199,   164,   199,
1942
     164,   199,   164,   199,   163,   164,   164,    98,   212,   163,
1943
     163,   163,   163,   163,   163,    26,   179,   163,   163,    28,
1944
      64,    26,    26,    83,   212,     0,    78,   161,    98,   103,
1945
     104,    98,    26,    36,    70,    77,    86,    87,    88,    90,
1946
     179,   206,   211,   220,   179,   211,   211,   163,   180,    26,
1947
     221,   221,   221,    65,    66,    67,    68,    70,    71,    72,
1948
      73,    91,    92,    26,   220,    26,   220,    26,   220,     5,
1949
       6,     7,     8,    10,    11,    13,    14,    15,    16,    17,
1950
      18,    26,    28,    29,    34,    36,    63,    70,    75,    76,
1951
      77,    85,    86,    87,    90,   123,   124,   163,   164,   179,
1952
     195,   200,   211,   220,    26,    26,   220,    26,   220,    26,
1953
     149,   179,    28,   149,   143,   166,    36,    36,    36,    36,
1954
      16,    19,    21,    23,    26,    28,    36,    86,    87,   124,
1955
     163,   179,   211,   220,   220,    26,    26,    27,   173,    26,
1956
      27,    26,    26,    26,    26,    26,    26,    26,    26,    26,
1957
      28,    26,    26,    26,    26,    26,    26,    36,    26,    26,
1958
      57,    28,   158,   160,    70,    71,    83,    84,   202,   205,
1959
      26,    28,   178,   179,    26,   163,    72,   179,   179,   179,
1960
     179,   163,   179,    91,    92,    93,   163,   220,   163,   196,
1961
     135,   136,   158,   160,   162,   221,   221,   221,   221,   221,
1962
     221,   221,   221,   221,   221,   163,   163,   163,   163,   163,
1963
     163,   163,   163,   163,    65,    66,    68,    71,    79,    80,
1964
      81,    82,    91,    92,    93,   201,   202,   163,   187,    71,
1965
     187,    26,    26,    26,    26,    26,    26,    26,   164,   164,
1966
      26,   179,   206,   207,   208,   210,    26,    71,   163,   163,
1967
     180,   163,   188,   163,   106,   107,   112,   163,   106,   107,
1968
     112,   163,   163,   163,    26,    26,    36,   179,   163,   202,
1969
      98,    91,    92,    93,    98,   202,    36,    36,   164,   208,
1970
     210,   180,   158,    98,   162,    71,   174,   162,    71,   158,
1971
     158,    84,   165,   165,   165,   165,   162,    84,   202,   205,
1972
      84,   202,   205,   158,   158,   158,   158,   158,   158,   158,
1973
     162,    98,   220,    26,    57,    26,   220,    26,   220,   165,
1974
     165,    78,   161,   196,    26,    36,   158,   158,   159,   159,
1975
     179,   159,   220,   220,   220,   126,   136,   158,   162,   158,
1976
     162,    26,    36,   209,   220,    26,    26,    26,    26,    26,
1977
      36,    26,    26,    26,    26,    26,    26,   163,   220,   220,
1978
     220,    26,    26,   133,   134,    35,   163,   189,   163,   190,
1979
     159,   159,   159,   159,    26,    26,    71,   104,   179,   162,
1980
      84,   202,   205,   179,    26,    26,   158,   133,   134,   132,
1981
      26,   220,    26,   220,    26,   220,    26,   179,   179,   179,
1982
      26,    26,    26,    36,   138,    26,    69,    88,   220,   220,
1983
     220,    22,    36,   159,   159,    26,   179,   162,   158,   220,
1984
      26,    26,    26,    26,    26,   165,   220,   165,    26,   220,
1985
     165,   220,   220,   220,    26,   220,   220,   220,    26,   163,
1986
      98,   220,   162,   158,   162,   165,   165,    98,   178,   160,
1987
     179,   206,   206,    36,    36,   158,    36,   220,   162,   162,
1988
     136,   135,    98,    98,   180,   158,   160,   160,   160,   160,
1989
     158,   158,   158,   158,   158,    26,   189,   190,   189,   158,
1990
     163,   184,   158,   163,   185,   162,   162,   158,   125,   126,
1991
     143,   143,    36,    36,    36,    36,   220,   202,   205,    84,
1992
     202,   205,    26,   162,    26,   214,   216,   217,   220,   165,
1993
     158,   158,   158,    26,   162,   162,   162,   163,   197,   197,
1994
     197,   197,   158,   158,   162,   158,   158,   162,   163,   163,
1995
     163,   163,   191,   191,   163,   185,    36,    36,    84,   205,
1996
     162,    36,   162,    92,   162,   162,   162,   162,   165,    98,
1997
     165,   165,    98,   162,   162,   162,   158,   162,   162,   162,
1998
     131,    26,   163,    98,    26,    98,    98,    98,    26,   161,
1999
     220,    70,    77,   179,   158,   162,   162,   163,   179,   163,
2000
      26,   220,   220,   220,   220,    26,    36,    26,    36,    26,
2001
      91,    26,   126,   127,   128,   182,    26,   125,   126,    26,
2002
     162,   158,   162,   158,   162,   162,   190,   189,   220,   165,
2003
      26,   220,   165,   162,   165,   173,   165,    26,    26,    26,
2004
      98,   136,   220,   220,   163,   181,    36,    36,   141,   142,
2005
     179,   179,   126,    36,   191,    26,   165,    98,    26,   220,
2006
      98,    26,    98,    98,    26,    36,   179,   162,   131,     3,
2007
       4,     9,    20,   160,   164,   199,    26,    26,   158,   162,
2008
     179,   179,   158,   206,   160,   158,   158,   158,   158,   162,
2009
     162,   162,   162,   162,   220,    98,   162,    98,   162,   162,
2010
      98,   143,   126,   165,   187,   165,   165,   187,    91,   170,
2011
     171,   172,   215,    98,   162,   162,   211,   162,   162,   162,
2012
     121,   122,   162,   162,   162,   162,   158,   158,   162,   162,
2013
     165,   211,    98,    26,    36,    26,   162,   162,   163,   163,
2014
      26,    26,   220,    26,    26,    28,   179,   220,    26,    26,
2015
      26,    26,   181,   187,   163,   162,    26,    26,    32,   162,
2016
     162,   187,   187,   187,   220,   179,   190,   180,   162,   162,
2017
     190,    26,   179,    26,    72,   180,    26,   181,    26,    26,
2018
     160,   163,   162,   160,   162,   163,   162,   160,   160,   160,
2019
     160,   133,   201,   202,    71,    70,   162,   158,   162,    36,
2020
      92,   160,   160,   220,   108,   109,   110,   111,   192,    98,
2021
     220,   126,   163,   193,   220,   220,   220,   220,   162,    26,
2022
      26,    33,   179,    28,    71,   220,   220,   220,   193,   162,
2023
     199,   162,   162,   137,   162,   162,   162,   162,   163,   186,
2024
     185,   185,   162,    22,   158,   158,   162,   163,   194,   163,
2025
     203,   203,   163,   204,   121,   122,   182,   183,   163,    26,
2026
      26,   136,   137,   129,   130,   139,   140,   144,   145,   158,
2027
     162,   158,   162,    36,   160,   160,   158,   162,   158,   162,
2028
     158,   162,   158,   162,   158,   162,   158,   162,   158,   162,
2029
     158,   162,   183,   182,   162,   220,   220,   137,   136,   137,
2030
     137,   137,   137,   137,   137,   162,   162,    72,   162,   162,
2031
     162,   162,   162,   162,   162,   162,   162,   162,    36,   193,
2032
     193
2033
};
2034
 
2035
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
2036
# define YYSIZE_T __SIZE_TYPE__
2037
#endif
2038
#if ! defined (YYSIZE_T) && defined (size_t)
2039
# define YYSIZE_T size_t
2040
#endif
2041
#if ! defined (YYSIZE_T)
2042
# if defined (__STDC__) || defined (__cplusplus)
2043
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2044
#  define YYSIZE_T size_t
2045
# endif
2046
#endif
2047
#if ! defined (YYSIZE_T)
2048
# define YYSIZE_T unsigned int
2049
#endif
2050
 
2051
#define yyerrok         (yyerrstatus = 0)
2052
#define yyclearin       (yychar = YYEMPTY)
2053
#define YYEMPTY         (-2)
2054
#define YYEOF           0
2055
 
2056
#define YYACCEPT        goto yyacceptlab
2057
#define YYABORT         goto yyabortlab
2058
#define YYERROR         goto yyerrorlab
2059
 
2060
 
2061
/* Like YYERROR except do call yyerror.  This remains here temporarily
2062
   to ease the transition to the new meaning of YYERROR, for GCC.
2063
   Once GCC version 2 has supplanted version 1, this can go.  */
2064
 
2065
#define YYFAIL          goto yyerrlab
2066
 
2067
#define YYRECOVERING()  (!!yyerrstatus)
2068
 
2069
#define YYBACKUP(Token, Value)                                  \
2070
do                                                              \
2071
  if (yychar == YYEMPTY && yylen == 1)                          \
2072
    {                                                           \
2073
      yychar = (Token);                                         \
2074
      yylval = (Value);                                         \
2075
      yytoken = YYTRANSLATE (yychar);                           \
2076
      YYPOPSTACK;                                               \
2077
      goto yybackup;                                            \
2078
    }                                                           \
2079
  else                                                          \
2080
    {                                                           \
2081
      yyerror ("syntax error: cannot back up");\
2082
      YYERROR;                                                  \
2083
    }                                                           \
2084
while (0)
2085
 
2086
#define YYTERROR        1
2087
#define YYERRCODE       256
2088
 
2089
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
2090
   are run).  */
2091
 
2092
#ifndef YYLLOC_DEFAULT
2093
# define YYLLOC_DEFAULT(Current, Rhs, N)                \
2094
   ((Current).first_line   = (Rhs)[1].first_line,       \
2095
    (Current).first_column = (Rhs)[1].first_column,     \
2096
    (Current).last_line    = (Rhs)[N].last_line,        \
2097
    (Current).last_column  = (Rhs)[N].last_column)
2098
#endif
2099
 
2100
/* YYLEX -- calling `yylex' with the right arguments.  */
2101
 
2102
#ifdef YYLEX_PARAM
2103
# define YYLEX yylex (YYLEX_PARAM)
2104
#else
2105
# define YYLEX yylex ()
2106
#endif
2107
 
2108
/* Enable debugging if requested.  */
2109
#if YYDEBUG
2110
 
2111
# ifndef YYFPRINTF
2112
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2113
#  define YYFPRINTF fprintf
2114
# endif
2115
 
2116
# define YYDPRINTF(Args)                        \
2117
do {                                            \
2118
  if (yydebug)                                  \
2119
    YYFPRINTF Args;                             \
2120
} while (0)
2121
 
2122
# define YYDSYMPRINT(Args)                      \
2123
do {                                            \
2124
  if (yydebug)                                  \
2125
    yysymprint Args;                            \
2126
} while (0)
2127
 
2128
# define YYDSYMPRINTF(Title, Token, Value, Location)            \
2129
do {                                                            \
2130
  if (yydebug)                                                  \
2131
    {                                                           \
2132
      YYFPRINTF (stderr, "%s ", Title);                         \
2133
      yysymprint (stderr,                                       \
2134
                  Token, Value);        \
2135
      YYFPRINTF (stderr, "\n");                                 \
2136
    }                                                           \
2137
} while (0)
2138
 
2139
/*------------------------------------------------------------------.
2140
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
2141
| TOP (included).                                                   |
2142
`------------------------------------------------------------------*/
2143
 
2144
#if defined (__STDC__) || defined (__cplusplus)
2145
static void
2146
yy_stack_print (short *bottom, short *top)
2147
#else
2148
static void
2149
yy_stack_print (bottom, top)
2150
    short *bottom;
2151
    short *top;
2152
#endif
2153
{
2154
  YYFPRINTF (stderr, "Stack now");
2155
  for (/* Nothing. */; bottom <= top; ++bottom)
2156
    YYFPRINTF (stderr, " %d", *bottom);
2157
  YYFPRINTF (stderr, "\n");
2158
}
2159
 
2160
# define YY_STACK_PRINT(Bottom, Top)                            \
2161
do {                                                            \
2162
  if (yydebug)                                                  \
2163
    yy_stack_print ((Bottom), (Top));                           \
2164
} while (0)
2165
 
2166
 
2167
/*------------------------------------------------.
2168
| Report that the YYRULE is going to be reduced.  |
2169
`------------------------------------------------*/
2170
 
2171
#if defined (__STDC__) || defined (__cplusplus)
2172
static void
2173
yy_reduce_print (int yyrule)
2174
#else
2175
static void
2176
yy_reduce_print (yyrule)
2177
    int yyrule;
2178
#endif
2179
{
2180
  int yyi;
2181
  unsigned int yylno = yyrline[yyrule];
2182
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
2183
             yyrule - 1, yylno);
2184
  /* Print the symbols being reduced, and their result.  */
2185
  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2186
    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
2187
  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
2188
}
2189
 
2190
# define YY_REDUCE_PRINT(Rule)          \
2191
do {                                    \
2192
  if (yydebug)                          \
2193
    yy_reduce_print (Rule);             \
2194
} while (0)
2195
 
2196
/* Nonzero means print parse trace.  It is left uninitialized so that
2197
   multiple parsers can coexist.  */
2198
int yydebug;
2199
#else /* !YYDEBUG */
2200
# define YYDPRINTF(Args)
2201
# define YYDSYMPRINT(Args)
2202
# define YYDSYMPRINTF(Title, Token, Value, Location)
2203
# define YY_STACK_PRINT(Bottom, Top)
2204
# define YY_REDUCE_PRINT(Rule)
2205
#endif /* !YYDEBUG */
2206
 
2207
 
2208
/* YYINITDEPTH -- initial size of the parser's stacks.  */
2209
#ifndef YYINITDEPTH
2210
# define YYINITDEPTH 200
2211
#endif
2212
 
2213
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2214
   if the built-in stack extension method is used).
2215
 
2216
   Do not make this value too large; the results are undefined if
2217
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
2218
   evaluated with infinite-precision integer arithmetic.  */
2219
 
2220
#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
2221
# undef YYMAXDEPTH
2222
#endif
2223
 
2224
#ifndef YYMAXDEPTH
2225
# define YYMAXDEPTH 10000
2226
#endif
2227
 
2228
 
2229
 
2230
#if YYERROR_VERBOSE
2231
 
2232
# ifndef yystrlen
2233
#  if defined (__GLIBC__) && defined (_STRING_H)
2234
#   define yystrlen strlen
2235
#  else
2236
/* Return the length of YYSTR.  */
2237
static YYSIZE_T
2238
#   if defined (__STDC__) || defined (__cplusplus)
2239
yystrlen (const char *yystr)
2240
#   else
2241
yystrlen (yystr)
2242
     const char *yystr;
2243
#   endif
2244
{
2245
  register const char *yys = yystr;
2246
 
2247
  while (*yys++ != '\0')
2248
    continue;
2249
 
2250
  return yys - yystr - 1;
2251
}
2252
#  endif
2253
# endif
2254
 
2255
# ifndef yystpcpy
2256
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2257
#   define yystpcpy stpcpy
2258
#  else
2259
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2260
   YYDEST.  */
2261
static char *
2262
#   if defined (__STDC__) || defined (__cplusplus)
2263
yystpcpy (char *yydest, const char *yysrc)
2264
#   else
2265
yystpcpy (yydest, yysrc)
2266
     char *yydest;
2267
     const char *yysrc;
2268
#   endif
2269
{
2270
  register char *yyd = yydest;
2271
  register const char *yys = yysrc;
2272
 
2273
  while ((*yyd++ = *yys++) != '\0')
2274
    continue;
2275
 
2276
  return yyd - 1;
2277
}
2278
#  endif
2279
# endif
2280
 
2281
#endif /* !YYERROR_VERBOSE */
2282
 
2283
 
2284
 
2285
#if YYDEBUG
2286
/*--------------------------------.
2287
| Print this symbol on YYOUTPUT.  |
2288
`--------------------------------*/
2289
 
2290
#if defined (__STDC__) || defined (__cplusplus)
2291
static void
2292
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2293
#else
2294
static void
2295
yysymprint (yyoutput, yytype, yyvaluep)
2296
    FILE *yyoutput;
2297
    int yytype;
2298
    YYSTYPE *yyvaluep;
2299
#endif
2300
{
2301
  /* Pacify ``unused variable'' warnings.  */
2302
  (void) yyvaluep;
2303
 
2304
  if (yytype < YYNTOKENS)
2305
    {
2306
      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2307
# ifdef YYPRINT
2308
      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2309
# endif
2310
    }
2311
  else
2312
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2313
 
2314
  switch (yytype)
2315
    {
2316
      default:
2317
        break;
2318
    }
2319
  YYFPRINTF (yyoutput, ")");
2320
}
2321
 
2322
#endif /* ! YYDEBUG */
2323
/*-----------------------------------------------.
2324
| Release the memory associated to this symbol.  |
2325
`-----------------------------------------------*/
2326
 
2327
#if defined (__STDC__) || defined (__cplusplus)
2328
static void
2329
yydestruct (int yytype, YYSTYPE *yyvaluep)
2330
#else
2331
static void
2332
yydestruct (yytype, yyvaluep)
2333
    int yytype;
2334
    YYSTYPE *yyvaluep;
2335
#endif
2336
{
2337
  /* Pacify ``unused variable'' warnings.  */
2338
  (void) yyvaluep;
2339
 
2340
  switch (yytype)
2341
    {
2342
 
2343
      default:
2344
        break;
2345
    }
2346
}
2347
 
2348
 
2349
/* Prevent warnings from -Wmissing-prototypes.  */
2350
 
2351
#ifdef YYPARSE_PARAM
2352
# if defined (__STDC__) || defined (__cplusplus)
2353
int yyparse (void *YYPARSE_PARAM);
2354
# else
2355
int yyparse ();
2356
# endif
2357
#else /* ! YYPARSE_PARAM */
2358
#if defined (__STDC__) || defined (__cplusplus)
2359
int yyparse (void);
2360
#else
2361
int yyparse ();
2362
#endif
2363
#endif /* ! YYPARSE_PARAM */
2364
 
2365
 
2366
 
2367
/* The lookahead symbol.  */
2368
int yychar;
2369
 
2370
/* The semantic value of the lookahead symbol.  */
2371
YYSTYPE yylval;
2372
 
2373
/* Number of syntax errors so far.  */
2374
int yynerrs;
2375
 
2376
 
2377
 
2378
/*----------.
2379
| yyparse.  |
2380
`----------*/
2381
 
2382
#ifdef YYPARSE_PARAM
2383
# if defined (__STDC__) || defined (__cplusplus)
2384
int yyparse (void *YYPARSE_PARAM)
2385
# else
2386
int yyparse (YYPARSE_PARAM)
2387
  void *YYPARSE_PARAM;
2388
# endif
2389
#else /* ! YYPARSE_PARAM */
2390
#if defined (__STDC__) || defined (__cplusplus)
2391
int
2392
yyparse (void)
2393
#else
2394
int
2395
yyparse ()
2396
 
2397
#endif
2398
#endif
2399
{
2400
 
2401
  register int yystate;
2402
  register int yyn;
2403
  int yyresult;
2404
  /* Number of tokens to shift before error messages enabled.  */
2405
  int yyerrstatus;
2406
  /* Lookahead token as an internal (translated) token number.  */
2407
  int yytoken = 0;
2408
 
2409
  /* Three stacks and their tools:
2410
     `yyss': related to states,
2411
     `yyvs': related to semantic values,
2412
     `yyls': related to locations.
2413
 
2414
     Refer to the stacks thru separate pointers, to allow yyoverflow
2415
     to reallocate them elsewhere.  */
2416
 
2417
  /* The state stack.  */
2418
  short yyssa[YYINITDEPTH];
2419
  short *yyss = yyssa;
2420
  register short *yyssp;
2421
 
2422
  /* The semantic value stack.  */
2423
  YYSTYPE yyvsa[YYINITDEPTH];
2424
  YYSTYPE *yyvs = yyvsa;
2425
  register YYSTYPE *yyvsp;
2426
 
2427
 
2428
 
2429
#define YYPOPSTACK   (yyvsp--, yyssp--)
2430
 
2431
  YYSIZE_T yystacksize = YYINITDEPTH;
2432
 
2433
  /* The variables used to return semantic value and location from the
2434
     action routines.  */
2435
  YYSTYPE yyval;
2436
 
2437
 
2438
  /* When reducing, the number of symbols on the RHS of the reduced
2439
     rule.  */
2440
  int yylen;
2441
 
2442
  YYDPRINTF ((stderr, "Starting parse\n"));
2443
 
2444
  yystate = 0;
2445
  yyerrstatus = 0;
2446
  yynerrs = 0;
2447
  yychar = YYEMPTY;             /* Cause a token to be read.  */
2448
 
2449
  /* Initialize stack pointers.
2450
     Waste one element of value and location stack
2451
     so that they stay on the same level as the state stack.
2452
     The wasted elements are never initialized.  */
2453
 
2454
  yyssp = yyss;
2455
  yyvsp = yyvs;
2456
 
2457
  goto yysetstate;
2458
 
2459
/*------------------------------------------------------------.
2460
| yynewstate -- Push a new state, which is found in yystate.  |
2461
`------------------------------------------------------------*/
2462
 yynewstate:
2463
  /* In all cases, when you get here, the value and location stacks
2464
     have just been pushed. so pushing a state here evens the stacks.
2465
     */
2466
  yyssp++;
2467
 
2468
 yysetstate:
2469
  *yyssp = yystate;
2470
 
2471
  if (yyss + yystacksize - 1 <= yyssp)
2472
    {
2473
      /* Get the current used size of the three stacks, in elements.  */
2474
      YYSIZE_T yysize = yyssp - yyss + 1;
2475
 
2476
#ifdef yyoverflow
2477
      {
2478
        /* Give user a chance to reallocate the stack. Use copies of
2479
           these so that the &'s don't force the real ones into
2480
           memory.  */
2481
        YYSTYPE *yyvs1 = yyvs;
2482
        short *yyss1 = yyss;
2483
 
2484
 
2485
        /* Each stack pointer address is followed by the size of the
2486
           data in use in that stack, in bytes.  This used to be a
2487
           conditional around just the two extra args, but that might
2488
           be undefined if yyoverflow is a macro.  */
2489
        yyoverflow ("parser stack overflow",
2490
                    &yyss1, yysize * sizeof (*yyssp),
2491
                    &yyvs1, yysize * sizeof (*yyvsp),
2492
 
2493
                    &yystacksize);
2494
 
2495
        yyss = yyss1;
2496
        yyvs = yyvs1;
2497
      }
2498
#else /* no yyoverflow */
2499
# ifndef YYSTACK_RELOCATE
2500
      goto yyoverflowlab;
2501
# else
2502
      /* Extend the stack our own way.  */
2503
      if (YYMAXDEPTH <= yystacksize)
2504
        goto yyoverflowlab;
2505
      yystacksize *= 2;
2506
      if (YYMAXDEPTH < yystacksize)
2507
        yystacksize = YYMAXDEPTH;
2508
 
2509
      {
2510
        short *yyss1 = yyss;
2511
        union yyalloc *yyptr =
2512
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2513
        if (! yyptr)
2514
          goto yyoverflowlab;
2515
        YYSTACK_RELOCATE (yyss);
2516
        YYSTACK_RELOCATE (yyvs);
2517
 
2518
#  undef YYSTACK_RELOCATE
2519
        if (yyss1 != yyssa)
2520
          YYSTACK_FREE (yyss1);
2521
      }
2522
# endif
2523
#endif /* no yyoverflow */
2524
 
2525
      yyssp = yyss + yysize - 1;
2526
      yyvsp = yyvs + yysize - 1;
2527
 
2528
 
2529
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2530
                  (unsigned long int) yystacksize));
2531
 
2532
      if (yyss + yystacksize - 1 <= yyssp)
2533
        YYABORT;
2534
    }
2535
 
2536
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2537
 
2538
  goto yybackup;
2539
 
2540
/*-----------.
2541
| yybackup.  |
2542
`-----------*/
2543
yybackup:
2544
 
2545
/* Do appropriate processing given the current state.  */
2546
/* Read a lookahead token if we need one and don't already have one.  */
2547
/* yyresume: */
2548
 
2549
  /* First try to decide what to do without reference to lookahead token.  */
2550
 
2551
  yyn = yypact[yystate];
2552
  if (yyn == YYPACT_NINF)
2553
    goto yydefault;
2554
 
2555
  /* Not known => get a lookahead token if don't already have one.  */
2556
 
2557
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
2558
  if (yychar == YYEMPTY)
2559
    {
2560
      YYDPRINTF ((stderr, "Reading a token: "));
2561
      yychar = YYLEX;
2562
    }
2563
 
2564
  if (yychar <= YYEOF)
2565
    {
2566
      yychar = yytoken = YYEOF;
2567
      YYDPRINTF ((stderr, "Now at end of input.\n"));
2568
    }
2569
  else
2570
    {
2571
      yytoken = YYTRANSLATE (yychar);
2572
      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
2573
    }
2574
 
2575
  /* If the proper action on seeing token YYTOKEN is to reduce or to
2576
     detect an error, take that action.  */
2577
  yyn += yytoken;
2578
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2579
    goto yydefault;
2580
  yyn = yytable[yyn];
2581
  if (yyn <= 0)
2582
    {
2583
      if (yyn == 0 || yyn == YYTABLE_NINF)
2584
        goto yyerrlab;
2585
      yyn = -yyn;
2586
      goto yyreduce;
2587
    }
2588
 
2589
  if (yyn == YYFINAL)
2590
    YYACCEPT;
2591
 
2592
  /* Shift the lookahead token.  */
2593
  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
2594
 
2595
  /* Discard the token being shifted unless it is eof.  */
2596
  if (yychar != YYEOF)
2597
    yychar = YYEMPTY;
2598
 
2599
  *++yyvsp = yylval;
2600
 
2601
 
2602
  /* Count tokens shifted since error; after three, turn off error
2603
     status.  */
2604
  if (yyerrstatus)
2605
    yyerrstatus--;
2606
 
2607
  yystate = yyn;
2608
  goto yynewstate;
2609
 
2610
 
2611
/*-----------------------------------------------------------.
2612
| yydefault -- do the default action for the current state.  |
2613
`-----------------------------------------------------------*/
2614
yydefault:
2615
  yyn = yydefact[yystate];
2616
  if (yyn == 0)
2617
    goto yyerrlab;
2618
  goto yyreduce;
2619
 
2620
 
2621
/*-----------------------------.
2622
| yyreduce -- Do a reduction.  |
2623
`-----------------------------*/
2624
yyreduce:
2625
  /* yyn is the number of a rule to reduce with.  */
2626
  yylen = yyr2[yyn];
2627
 
2628
  /* If YYLEN is nonzero, implement the default value of the action:
2629
     `$$ = $1'.
2630
 
2631
     Otherwise, the following line sets YYVAL to garbage.
2632
     This behavior is undocumented and Bison
2633
     users should not rely upon it.  Assigning to YYVAL
2634
     unconditionally makes the parser a bit smaller, and it avoids a
2635
     GCC warning that YYVAL may be used uninitialized.  */
2636
  yyval = yyvsp[1-yylen];
2637
 
2638
 
2639
  YY_REDUCE_PRINT (yyn);
2640
  switch (yyn)
2641
    {
2642
        case 3:
2643
#line 599 "bfin-parse.y"
2644
    {
2645
          insn = yyvsp[0].instr;
2646
          if (insn == (INSTR_T) 0)
2647
            return NO_INSN_GENERATED;
2648
          else if (insn == (INSTR_T) - 1)
2649
            return SEMANTIC_ERROR;
2650
          else
2651
            return INSN_GENERATED;
2652
        }
2653
    break;
2654
 
2655
  case 5:
2656
#line 613 "bfin-parse.y"
2657
    {
2658
          if ((yyvsp[-5].instr->value & 0xf800) == 0xc000)
2659
            {
2660
              if (is_group1 (yyvsp[-3].instr) && is_group2 (yyvsp[-1].instr))
2661
                yyval.instr = bfin_gen_multi_instr (yyvsp[-5].instr, yyvsp[-3].instr, yyvsp[-1].instr);
2662
              else if (is_group2 (yyvsp[-3].instr) && is_group1 (yyvsp[-1].instr))
2663
                yyval.instr = bfin_gen_multi_instr (yyvsp[-5].instr, yyvsp[-1].instr, yyvsp[-3].instr);
2664
              else
2665
                return yyerror ("Wrong 16 bit instructions groups, slot 2 and slot 3 must be 16-bit instrution group");
2666
            }
2667
          else if ((yyvsp[-3].instr->value & 0xf800) == 0xc000)
2668
            {
2669
              if (is_group1 (yyvsp[-5].instr) && is_group2 (yyvsp[-1].instr))
2670
                yyval.instr = bfin_gen_multi_instr (yyvsp[-3].instr, yyvsp[-5].instr, yyvsp[-1].instr);
2671
              else if (is_group2 (yyvsp[-5].instr) && is_group1 (yyvsp[-1].instr))
2672
                yyval.instr = bfin_gen_multi_instr (yyvsp[-3].instr, yyvsp[-1].instr, yyvsp[-5].instr);
2673
              else
2674
                return yyerror ("Wrong 16 bit instructions groups, slot 1 and slot 3 must be 16-bit instrution group");
2675
            }
2676
          else if ((yyvsp[-1].instr->value & 0xf800) == 0xc000)
2677
            {
2678
              if (is_group1 (yyvsp[-5].instr) && is_group2 (yyvsp[-3].instr))
2679
                yyval.instr = bfin_gen_multi_instr (yyvsp[-1].instr, yyvsp[-5].instr, yyvsp[-3].instr);
2680
              else if (is_group2 (yyvsp[-5].instr) && is_group1 (yyvsp[-3].instr))
2681
                yyval.instr = bfin_gen_multi_instr (yyvsp[-1].instr, yyvsp[-3].instr, yyvsp[-5].instr);
2682
              else
2683
                return yyerror ("Wrong 16 bit instructions groups, slot 1 and slot 2 must be 16-bit instrution group");
2684
            }
2685
          else
2686
            error ("\nIllegal Multi Issue Construct, at least any one of the slot must be DSP32 instruction group\n");
2687
        }
2688
    break;
2689
 
2690
  case 6:
2691
#line 646 "bfin-parse.y"
2692
    {
2693
          if ((yyvsp[-3].instr->value & 0xf800) == 0xc000)
2694
            {
2695
              if (is_group1 (yyvsp[-1].instr))
2696
                yyval.instr = bfin_gen_multi_instr (yyvsp[-3].instr, yyvsp[-1].instr, 0);
2697
              else if (is_group2 (yyvsp[-1].instr))
2698
                yyval.instr = bfin_gen_multi_instr (yyvsp[-3].instr, 0, yyvsp[-1].instr);
2699
              else
2700
                return yyerror ("Wrong 16 bit instructions groups, slot 2 must be the 16-bit instruction group");
2701
            }
2702
          else if ((yyvsp[-1].instr->value & 0xf800) == 0xc000)
2703
            {
2704
              if (is_group1 (yyvsp[-3].instr))
2705
                yyval.instr = bfin_gen_multi_instr (yyvsp[-1].instr, yyvsp[-3].instr, 0);
2706
              else if (is_group2 (yyvsp[-3].instr))
2707
                yyval.instr = bfin_gen_multi_instr (yyvsp[-1].instr, 0, yyvsp[-3].instr);
2708
              else
2709
                return yyerror ("Wrong 16 bit instructions groups, slot 1 must be the 16-bit instruction group");
2710
            }
2711
          else if (is_group1 (yyvsp[-3].instr) && is_group2 (yyvsp[-1].instr))
2712
              yyval.instr = bfin_gen_multi_instr (0, yyvsp[-3].instr, yyvsp[-1].instr);
2713
          else if (is_group2 (yyvsp[-3].instr) && is_group1 (yyvsp[-1].instr))
2714
            yyval.instr = bfin_gen_multi_instr (0, yyvsp[-1].instr, yyvsp[-3].instr);
2715
          else
2716
            return yyerror ("Wrong 16 bit instructions groups, slot 1 and slot 2 must be the 16-bit instruction group");
2717
        }
2718
    break;
2719
 
2720
  case 7:
2721
#line 673 "bfin-parse.y"
2722
    {
2723
        yyval.instr = 0;
2724
        yyerror ("");
2725
        yyerrok;
2726
        }
2727
    break;
2728
 
2729
  case 8:
2730
#line 684 "bfin-parse.y"
2731
    {
2732
          yyval.instr = DSP32MAC (3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0);
2733
        }
2734
    break;
2735
 
2736
  case 9:
2737
#line 688 "bfin-parse.y"
2738
    {
2739
          int op0, op1;
2740
          int w0 = 0, w1 = 0;
2741
          int h00, h10, h01, h11;
2742
 
2743
          if (check_macfunc_option (&yyvsp[-1].macfunc, &yyvsp[0].mod) < 0)
2744
            return yyerror ("bad option");
2745
 
2746
          if (yyvsp[-1].macfunc.n == 0)
2747
            {
2748
              if (yyvsp[0].mod.MM)
2749
                return yyerror ("(m) not allowed with a0 unit");
2750
              op1 = 3;
2751
              op0 = yyvsp[-1].macfunc.op;
2752
              w1 = 0;
2753
              w0 = yyvsp[-1].macfunc.w;
2754
              h00 = IS_H (yyvsp[-1].macfunc.s0);
2755
              h10 = IS_H (yyvsp[-1].macfunc.s1);
2756
              h01 = h11 = 0;
2757
            }
2758
          else
2759
            {
2760
              op1 = yyvsp[-1].macfunc.op;
2761
              op0 = 3;
2762
              w1 = yyvsp[-1].macfunc.w;
2763
              w0 = 0;
2764
              h00 = h10 = 0;
2765
              h01 = IS_H (yyvsp[-1].macfunc.s0);
2766
              h11 = IS_H (yyvsp[-1].macfunc.s1);
2767
            }
2768
          yyval.instr = DSP32MAC (op1, yyvsp[0].mod.MM, yyvsp[0].mod.mod, w1, yyvsp[-1].macfunc.P, h01, h11, h00, h10,
2769
                         &yyvsp[-1].macfunc.dst, op0, &yyvsp[-1].macfunc.s0, &yyvsp[-1].macfunc.s1, w0);
2770
        }
2771
    break;
2772
 
2773
  case 10:
2774
#line 726 "bfin-parse.y"
2775
    {
2776
          Register *dst;
2777
 
2778
          if (check_macfuncs (&yyvsp[-4].macfunc, &yyvsp[-3].mod, &yyvsp[-1].macfunc, &yyvsp[0].mod) < 0)
2779
            return -1;
2780
          notethat ("assign_macfunc (.), assign_macfunc (.)\n");
2781
 
2782
          if (yyvsp[-4].macfunc.w)
2783
            dst = &yyvsp[-4].macfunc.dst;
2784
          else
2785
            dst = &yyvsp[-1].macfunc.dst;
2786
 
2787
          yyval.instr = DSP32MAC (yyvsp[-4].macfunc.op, yyvsp[-3].mod.MM, yyvsp[0].mod.mod, yyvsp[-4].macfunc.w, yyvsp[-4].macfunc.P,
2788
                         IS_H (yyvsp[-4].macfunc.s0),  IS_H (yyvsp[-4].macfunc.s1), IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1),
2789
                         dst, yyvsp[-1].macfunc.op, &yyvsp[-4].macfunc.s0, &yyvsp[-4].macfunc.s1, yyvsp[-1].macfunc.w);
2790
        }
2791
    break;
2792
 
2793
  case 11:
2794
#line 746 "bfin-parse.y"
2795
    {
2796
          notethat ("dsp32alu: DISALGNEXCPT\n");
2797
          yyval.instr = DSP32ALU (18, 0, 0, 0, 0, 0, 0, 0, 3);
2798
        }
2799
    break;
2800
 
2801
  case 12:
2802
#line 751 "bfin-parse.y"
2803
    {
2804
          if (IS_DREG (yyvsp[-5].reg) && !IS_A1 (yyvsp[-2].reg) && IS_A1 (yyvsp[-1].reg))
2805
            {
2806
              notethat ("dsp32alu: dregs = ( A0 += A1 )\n");
2807
              yyval.instr = DSP32ALU (11, 0, 0, &yyvsp[-5].reg, 0, 0, 0, 0, 0);
2808
            }
2809
          else
2810
            return yyerror ("Register mismatch");
2811
        }
2812
    break;
2813
 
2814
  case 13:
2815
#line 761 "bfin-parse.y"
2816
    {
2817
          if (!IS_A1 (yyvsp[-2].reg) && IS_A1 (yyvsp[-1].reg))
2818
            {
2819
              notethat ("dsp32alu: dregs_half = ( A0 += A1 )\n");
2820
              yyval.instr = DSP32ALU (11, IS_H (yyvsp[-5].reg), 0, &yyvsp[-5].reg, 0, 0, 0, 0, 1);
2821
            }
2822
          else
2823
            return yyerror ("Register mismatch");
2824
        }
2825
    break;
2826
 
2827
  case 14:
2828
#line 771 "bfin-parse.y"
2829
    {
2830
          notethat ("dsp32alu: A_ZERO_DOT_H = dregs_hi\n");
2831
          yyval.instr = DSP32ALU (9, IS_H (yyvsp[0].reg), 0, 0, &yyvsp[0].reg, 0, 0, 0, 0);
2832
        }
2833
    break;
2834
 
2835
  case 15:
2836
#line 776 "bfin-parse.y"
2837
    {
2838
          notethat ("dsp32alu: A_ZERO_DOT_H = dregs_hi\n");
2839
          yyval.instr = DSP32ALU (9, IS_H (yyvsp[0].reg), 0, 0, &yyvsp[0].reg, 0, 0, 0, 2);
2840
        }
2841
    break;
2842
 
2843
  case 16:
2844
#line 782 "bfin-parse.y"
2845
    {
2846
          if (!IS_DREG (yyvsp[-15].reg) || !IS_DREG (yyvsp[-13].reg))
2847
            return yyerror ("Dregs expected");
2848
          else if (!valid_dreg_pair (&yyvsp[-8].reg, yyvsp[-6].expr))
2849
            return yyerror ("Bad dreg pair");
2850
          else if (!valid_dreg_pair (&yyvsp[-4].reg, yyvsp[-2].expr))
2851
            return yyerror ("Bad dreg pair");
2852
          else
2853
            {
2854
              notethat ("dsp32alu: (dregs , dregs ) = BYTEOP16P (dregs_pair , dregs_pair ) (half)\n");
2855
              yyval.instr = DSP32ALU (21, 0, &yyvsp[-15].reg, &yyvsp[-13].reg, &yyvsp[-8].reg, &yyvsp[-4].reg, yyvsp[0].r0.r0, 0, 0);
2856
            }
2857
        }
2858
    break;
2859
 
2860
  case 17:
2861
#line 798 "bfin-parse.y"
2862
    {
2863
          if (!IS_DREG (yyvsp[-15].reg) || !IS_DREG(yyvsp[-13].reg))
2864
            return yyerror ("Dregs expected");
2865
          else if (!valid_dreg_pair (&yyvsp[-8].reg, yyvsp[-6].expr))
2866
            return yyerror ("Bad dreg pair");
2867
          else if (!valid_dreg_pair (&yyvsp[-4].reg, yyvsp[-2].expr))
2868
            return yyerror ("Bad dreg pair");
2869
          else
2870
            {
2871
              notethat ("dsp32alu: (dregs , dregs ) = BYTEOP16M (dregs_pair , dregs_pair ) (aligndir)\n");
2872
              yyval.instr = DSP32ALU (21, 0, &yyvsp[-15].reg, &yyvsp[-13].reg, &yyvsp[-8].reg, &yyvsp[-4].reg, yyvsp[0].r0.r0, 0, 1);
2873
            }
2874
        }
2875
    break;
2876
 
2877
  case 18:
2878
#line 813 "bfin-parse.y"
2879
    {
2880
          if (!IS_DREG (yyvsp[-9].reg) || !IS_DREG (yyvsp[-7].reg))
2881
            return yyerror ("Dregs expected");
2882
          else if (!valid_dreg_pair (&yyvsp[-3].reg, yyvsp[-1].expr))
2883
            return yyerror ("Bad dreg pair");
2884
          else
2885
            {
2886
              notethat ("dsp32alu: (dregs , dregs ) = BYTEUNPACK dregs_pair (aligndir)\n");
2887
              yyval.instr = DSP32ALU (24, 0, &yyvsp[-9].reg, &yyvsp[-7].reg, &yyvsp[-3].reg, 0, yyvsp[0].r0.r0, 0, 1);
2888
            }
2889
        }
2890
    break;
2891
 
2892
  case 19:
2893
#line 825 "bfin-parse.y"
2894
    {
2895
          if (IS_DREG (yyvsp[-9].reg) && IS_DREG (yyvsp[-7].reg) && IS_DREG (yyvsp[-3].reg))
2896
            {
2897
              notethat ("dsp32alu: (dregs , dregs ) = SEARCH dregs (searchmod)\n");
2898
              yyval.instr = DSP32ALU (13, 0, &yyvsp[-9].reg, &yyvsp[-7].reg, &yyvsp[-3].reg, 0, 0, 0, yyvsp[-1].r0.r0);
2899
            }
2900
          else
2901
            return yyerror ("Register mismatch");
2902
        }
2903
    break;
2904
 
2905
  case 20:
2906
#line 836 "bfin-parse.y"
2907
    {
2908
          if (IS_DREG (yyvsp[-10].reg) && IS_DREG (yyvsp[-4].reg))
2909
            {
2910
              notethat ("dsp32alu: dregs = A1.l + A1.h, dregs = A0.l + A0.h  \n");
2911
              yyval.instr = DSP32ALU (12, 0, &yyvsp[-10].reg, &yyvsp[-4].reg, 0, 0, 0, 0, 1);
2912
            }
2913
          else
2914
            return yyerror ("Register mismatch");
2915
        }
2916
    break;
2917
 
2918
  case 21:
2919
#line 848 "bfin-parse.y"
2920
    {
2921
          if (IS_DREG (yyvsp[-11].reg) && IS_DREG (yyvsp[-5].reg) && !REG_SAME (yyvsp[-9].reg, yyvsp[-7].reg)
2922
              && IS_A1 (yyvsp[-3].reg) && !IS_A1 (yyvsp[-1].reg))
2923
            {
2924
              notethat ("dsp32alu: dregs = A1 + A0 , dregs = A1 - A0 (amod1)\n");
2925
              yyval.instr = DSP32ALU (17, 0, &yyvsp[-11].reg, &yyvsp[-5].reg, 0, 0, yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, 0);
2926
 
2927
            }
2928
          else if (IS_DREG (yyvsp[-11].reg) && IS_DREG (yyvsp[-5].reg) && !REG_SAME (yyvsp[-9].reg, yyvsp[-7].reg)
2929
                   && !IS_A1 (yyvsp[-3].reg) && IS_A1 (yyvsp[-1].reg))
2930
            {
2931
              notethat ("dsp32alu: dregs = A0 + A1 , dregs = A0 - A1 (amod1)\n");
2932
              yyval.instr = DSP32ALU (17, 0, &yyvsp[-11].reg, &yyvsp[-5].reg, 0, 0, yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, 1);
2933
            }
2934
          else
2935
            return yyerror ("Register mismatch");
2936
        }
2937
    break;
2938
 
2939
  case 22:
2940
#line 867 "bfin-parse.y"
2941
    {
2942
          if (yyvsp[-8].r0.r0 == yyvsp[-2].r0.r0)
2943
            return yyerror ("Operators must differ");
2944
 
2945
          if (IS_DREG (yyvsp[-11].reg) && IS_DREG (yyvsp[-9].reg) && IS_DREG (yyvsp[-7].reg)
2946
              && REG_SAME (yyvsp[-9].reg, yyvsp[-3].reg) && REG_SAME (yyvsp[-7].reg, yyvsp[-1].reg))
2947
            {
2948
              notethat ("dsp32alu: dregs = dregs + dregs,"
2949
                       "dregs = dregs - dregs (amod1)\n");
2950
              yyval.instr = DSP32ALU (4, 0, &yyvsp[-11].reg, &yyvsp[-5].reg, &yyvsp[-9].reg, &yyvsp[-7].reg, yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, 2);
2951
            }
2952
          else
2953
            return yyerror ("Register mismatch");
2954
        }
2955
    break;
2956
 
2957
  case 23:
2958
#line 885 "bfin-parse.y"
2959
    {
2960
          if (!REG_SAME (yyvsp[-9].reg, yyvsp[-3].reg) || !REG_SAME (yyvsp[-7].reg, yyvsp[-1].reg))
2961
            return yyerror ("Differing source registers");
2962
 
2963
          if (!IS_DREG (yyvsp[-11].reg) || !IS_DREG (yyvsp[-9].reg) || !IS_DREG (yyvsp[-7].reg) || !IS_DREG (yyvsp[-5].reg))
2964
            return yyerror ("Dregs expected");
2965
 
2966
 
2967
          if (yyvsp[-8].r0.r0 == 1 && yyvsp[-2].r0.r0 == 2)
2968
            {
2969
              notethat ("dsp32alu:  dregs = dregs .|. dregs , dregs = dregs .|. dregs (amod2)\n");
2970
              yyval.instr = DSP32ALU (1, 1, &yyvsp[-11].reg, &yyvsp[-5].reg, &yyvsp[-9].reg, &yyvsp[-7].reg, yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, yyvsp[0].modcodes.r0);
2971
            }
2972
          else if (yyvsp[-8].r0.r0 == 0 && yyvsp[-2].r0.r0 == 3)
2973
            {
2974
              notethat ("dsp32alu:  dregs = dregs .|. dregs , dregs = dregs .|. dregs (amod2)\n");
2975
              yyval.instr = DSP32ALU (1, 0, &yyvsp[-11].reg, &yyvsp[-5].reg, &yyvsp[-9].reg, &yyvsp[-7].reg, yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, yyvsp[0].modcodes.r0);
2976
            }
2977
          else
2978
            return yyerror ("Bar operand mismatch");
2979
        }
2980
    break;
2981
 
2982
  case 24:
2983
#line 908 "bfin-parse.y"
2984
    {
2985
          int op;
2986
 
2987
          if (IS_DREG (yyvsp[-4].reg) && IS_DREG (yyvsp[-1].reg))
2988
            {
2989
              if (yyvsp[0].r0.r0)
2990
                {
2991
                  notethat ("dsp32alu: dregs = ABS dregs (v)\n");
2992
                  op = 6;
2993
                }
2994
              else
2995
                {
2996
                  /* Vector version of ABS.  */
2997
                  notethat ("dsp32alu: dregs = ABS dregs\n");
2998
                  op = 7;
2999
                }
3000
              yyval.instr = DSP32ALU (op, 0, 0, &yyvsp[-4].reg, &yyvsp[-1].reg, 0, 0, 0, 2);
3001
            }
3002
          else
3003
            return yyerror ("Dregs expected");
3004
        }
3005
    break;
3006
 
3007
  case 25:
3008
#line 930 "bfin-parse.y"
3009
    {
3010
          notethat ("dsp32alu: Ax = ABS Ax\n");
3011
          yyval.instr = DSP32ALU (16, IS_A1 (yyvsp[-2].reg), 0, 0, 0, 0, 0, 0, IS_A1 (yyvsp[0].reg));
3012
        }
3013
    break;
3014
 
3015
  case 26:
3016
#line 935 "bfin-parse.y"
3017
    {
3018
          if (IS_DREG_L (yyvsp[0].reg))
3019
            {
3020
              notethat ("dsp32alu: A0.l = reg_half\n");
3021
              yyval.instr = DSP32ALU (9, IS_H (yyvsp[0].reg), 0, 0, &yyvsp[0].reg, 0, 0, 0, 0);
3022
            }
3023
          else
3024
            return yyerror ("A0.l = Rx.l expected");
3025
        }
3026
    break;
3027
 
3028
  case 27:
3029
#line 945 "bfin-parse.y"
3030
    {
3031
          if (IS_DREG_L (yyvsp[0].reg))
3032
            {
3033
              notethat ("dsp32alu: A1.l = reg_half\n");
3034
              yyval.instr = DSP32ALU (9, IS_H (yyvsp[0].reg), 0, 0, &yyvsp[0].reg, 0, 0, 0, 2);
3035
            }
3036
          else
3037
            return yyerror ("A1.l = Rx.l expected");
3038
        }
3039
    break;
3040
 
3041
  case 28:
3042
#line 956 "bfin-parse.y"
3043
    {
3044
          if (IS_DREG (yyvsp[-7].reg) && IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
3045
            {
3046
              notethat ("dsp32shift: dregs = ALIGN8 (dregs , dregs )\n");
3047
              yyval.instr = DSP32SHIFT (13, &yyvsp[-7].reg, &yyvsp[-1].reg, &yyvsp[-3].reg, yyvsp[-5].r0.r0, 0);
3048
            }
3049
          else
3050
            return yyerror ("Dregs expected");
3051
        }
3052
    break;
3053
 
3054
  case 29:
3055
#line 967 "bfin-parse.y"
3056
    {
3057
          if (!IS_DREG (yyvsp[-12].reg))
3058
            return yyerror ("Dregs expected");
3059
          else if (!valid_dreg_pair (&yyvsp[-8].reg, yyvsp[-6].expr))
3060
            return yyerror ("Bad dreg pair");
3061
          else if (!valid_dreg_pair (&yyvsp[-4].reg, yyvsp[-2].expr))
3062
            return yyerror ("Bad dreg pair");
3063
          else
3064
            {
3065
              notethat ("dsp32alu: dregs = BYTEOP1P (dregs_pair , dregs_pair ) (T)\n");
3066
              yyval.instr = DSP32ALU (20, 0, 0, &yyvsp[-12].reg, &yyvsp[-8].reg, &yyvsp[-4].reg, yyvsp[0].modcodes.s0, 0, yyvsp[0].modcodes.r0);
3067
            }
3068
        }
3069
    break;
3070
 
3071
  case 30:
3072
#line 981 "bfin-parse.y"
3073
    {
3074
          if (!IS_DREG (yyvsp[-11].reg))
3075
            return yyerror ("Dregs expected");
3076
          else if (!valid_dreg_pair (&yyvsp[-7].reg, yyvsp[-5].expr))
3077
            return yyerror ("Bad dreg pair");
3078
          else if (!valid_dreg_pair (&yyvsp[-3].reg, yyvsp[-1].expr))
3079
            return yyerror ("Bad dreg pair");
3080
          else
3081
            {
3082
              notethat ("dsp32alu: dregs = BYTEOP1P (dregs_pair , dregs_pair ) (T)\n");
3083
              yyval.instr = DSP32ALU (20, 0, 0, &yyvsp[-11].reg, &yyvsp[-7].reg, &yyvsp[-3].reg, 0, 0, 0);
3084
            }
3085
        }
3086
    break;
3087
 
3088
  case 31:
3089
#line 997 "bfin-parse.y"
3090
    {
3091
          if (!IS_DREG (yyvsp[-12].reg))
3092
            return yyerror ("Dregs expected");
3093
          else if (!valid_dreg_pair (&yyvsp[-8].reg, yyvsp[-6].expr))
3094
            return yyerror ("Bad dreg pair");
3095
          else if (!valid_dreg_pair (&yyvsp[-4].reg, yyvsp[-2].expr))
3096
            return yyerror ("Bad dreg pair");
3097
          else
3098
            {
3099
              notethat ("dsp32alu: dregs = BYTEOP2P (dregs_pair , dregs_pair ) (rnd_op)\n");
3100
              yyval.instr = DSP32ALU (22, yyvsp[0].modcodes.r0, 0, &yyvsp[-12].reg, &yyvsp[-8].reg, &yyvsp[-4].reg, yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, yyvsp[0].modcodes.aop);
3101
            }
3102
        }
3103
    break;
3104
 
3105
  case 32:
3106
#line 1013 "bfin-parse.y"
3107
    {
3108
          if (!IS_DREG (yyvsp[-12].reg))
3109
            return yyerror ("Dregs expected");
3110
          else if (!valid_dreg_pair (&yyvsp[-8].reg, yyvsp[-6].expr))
3111
            return yyerror ("Bad dreg pair");
3112
          else if (!valid_dreg_pair (&yyvsp[-4].reg, yyvsp[-2].expr))
3113
            return yyerror ("Bad dreg pair");
3114
          else
3115
            {
3116
              notethat ("dsp32alu: dregs = BYTEOP2P (dregs_pair , dregs_pair ) (rnd_op)\n");
3117
              yyval.instr = DSP32ALU (22, yyvsp[0].modcodes.r0, 0, &yyvsp[-12].reg, &yyvsp[-8].reg, &yyvsp[-4].reg, yyvsp[0].modcodes.s0, 0, yyvsp[0].modcodes.x0);
3118
            }
3119
        }
3120
    break;
3121
 
3122
  case 33:
3123
#line 1029 "bfin-parse.y"
3124
    {
3125
          if (!IS_DREG (yyvsp[-12].reg))
3126
            return yyerror ("Dregs expected");
3127
          else if (!valid_dreg_pair (&yyvsp[-8].reg, yyvsp[-6].expr))
3128
            return yyerror ("Bad dreg pair");
3129
          else if (!valid_dreg_pair (&yyvsp[-4].reg, yyvsp[-2].expr))
3130
            return yyerror ("Bad dreg pair");
3131
          else
3132
            {
3133
              notethat ("dsp32alu: dregs = BYTEOP3P (dregs_pair , dregs_pair ) (b3_op)\n");
3134
              yyval.instr = DSP32ALU (23, yyvsp[0].modcodes.x0, 0, &yyvsp[-12].reg, &yyvsp[-8].reg, &yyvsp[-4].reg, yyvsp[0].modcodes.s0, 0, 0);
3135
            }
3136
        }
3137
    break;
3138
 
3139
  case 34:
3140
#line 1044 "bfin-parse.y"
3141
    {
3142
          if (IS_DREG (yyvsp[-7].reg) && IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
3143
            {
3144
              notethat ("dsp32alu: dregs = BYTEPACK (dregs , dregs )\n");
3145
              yyval.instr = DSP32ALU (24, 0, 0, &yyvsp[-7].reg, &yyvsp[-3].reg, &yyvsp[-1].reg, 0, 0, 0);
3146
            }
3147
          else
3148
            return yyerror ("Dregs expected");
3149
        }
3150
    break;
3151
 
3152
  case 35:
3153
#line 1056 "bfin-parse.y"
3154
    {
3155
          if (IS_HCOMPL (yyvsp[-16].reg, yyvsp[-14].reg) && IS_HCOMPL (yyvsp[-10].reg, yyvsp[-3].reg) && IS_HCOMPL (yyvsp[-7].reg, yyvsp[0].reg))
3156
            {
3157
              notethat ("dsp32alu:      dregs_hi = dregs_lo ="
3158
                       "SIGN (dregs_hi) * dregs_hi + "
3159
                       "SIGN (dregs_lo) * dregs_lo \n");
3160
 
3161
                yyval.instr = DSP32ALU (12, 0, 0, &yyvsp[-16].reg, &yyvsp[-10].reg, &yyvsp[-7].reg, 0, 0, 0);
3162
            }
3163
          else
3164
            return yyerror ("Dregs expected");
3165
        }
3166
    break;
3167
 
3168
  case 36:
3169
#line 1069 "bfin-parse.y"
3170
    {
3171
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
3172
            {
3173
              if (yyvsp[0].modcodes.aop == 0)
3174
                {
3175
                  /* No saturation flag specified, generate the 16 bit variant.  */
3176
                  notethat ("COMP3op: dregs = dregs +- dregs\n");
3177
                  yyval.instr = COMP3OP (&yyvsp[-5].reg, &yyvsp[-3].reg, &yyvsp[-1].reg, yyvsp[-2].r0.r0);
3178
                }
3179
              else
3180
                {
3181
                 /* Saturation flag specified, generate the 32 bit variant.  */
3182
                 notethat ("dsp32alu: dregs = dregs +- dregs (amod1)\n");
3183
                 yyval.instr = DSP32ALU (4, 0, 0, &yyvsp[-5].reg, &yyvsp[-3].reg, &yyvsp[-1].reg, yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, yyvsp[-2].r0.r0);
3184
                }
3185
            }
3186
          else
3187
            if (IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-3].reg) && IS_PREG (yyvsp[-1].reg) && yyvsp[-2].r0.r0 == 0)
3188
              {
3189
                notethat ("COMP3op: pregs = pregs + pregs\n");
3190
                yyval.instr = COMP3OP (&yyvsp[-5].reg, &yyvsp[-3].reg, &yyvsp[-1].reg, 5);
3191
              }
3192
            else
3193
              return yyerror ("Dregs expected");
3194
        }
3195
    break;
3196
 
3197
  case 37:
3198
#line 1095 "bfin-parse.y"
3199
    {
3200
          int op;
3201
 
3202
          if (IS_DREG (yyvsp[-8].reg) && IS_DREG (yyvsp[-4].reg) && IS_DREG (yyvsp[-2].reg))
3203
            {
3204
              if (yyvsp[0].r0.r0)
3205
                op = 6;
3206
              else
3207
                op = 7;
3208
 
3209
              notethat ("dsp32alu: dregs = {MIN|MAX} (dregs, dregs)\n");
3210
              yyval.instr = DSP32ALU (op, 0, 0, &yyvsp[-8].reg, &yyvsp[-4].reg, &yyvsp[-2].reg, 0, 0, yyvsp[-6].r0.r0);
3211
            }
3212
          else
3213
            return yyerror ("Dregs expected");
3214
        }
3215
    break;
3216
 
3217
  case 38:
3218
#line 1113 "bfin-parse.y"
3219
    {
3220
          notethat ("dsp32alu: Ax = - Ax\n");
3221
          yyval.instr = DSP32ALU (14, IS_A1 (yyvsp[-2].reg), 0, 0, 0, 0, 0, 0, IS_A1 (yyvsp[0].reg));
3222
        }
3223
    break;
3224
 
3225
  case 39:
3226
#line 1118 "bfin-parse.y"
3227
    {
3228
          notethat ("dsp32alu: dregs_lo = dregs_lo +- dregs_lo (amod1)\n");
3229
          yyval.instr = DSP32ALU (2 | yyvsp[-2].r0.r0, IS_H (yyvsp[-5].reg), 0, &yyvsp[-5].reg, &yyvsp[-3].reg, &yyvsp[-1].reg,
3230
                         yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, HL2 (yyvsp[-3].reg, yyvsp[-1].reg));
3231
        }
3232
    break;
3233
 
3234
  case 40:
3235
#line 1124 "bfin-parse.y"
3236
    {
3237
          if (EXPR_VALUE (yyvsp[0].expr) == 0 && !REG_SAME (yyvsp[-2].reg, yyvsp[-1].reg))
3238
            {
3239
              notethat ("dsp32alu: A1 = A0 = 0\n");
3240
              yyval.instr = DSP32ALU (8, 0, 0, 0, 0, 0, 0, 0, 2);
3241
            }
3242
          else
3243
            return yyerror ("Bad value, 0 expected");
3244
        }
3245
    break;
3246
 
3247
  case 41:
3248
#line 1136 "bfin-parse.y"
3249
    {
3250
          if (REG_SAME (yyvsp[-4].reg, yyvsp[-3].reg))
3251
            {
3252
              notethat ("dsp32alu: Ax = Ax (S)\n");
3253
              yyval.instr = DSP32ALU (8, 0, 0, 0, 0, 0, 1, 0, IS_A1 (yyvsp[-4].reg));
3254
            }
3255
          else
3256
            return yyerror ("Registers must be equal");
3257
        }
3258
    break;
3259
 
3260
  case 42:
3261
#line 1147 "bfin-parse.y"
3262
    {
3263
          if (IS_DREG (yyvsp[-3].reg))
3264
            {
3265
              notethat ("dsp32alu: dregs_half = dregs (RND)\n");
3266
              yyval.instr = DSP32ALU (12, IS_H (yyvsp[-5].reg), 0, &yyvsp[-5].reg, &yyvsp[-3].reg, 0, 0, 0, 3);
3267
            }
3268
          else
3269
            return yyerror ("Dregs expected");
3270
        }
3271
    break;
3272
 
3273
  case 43:
3274
#line 1158 "bfin-parse.y"
3275
    {
3276
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg))
3277
            {
3278
              notethat ("dsp32alu: dregs_half = dregs (+-) dregs (RND12)\n");
3279
              yyval.instr = DSP32ALU (5, IS_H (yyvsp[-7].reg), 0, &yyvsp[-7].reg, &yyvsp[-5].reg, &yyvsp[-3].reg, 0, 0, yyvsp[-4].r0.r0);
3280
            }
3281
          else
3282
            return yyerror ("Dregs expected");
3283
        }
3284
    break;
3285
 
3286
  case 44:
3287
#line 1169 "bfin-parse.y"
3288
    {
3289
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg))
3290
            {
3291
              notethat ("dsp32alu: dregs_half = dregs -+ dregs (RND20)\n");
3292
              yyval.instr = DSP32ALU (5, IS_H (yyvsp[-7].reg), 0, &yyvsp[-7].reg, &yyvsp[-5].reg, &yyvsp[-3].reg, 0, 1, yyvsp[-4].r0.r0 | 2);
3293
            }
3294
          else
3295
            return yyerror ("Dregs expected");
3296
        }
3297
    break;
3298
 
3299
  case 45:
3300
#line 1180 "bfin-parse.y"
3301
    {
3302
          if (!REG_SAME (yyvsp[-1].reg, yyvsp[0].reg))
3303
            {
3304
              notethat ("dsp32alu: An = Am\n");
3305
              yyval.instr = DSP32ALU (8, 0, 0, 0, 0, 0, IS_A1 (yyvsp[-1].reg), 0, 3);
3306
            }
3307
          else
3308
            return yyerror ("Accu reg arguments must differ");
3309
        }
3310
    break;
3311
 
3312
  case 46:
3313
#line 1191 "bfin-parse.y"
3314
    {
3315
          if (IS_DREG (yyvsp[0].reg))
3316
            {
3317
              notethat ("dsp32alu: An = dregs\n");
3318
              yyval.instr = DSP32ALU (9, 0, 0, 0, &yyvsp[0].reg, 0, 1, 0, IS_A1 (yyvsp[-1].reg) << 1);
3319
            }
3320
          else
3321
            return yyerror ("Dregs expected");
3322
        }
3323
    break;
3324
 
3325
  case 47:
3326
#line 1202 "bfin-parse.y"
3327
    {
3328
          if (!IS_H (yyvsp[-1].reg))
3329
            {
3330
              if (yyvsp[-3].reg.regno == REG_A0x && IS_DREG (yyvsp[-1].reg))
3331
                {
3332
                  notethat ("dsp32alu: A0.x = dregs_lo\n");
3333
                  yyval.instr = DSP32ALU (9, 0, 0, 0, &yyvsp[-1].reg, 0, 0, 0, 1);
3334
                }
3335
              else if (yyvsp[-3].reg.regno == REG_A1x && IS_DREG (yyvsp[-1].reg))
3336
                {
3337
                  notethat ("dsp32alu: A1.x = dregs_lo\n");
3338
                  yyval.instr = DSP32ALU (9, 0, 0, 0, &yyvsp[-1].reg, 0, 0, 0, 3);
3339
                }
3340
              else if (IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
3341
                {
3342
                  notethat ("ALU2op: dregs = dregs_lo\n");
3343
                  yyval.instr = ALU2OP (&yyvsp[-3].reg, &yyvsp[-1].reg, 10 | (yyvsp[0].r0.r0 ? 0: 1));
3344
                }
3345
              else
3346
                return yyerror ("Register mismatch");
3347
            }
3348
          else
3349
            return yyerror ("Low reg expected");
3350
        }
3351
    break;
3352
 
3353
  case 48:
3354
#line 1228 "bfin-parse.y"
3355
    {
3356
          notethat ("LDIMMhalf: pregs_half = imm16\n");
3357
 
3358
          if (!IS_DREG (yyvsp[-2].reg) && !IS_PREG (yyvsp[-2].reg) && !IS_IREG (yyvsp[-2].reg)
3359
              && !IS_MREG (yyvsp[-2].reg) && !IS_BREG (yyvsp[-2].reg) && !IS_LREG (yyvsp[-2].reg))
3360
            return yyerror ("Wrong register for load immediate");
3361
 
3362
          if (!IS_IMM (yyvsp[0].expr, 16) && !IS_UIMM (yyvsp[0].expr, 16))
3363
            return yyerror ("Constant out of range");
3364
 
3365
          yyval.instr = LDIMMHALF_R (&yyvsp[-2].reg, IS_H (yyvsp[-2].reg), 0, 0, yyvsp[0].expr);
3366
        }
3367
    break;
3368
 
3369
  case 49:
3370
#line 1242 "bfin-parse.y"
3371
    {
3372
          notethat ("dsp32alu: An = 0\n");
3373
 
3374
          if (imm7 (yyvsp[0].expr) != 0)
3375
            return yyerror ("0 expected");
3376
 
3377
          yyval.instr = DSP32ALU (8, 0, 0, 0, 0, 0, 0, 0, IS_A1 (yyvsp[-1].reg));
3378
        }
3379
    break;
3380
 
3381
  case 50:
3382
#line 1252 "bfin-parse.y"
3383
    {
3384
          if (!IS_DREG (yyvsp[-3].reg) && !IS_PREG (yyvsp[-3].reg) && !IS_IREG (yyvsp[-3].reg)
3385
              && !IS_MREG (yyvsp[-3].reg) && !IS_BREG (yyvsp[-3].reg) && !IS_LREG (yyvsp[-3].reg))
3386
            return yyerror ("Wrong register for load immediate");
3387
 
3388
          if (yyvsp[0].r0.r0 == 0)
3389
            {
3390
              /* 7 bit immediate value if possible.
3391
                 We will check for that constant value for efficiency
3392
                 If it goes to reloc, it will be 16 bit.  */
3393
              if (IS_CONST (yyvsp[-1].expr) && IS_IMM (yyvsp[-1].expr, 7) && IS_DREG (yyvsp[-3].reg))
3394
                {
3395
                  notethat ("COMPI2opD: dregs = imm7 (x) \n");
3396
                  yyval.instr = COMPI2OPD (&yyvsp[-3].reg, imm7 (yyvsp[-1].expr), 0);
3397
                }
3398
              else if (IS_CONST (yyvsp[-1].expr) && IS_IMM (yyvsp[-1].expr, 7) && IS_PREG (yyvsp[-3].reg))
3399
                {
3400
                  notethat ("COMPI2opP: pregs = imm7 (x)\n");
3401
                  yyval.instr = COMPI2OPP (&yyvsp[-3].reg, imm7 (yyvsp[-1].expr), 0);
3402
                }
3403
              else
3404
                {
3405
                  if (IS_CONST (yyvsp[-1].expr) && !IS_IMM (yyvsp[-1].expr, 16))
3406
                    return yyerror ("Immediate value out of range");
3407
 
3408
                  notethat ("LDIMMhalf: regs = luimm16 (x)\n");
3409
                  /* reg, H, S, Z.   */
3410
                  yyval.instr = LDIMMHALF_R5 (&yyvsp[-3].reg, 0, 1, 0, yyvsp[-1].expr);
3411
                }
3412
            }
3413
          else
3414
            {
3415
              /* (z) There is no 7 bit zero extended instruction.
3416
              If the expr is a relocation, generate it.   */
3417
 
3418
              if (IS_CONST (yyvsp[-1].expr) && !IS_UIMM (yyvsp[-1].expr, 16))
3419
                return yyerror ("Immediate value out of range");
3420
 
3421
              notethat ("LDIMMhalf: regs = luimm16 (x)\n");
3422
              /* reg, H, S, Z.  */
3423
              yyval.instr = LDIMMHALF_R5 (&yyvsp[-3].reg, 0, 0, 1, yyvsp[-1].expr);
3424
            }
3425
        }
3426
    break;
3427
 
3428
  case 51:
3429
#line 1297 "bfin-parse.y"
3430
    {
3431
          if (IS_H (yyvsp[-2].reg))
3432
            return yyerror ("Low reg expected");
3433
 
3434
          if (IS_DREG (yyvsp[-2].reg) && yyvsp[0].reg.regno == REG_A0x)
3435
            {
3436
              notethat ("dsp32alu: dregs_lo = A0.x\n");
3437
              yyval.instr = DSP32ALU (10, 0, 0, &yyvsp[-2].reg, 0, 0, 0, 0, 0);
3438
            }
3439
          else if (IS_DREG (yyvsp[-2].reg) && yyvsp[0].reg.regno == REG_A1x)
3440
            {
3441
              notethat ("dsp32alu: dregs_lo = A1.x\n");
3442
              yyval.instr = DSP32ALU (10, 0, 0, &yyvsp[-2].reg, 0, 0, 0, 0, 1);
3443
            }
3444
          else
3445
            return yyerror ("Register mismatch");
3446
        }
3447
    break;
3448
 
3449
  case 52:
3450
#line 1316 "bfin-parse.y"
3451
    {
3452
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
3453
            {
3454
              notethat ("dsp32alu: dregs = dregs .|. dregs (amod0)\n");
3455
              yyval.instr = DSP32ALU (0, 0, 0, &yyvsp[-5].reg, &yyvsp[-3].reg, &yyvsp[-1].reg, yyvsp[0].modcodes.s0, yyvsp[0].modcodes.x0, yyvsp[-2].r0.r0);
3456
            }
3457
          else
3458
            return yyerror ("Register mismatch");
3459
        }
3460
    break;
3461
 
3462
  case 53:
3463
#line 1327 "bfin-parse.y"
3464
    {
3465
          if (IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
3466
            {
3467
              notethat ("ALU2op: dregs = dregs_byte\n");
3468
              yyval.instr = ALU2OP (&yyvsp[-3].reg, &yyvsp[-1].reg, 12 | (yyvsp[0].r0.r0 ? 0: 1));
3469
            }
3470
          else
3471
            return yyerror ("Register mismatch");
3472
        }
3473
    break;
3474
 
3475
  case 54:
3476
#line 1338 "bfin-parse.y"
3477
    {
3478
          if (REG_SAME (yyvsp[-6].reg, yyvsp[-4].reg) && REG_SAME (yyvsp[-2].reg, yyvsp[0].reg) && !REG_SAME (yyvsp[-6].reg, yyvsp[-2].reg))
3479
            {
3480
              notethat ("dsp32alu: A1 = ABS A1 , A0 = ABS A0\n");
3481
              yyval.instr = DSP32ALU (16, 0, 0, 0, 0, 0, 0, 0, 3);
3482
            }
3483
          else
3484
            return yyerror ("Register mismatch");
3485
        }
3486
    break;
3487
 
3488
  case 55:
3489
#line 1349 "bfin-parse.y"
3490
    {
3491
          if (REG_SAME (yyvsp[-6].reg, yyvsp[-4].reg) && REG_SAME (yyvsp[-2].reg, yyvsp[0].reg) && !REG_SAME (yyvsp[-6].reg, yyvsp[-2].reg))
3492
            {
3493
              notethat ("dsp32alu: A1 = - A1 , A0 = - A0\n");
3494
              yyval.instr = DSP32ALU (14, 0, 0, 0, 0, 0, 0, 0, 3);
3495
            }
3496
          else
3497
            return yyerror ("Register mismatch");
3498
        }
3499
    break;
3500
 
3501
  case 56:
3502
#line 1360 "bfin-parse.y"
3503
    {
3504
          if (!IS_A1 (yyvsp[-2].reg) && IS_A1 (yyvsp[-1].reg))
3505
            {
3506
              notethat ("dsp32alu: A0 -= A1\n");
3507
              yyval.instr = DSP32ALU (11, 0, 0, 0, 0, 0, yyvsp[0].r0.r0, 0, 3);
3508
            }
3509
          else
3510
            return yyerror ("Register mismatch");
3511
        }
3512
    break;
3513
 
3514
  case 57:
3515
#line 1371 "bfin-parse.y"
3516
    {
3517
          if (IS_IREG (yyvsp[-2].reg) && EXPR_VALUE (yyvsp[0].expr) == 4)
3518
            {
3519
              notethat ("dagMODik: iregs -= 4\n");
3520
              yyval.instr = DAGMODIK (&yyvsp[-2].reg, 3);
3521
            }
3522
          else if (IS_IREG (yyvsp[-2].reg) && EXPR_VALUE (yyvsp[0].expr) == 2)
3523
            {
3524
              notethat ("dagMODik: iregs -= 2\n");
3525
              yyval.instr = DAGMODIK (&yyvsp[-2].reg, 1);
3526
            }
3527
          else
3528
            return yyerror ("Register or value mismatch");
3529
        }
3530
    break;
3531
 
3532
  case 58:
3533
#line 1387 "bfin-parse.y"
3534
    {
3535
          if (IS_IREG (yyvsp[-5].reg) && IS_MREG (yyvsp[-3].reg))
3536
            {
3537
              notethat ("dagMODim: iregs += mregs (opt_brev)\n");
3538
              /* i, m, op, br.  */
3539
              yyval.instr = DAGMODIM (&yyvsp[-5].reg, &yyvsp[-3].reg, 0, 1);
3540
            }
3541
          else if (IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-3].reg))
3542
            {
3543
              notethat ("PTR2op: pregs += pregs (BREV )\n");
3544
              yyval.instr = PTR2OP (&yyvsp[-5].reg, &yyvsp[-3].reg, 5);
3545
            }
3546
          else
3547
            return yyerror ("Register mismatch");
3548
        }
3549
    break;
3550
 
3551
  case 59:
3552
#line 1404 "bfin-parse.y"
3553
    {
3554
          if (IS_IREG (yyvsp[-2].reg) && IS_MREG (yyvsp[0].reg))
3555
            {
3556
              notethat ("dagMODim: iregs -= mregs\n");
3557
              yyval.instr = DAGMODIM (&yyvsp[-2].reg, &yyvsp[0].reg, 1, 0);
3558
            }
3559
          else if (IS_PREG (yyvsp[-2].reg) && IS_PREG (yyvsp[0].reg))
3560
            {
3561
              notethat ("PTR2op: pregs -= pregs\n");
3562
              yyval.instr = PTR2OP (&yyvsp[-2].reg, &yyvsp[0].reg, 0);
3563
            }
3564
          else
3565
            return yyerror ("Register mismatch");
3566
        }
3567
    break;
3568
 
3569
  case 60:
3570
#line 1420 "bfin-parse.y"
3571
    {
3572
          if (!IS_A1 (yyvsp[-3].reg) && IS_A1 (yyvsp[-1].reg))
3573
            {
3574
              notethat ("dsp32alu: A0 += A1 (W32)\n");
3575
              yyval.instr = DSP32ALU (11, 0, 0, 0, 0, 0, yyvsp[0].r0.r0, 0, 2);
3576
            }
3577
          else
3578
            return yyerror ("Register mismatch");
3579
        }
3580
    break;
3581
 
3582
  case 61:
3583
#line 1431 "bfin-parse.y"
3584
    {
3585
          if (IS_IREG (yyvsp[-2].reg) && IS_MREG (yyvsp[0].reg))
3586
            {
3587
              notethat ("dagMODim: iregs += mregs\n");
3588
              yyval.instr = DAGMODIM (&yyvsp[-2].reg, &yyvsp[0].reg, 0, 0);
3589
            }
3590
          else
3591
            return yyerror ("iregs += mregs expected");
3592
        }
3593
    break;
3594
 
3595
  case 62:
3596
#line 1442 "bfin-parse.y"
3597
    {
3598
          if (IS_IREG (yyvsp[-2].reg))
3599
            {
3600
              if (EXPR_VALUE (yyvsp[0].expr) == 4)
3601
                {
3602
                  notethat ("dagMODik: iregs += 4\n");
3603
                  yyval.instr = DAGMODIK (&yyvsp[-2].reg, 2);
3604
                }
3605
              else if (EXPR_VALUE (yyvsp[0].expr) == 2)
3606
                {
3607
                  notethat ("dagMODik: iregs += 2\n");
3608
                  yyval.instr = DAGMODIK (&yyvsp[-2].reg, 0);
3609
                }
3610
              else
3611
                return yyerror ("iregs += [ 2 | 4 ");
3612
            }
3613
          else if (IS_PREG (yyvsp[-2].reg) && IS_IMM (yyvsp[0].expr, 7))
3614
            {
3615
              notethat ("COMPI2opP: pregs += imm7\n");
3616
              yyval.instr = COMPI2OPP (&yyvsp[-2].reg, imm7 (yyvsp[0].expr), 1);
3617
            }
3618
          else if (IS_DREG (yyvsp[-2].reg) && IS_IMM (yyvsp[0].expr, 7))
3619
            {
3620
              notethat ("COMPI2opD: dregs += imm7\n");
3621
              yyval.instr = COMPI2OPD (&yyvsp[-2].reg, imm7 (yyvsp[0].expr), 1);
3622
            }
3623
          else if ((IS_DREG (yyvsp[-2].reg) || IS_PREG (yyvsp[-2].reg)) && IS_CONST (yyvsp[0].expr))
3624
            return yyerror ("Immediate value out of range");
3625
          else
3626
            return yyerror ("Register mismatch");
3627
        }
3628
    break;
3629
 
3630
  case 63:
3631
#line 1475 "bfin-parse.y"
3632
    {
3633
          if (IS_DREG (yyvsp[-2].reg) && IS_DREG (yyvsp[0].reg))
3634
            {
3635
              notethat ("ALU2op: dregs *= dregs\n");
3636
              yyval.instr = ALU2OP (&yyvsp[-2].reg, &yyvsp[0].reg, 3);
3637
            }
3638
          else
3639
            return yyerror ("Register mismatch");
3640
        }
3641
    break;
3642
 
3643
  case 64:
3644
#line 1486 "bfin-parse.y"
3645
    {
3646
          if (!valid_dreg_pair (&yyvsp[-8].reg, yyvsp[-6].expr))
3647
            return yyerror ("Bad dreg pair");
3648
          else if (!valid_dreg_pair (&yyvsp[-4].reg, yyvsp[-2].expr))
3649
            return yyerror ("Bad dreg pair");
3650
          else
3651
            {
3652
              notethat ("dsp32alu: SAA (dregs_pair , dregs_pair ) (aligndir)\n");
3653
              yyval.instr = DSP32ALU (18, 0, 0, 0, &yyvsp[-8].reg, &yyvsp[-4].reg, yyvsp[0].r0.r0, 0, 0);
3654
            }
3655
        }
3656
    break;
3657
 
3658
  case 65:
3659
#line 1499 "bfin-parse.y"
3660
    {
3661
          if (REG_SAME (yyvsp[-10].reg, yyvsp[-9].reg) && REG_SAME (yyvsp[-4].reg, yyvsp[-3].reg) && !REG_SAME (yyvsp[-10].reg, yyvsp[-4].reg))
3662
            {
3663
              notethat ("dsp32alu: A1 = A1 (S) , A0 = A0 (S)\n");
3664
              yyval.instr = DSP32ALU (8, 0, 0, 0, 0, 0, 1, 0, 2);
3665
            }
3666
          else
3667
            return yyerror ("Register mismatch");
3668
        }
3669
    break;
3670
 
3671
  case 66:
3672
#line 1510 "bfin-parse.y"
3673
    {
3674
          if (IS_DREG (yyvsp[-8].reg) && IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg)
3675
              && REG_SAME (yyvsp[-8].reg, yyvsp[-5].reg))
3676
            {
3677
              if (EXPR_VALUE (yyvsp[0].expr) == 1)
3678
                {
3679
                  notethat ("ALU2op: dregs = (dregs + dregs) << 1\n");
3680
                  yyval.instr = ALU2OP (&yyvsp[-8].reg, &yyvsp[-3].reg, 4);
3681
                }
3682
              else if (EXPR_VALUE (yyvsp[0].expr) == 2)
3683
                {
3684
                  notethat ("ALU2op: dregs = (dregs + dregs) << 2\n");
3685
                  yyval.instr = ALU2OP (&yyvsp[-8].reg, &yyvsp[-3].reg, 5);
3686
                }
3687
              else
3688
                return yyerror ("Bad shift value");
3689
            }
3690
          else if (IS_PREG (yyvsp[-8].reg) && IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-3].reg)
3691
                   && REG_SAME (yyvsp[-8].reg, yyvsp[-5].reg))
3692
            {
3693
              if (EXPR_VALUE (yyvsp[0].expr) == 1)
3694
                {
3695
                  notethat ("PTR2op: pregs = (pregs + pregs) << 1\n");
3696
                  yyval.instr = PTR2OP (&yyvsp[-8].reg, &yyvsp[-3].reg, 6);
3697
                }
3698
              else if (EXPR_VALUE (yyvsp[0].expr) == 2)
3699
                {
3700
                  notethat ("PTR2op: pregs = (pregs + pregs) << 2\n");
3701
                  yyval.instr = PTR2OP (&yyvsp[-8].reg, &yyvsp[-3].reg, 7);
3702
                }
3703
              else
3704
                return yyerror ("Bad shift value");
3705
            }
3706
          else
3707
            return yyerror ("Register mismatch");
3708
        }
3709
    break;
3710
 
3711
  case 67:
3712
#line 1549 "bfin-parse.y"
3713
    {
3714
          if (IS_DREG (yyvsp[-4].reg) && IS_DREG (yyvsp[-2].reg) && IS_DREG (yyvsp[0].reg))
3715
            {
3716
              notethat ("COMP3op: dregs = dregs | dregs\n");
3717
              yyval.instr = COMP3OP (&yyvsp[-4].reg, &yyvsp[-2].reg, &yyvsp[0].reg, 3);
3718
            }
3719
          else
3720
            return yyerror ("Dregs expected");
3721
        }
3722
    break;
3723
 
3724
  case 68:
3725
#line 1559 "bfin-parse.y"
3726
    {
3727
          if (IS_DREG (yyvsp[-4].reg) && IS_DREG (yyvsp[-2].reg) && IS_DREG (yyvsp[0].reg))
3728
            {
3729
              notethat ("COMP3op: dregs = dregs ^ dregs\n");
3730
              yyval.instr = COMP3OP (&yyvsp[-4].reg, &yyvsp[-2].reg, &yyvsp[0].reg, 4);
3731
            }
3732
          else
3733
            return yyerror ("Dregs expected");
3734
        }
3735
    break;
3736
 
3737
  case 69:
3738
#line 1569 "bfin-parse.y"
3739
    {
3740
          if (IS_PREG (yyvsp[-8].reg) && IS_PREG (yyvsp[-6].reg) && IS_PREG (yyvsp[-3].reg))
3741
            {
3742
              if (EXPR_VALUE (yyvsp[-1].expr) == 1)
3743
                {
3744
                  notethat ("COMP3op: pregs = pregs + (pregs << 1)\n");
3745
                  yyval.instr = COMP3OP (&yyvsp[-8].reg, &yyvsp[-6].reg, &yyvsp[-3].reg, 6);
3746
                }
3747
              else if (EXPR_VALUE (yyvsp[-1].expr) == 2)
3748
                {
3749
                  notethat ("COMP3op: pregs = pregs + (pregs << 2)\n");
3750
                  yyval.instr = COMP3OP (&yyvsp[-8].reg, &yyvsp[-6].reg, &yyvsp[-3].reg, 7);
3751
                }
3752
              else
3753
                  return yyerror ("Bad shift value");
3754
            }
3755
          else
3756
            return yyerror ("Dregs expected");
3757
        }
3758
    break;
3759
 
3760
  case 70:
3761
#line 1589 "bfin-parse.y"
3762
    {
3763
          if (yyvsp[-2].reg.regno == REG_A0 && yyvsp[0].reg.regno == REG_A1)
3764
            {
3765
              notethat ("CCflag: CC = A0 == A1\n");
3766
              yyval.instr = CCFLAG (0, 0, 5, 0, 0);
3767
            }
3768
          else
3769
            return yyerror ("AREGs are in bad order or same");
3770
        }
3771
    break;
3772
 
3773
  case 71:
3774
#line 1599 "bfin-parse.y"
3775
    {
3776
          if (yyvsp[-2].reg.regno == REG_A0 && yyvsp[0].reg.regno == REG_A1)
3777
            {
3778
              notethat ("CCflag: CC = A0 < A1\n");
3779
              yyval.instr = CCFLAG (0, 0, 6, 0, 0);
3780
            }
3781
          else
3782
            return yyerror ("AREGs are in bad order or same");
3783
        }
3784
    break;
3785
 
3786
  case 72:
3787
#line 1609 "bfin-parse.y"
3788
    {
3789
          if (REG_CLASS(yyvsp[-3].reg) == REG_CLASS(yyvsp[-1].reg))
3790
            {
3791
              notethat ("CCflag: CC = dpregs < dpregs\n");
3792
              yyval.instr = CCFLAG (&yyvsp[-3].reg, yyvsp[-1].reg.regno & CODE_MASK, yyvsp[0].r0.r0, 0, IS_PREG (yyvsp[-3].reg) ? 1 : 0);
3793
            }
3794
          else
3795
            return yyerror ("Compare only of same register class");
3796
        }
3797
    break;
3798
 
3799
  case 73:
3800
#line 1619 "bfin-parse.y"
3801
    {
3802
          if ((yyvsp[0].r0.r0 == 1 && IS_IMM (yyvsp[-1].expr, 3))
3803
              || (yyvsp[0].r0.r0 == 3 && IS_UIMM (yyvsp[-1].expr, 3)))
3804
            {
3805
              notethat ("CCflag: CC = dpregs < (u)imm3\n");
3806
              yyval.instr = CCFLAG (&yyvsp[-3].reg, imm3 (yyvsp[-1].expr), yyvsp[0].r0.r0, 1, IS_PREG (yyvsp[-3].reg) ? 1 : 0);
3807
            }
3808
          else
3809
            return yyerror ("Bad constant value");
3810
        }
3811
    break;
3812
 
3813
  case 74:
3814
#line 1630 "bfin-parse.y"
3815
    {
3816
          if (REG_CLASS(yyvsp[-2].reg) == REG_CLASS(yyvsp[0].reg))
3817
            {
3818
              notethat ("CCflag: CC = dpregs == dpregs\n");
3819
              yyval.instr = CCFLAG (&yyvsp[-2].reg, yyvsp[0].reg.regno & CODE_MASK, 0, 0, IS_PREG (yyvsp[-2].reg) ? 1 : 0);
3820
            }
3821
          else
3822
            return yyerror ("Compare only of same register class");
3823
        }
3824
    break;
3825
 
3826
  case 75:
3827
#line 1640 "bfin-parse.y"
3828
    {
3829
          if (IS_IMM (yyvsp[0].expr, 3))
3830
            {
3831
              notethat ("CCflag: CC = dpregs == imm3\n");
3832
              yyval.instr = CCFLAG (&yyvsp[-2].reg, imm3 (yyvsp[0].expr), 0, 1, IS_PREG (yyvsp[-2].reg) ? 1 : 0);
3833
            }
3834
          else
3835
            return yyerror ("Bad constant range");
3836
        }
3837
    break;
3838
 
3839
  case 76:
3840
#line 1650 "bfin-parse.y"
3841
    {
3842
          if (yyvsp[-2].reg.regno == REG_A0 && yyvsp[0].reg.regno == REG_A1)
3843
            {
3844
              notethat ("CCflag: CC = A0 <= A1\n");
3845
              yyval.instr = CCFLAG (0, 0, 7, 0, 0);
3846
            }
3847
          else
3848
            return yyerror ("AREGs are in bad order or same");
3849
        }
3850
    break;
3851
 
3852
  case 77:
3853
#line 1660 "bfin-parse.y"
3854
    {
3855
          if (REG_CLASS(yyvsp[-3].reg) == REG_CLASS(yyvsp[-1].reg))
3856
            {
3857
              notethat ("CCflag: CC = pregs <= pregs (..)\n");
3858
              yyval.instr = CCFLAG (&yyvsp[-3].reg, yyvsp[-1].reg.regno & CODE_MASK,
3859
                           1 + yyvsp[0].r0.r0, 0, IS_PREG (yyvsp[-3].reg) ? 1 : 0);
3860
            }
3861
          else
3862
            return yyerror ("Compare only of same register class");
3863
        }
3864
    break;
3865
 
3866
  case 78:
3867
#line 1671 "bfin-parse.y"
3868
    {
3869
          if ((yyvsp[0].r0.r0 == 1 && IS_IMM (yyvsp[-1].expr, 3))
3870
              || (yyvsp[0].r0.r0 == 3 && IS_UIMM (yyvsp[-1].expr, 3)))
3871
            {
3872
              if (IS_DREG (yyvsp[-3].reg))
3873
                {
3874
                  notethat ("CCflag: CC = dregs <= (u)imm3\n");
3875
                  /*    x       y     opc     I     G   */
3876
                  yyval.instr = CCFLAG (&yyvsp[-3].reg, imm3 (yyvsp[-1].expr), 1 + yyvsp[0].r0.r0, 1, 0);
3877
                }
3878
              else if (IS_PREG (yyvsp[-3].reg))
3879
                {
3880
                  notethat ("CCflag: CC = pregs <= (u)imm3\n");
3881
                  /*    x       y     opc     I     G   */
3882
                  yyval.instr = CCFLAG (&yyvsp[-3].reg, imm3 (yyvsp[-1].expr), 1 + yyvsp[0].r0.r0, 1, 1);
3883
                }
3884
              else
3885
                return yyerror ("Dreg or Preg expected");
3886
            }
3887
          else
3888
            return yyerror ("Bad constant value");
3889
        }
3890
    break;
3891
 
3892
  case 79:
3893
#line 1695 "bfin-parse.y"
3894
    {
3895
          if (IS_DREG (yyvsp[-4].reg) && IS_DREG (yyvsp[-2].reg) && IS_DREG (yyvsp[0].reg))
3896
            {
3897
              notethat ("COMP3op: dregs = dregs & dregs\n");
3898
              yyval.instr = COMP3OP (&yyvsp[-4].reg, &yyvsp[-2].reg, &yyvsp[0].reg, 2);
3899
            }
3900
          else
3901
            return yyerror ("Dregs expected");
3902
        }
3903
    break;
3904
 
3905
  case 80:
3906
#line 1706 "bfin-parse.y"
3907
    {
3908
          notethat ("CC2stat operation\n");
3909
          yyval.instr = bfin_gen_cc2stat (yyvsp[0].modcodes.r0, yyvsp[0].modcodes.x0, yyvsp[0].modcodes.s0);
3910
        }
3911
    break;
3912
 
3913
  case 81:
3914
#line 1712 "bfin-parse.y"
3915
    {
3916
          if (IS_ALLREG (yyvsp[-2].reg) && IS_ALLREG (yyvsp[0].reg))
3917
            {
3918
              notethat ("REGMV: allregs = allregs\n");
3919
              yyval.instr = bfin_gen_regmv (&yyvsp[0].reg, &yyvsp[-2].reg);
3920
            }
3921
          else
3922
            return yyerror ("Register mismatch");
3923
        }
3924
    break;
3925
 
3926
  case 82:
3927
#line 1723 "bfin-parse.y"
3928
    {
3929
          if (IS_DREG (yyvsp[0].reg))
3930
            {
3931
              notethat ("CC2dreg: CC = dregs\n");
3932
              yyval.instr = bfin_gen_cc2dreg (1, &yyvsp[0].reg);
3933
            }
3934
          else
3935
            return yyerror ("Register mismatch");
3936
        }
3937
    break;
3938
 
3939
  case 83:
3940
#line 1734 "bfin-parse.y"
3941
    {
3942
          if (IS_DREG (yyvsp[-2].reg))
3943
            {
3944
              notethat ("CC2dreg: dregs = CC\n");
3945
              yyval.instr = bfin_gen_cc2dreg (0, &yyvsp[-2].reg);
3946
            }
3947
          else
3948
            return yyerror ("Register mismatch");
3949
        }
3950
    break;
3951
 
3952
  case 84:
3953
#line 1745 "bfin-parse.y"
3954
    {
3955
          notethat ("CC2dreg: CC =! CC\n");
3956
          yyval.instr = bfin_gen_cc2dreg (3, 0);
3957
        }
3958
    break;
3959
 
3960
  case 85:
3961
#line 1753 "bfin-parse.y"
3962
    {
3963
          notethat ("dsp32mult: dregs_half = multiply_halfregs (opt_mode)\n");
3964
 
3965
          if (!IS_H (yyvsp[-3].reg) && yyvsp[0].mod.MM)
3966
            return yyerror ("(M) not allowed with MAC0");
3967
 
3968
          if (IS_H (yyvsp[-3].reg))
3969
            {
3970
              yyval.instr = DSP32MULT (0, yyvsp[0].mod.MM, yyvsp[0].mod.mod, 1, 0,
3971
                              IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1), 0, 0,
3972
                              &yyvsp[-3].reg, 0, &yyvsp[-1].macfunc.s0, &yyvsp[-1].macfunc.s1, 0);
3973
            }
3974
          else
3975
            {
3976
              yyval.instr = DSP32MULT (0, 0, yyvsp[0].mod.mod, 0, 0,
3977
                              0, 0, IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1),
3978
                              &yyvsp[-3].reg, 0, &yyvsp[-1].macfunc.s0, &yyvsp[-1].macfunc.s1, 1);
3979
            }
3980
        }
3981
    break;
3982
 
3983
  case 86:
3984
#line 1774 "bfin-parse.y"
3985
    {
3986
          /* Odd registers can use (M).  */
3987
          if (!IS_DREG (yyvsp[-3].reg))
3988
            return yyerror ("Dreg expected");
3989
 
3990
          if (IS_EVEN (yyvsp[-3].reg) && yyvsp[0].mod.MM)
3991
            return yyerror ("(M) not allowed with MAC0");
3992
 
3993
          if (!IS_EVEN (yyvsp[-3].reg))
3994
            {
3995
              notethat ("dsp32mult: dregs = multiply_halfregs (opt_mode)\n");
3996
 
3997
              yyval.instr = DSP32MULT (0, yyvsp[0].mod.MM, yyvsp[0].mod.mod, 1, 1,
3998
                              IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1), 0, 0,
3999
                              &yyvsp[-3].reg, 0, &yyvsp[-1].macfunc.s0, &yyvsp[-1].macfunc.s1, 0);
4000
            }
4001
          else
4002
            {
4003
              notethat ("dsp32mult: dregs = multiply_halfregs opt_mode\n");
4004
              yyval.instr = DSP32MULT (0, 0, yyvsp[0].mod.mod, 0, 1,
4005
                              0, 0, IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1),
4006
                              &yyvsp[-3].reg,  0, &yyvsp[-1].macfunc.s0, &yyvsp[-1].macfunc.s1, 1);
4007
            }
4008
        }
4009
    break;
4010
 
4011
  case 87:
4012
#line 1801 "bfin-parse.y"
4013
    {
4014
          if (!IS_DREG (yyvsp[-8].reg) || !IS_DREG (yyvsp[-3].reg))
4015
            return yyerror ("Dregs expected");
4016
 
4017
          if (!IS_HCOMPL(yyvsp[-8].reg, yyvsp[-3].reg))
4018
            return yyerror ("Dest registers mismatch");
4019
 
4020
          if (check_multiply_halfregs (&yyvsp[-6].macfunc, &yyvsp[-1].macfunc) < 0)
4021
            return -1;
4022
 
4023
          if ((!IS_H (yyvsp[-8].reg) && yyvsp[-5].mod.MM)
4024
              || (!IS_H (yyvsp[-3].reg) && yyvsp[0].mod.MM))
4025
            return yyerror ("(M) not allowed with MAC0");
4026
 
4027
          notethat ("dsp32mult: dregs_hi = multiply_halfregs mxd_mod, "
4028
                    "dregs_lo = multiply_halfregs opt_mode\n");
4029
 
4030
          if (IS_H (yyvsp[-8].reg))
4031
            yyval.instr = DSP32MULT (0, yyvsp[-5].mod.MM, yyvsp[0].mod.mod, 1, 0,
4032
                            IS_H (yyvsp[-6].macfunc.s0), IS_H (yyvsp[-6].macfunc.s1), IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1),
4033
                            &yyvsp[-8].reg, 0, &yyvsp[-6].macfunc.s0, &yyvsp[-6].macfunc.s1, 1);
4034
          else
4035
            yyval.instr = DSP32MULT (0, yyvsp[0].mod.MM, yyvsp[0].mod.mod, 1, 0,
4036
                            IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1), IS_H (yyvsp[-6].macfunc.s0), IS_H (yyvsp[-6].macfunc.s1),
4037
                            &yyvsp[-8].reg, 0, &yyvsp[-6].macfunc.s0, &yyvsp[-6].macfunc.s1, 1);
4038
        }
4039
    break;
4040
 
4041
  case 88:
4042
#line 1829 "bfin-parse.y"
4043
    {
4044
          if (!IS_DREG (yyvsp[-8].reg) || !IS_DREG (yyvsp[-3].reg))
4045
            return yyerror ("Dregs expected");
4046
 
4047
          if ((IS_EVEN (yyvsp[-8].reg) && yyvsp[-3].reg.regno - yyvsp[-8].reg.regno != 1)
4048
              || (IS_EVEN (yyvsp[-3].reg) && yyvsp[-8].reg.regno - yyvsp[-3].reg.regno != 1))
4049
            return yyerror ("Dest registers mismatch");
4050
 
4051
          if (check_multiply_halfregs (&yyvsp[-6].macfunc, &yyvsp[-1].macfunc) < 0)
4052
            return -1;
4053
 
4054
          if ((IS_EVEN (yyvsp[-8].reg) && yyvsp[-5].mod.MM)
4055
              || (IS_EVEN (yyvsp[-3].reg) && yyvsp[0].mod.MM))
4056
            return yyerror ("(M) not allowed with MAC0");
4057
 
4058
          notethat ("dsp32mult: dregs = multiply_halfregs mxd_mod, "
4059
                   "dregs = multiply_halfregs opt_mode\n");
4060
 
4061
          if (IS_EVEN (yyvsp[-8].reg))
4062
            yyval.instr = DSP32MULT (0, yyvsp[0].mod.MM, yyvsp[0].mod.mod, 1, 1,
4063
                            IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1), IS_H (yyvsp[-6].macfunc.s0), IS_H (yyvsp[-6].macfunc.s1),
4064
                            &yyvsp[-8].reg, 0, &yyvsp[-6].macfunc.s0, &yyvsp[-6].macfunc.s1, 1);
4065
          else
4066
            yyval.instr = DSP32MULT (0, yyvsp[-5].mod.MM, yyvsp[0].mod.mod, 1, 1,
4067
                            IS_H (yyvsp[-6].macfunc.s0), IS_H (yyvsp[-6].macfunc.s1), IS_H (yyvsp[-1].macfunc.s0), IS_H (yyvsp[-1].macfunc.s1),
4068
                            &yyvsp[-8].reg, 0, &yyvsp[-6].macfunc.s0, &yyvsp[-6].macfunc.s1, 1);
4069
        }
4070
    break;
4071
 
4072
  case 89:
4073
#line 1860 "bfin-parse.y"
4074
    {
4075
          if (!REG_SAME (yyvsp[-4].reg, yyvsp[-2].reg))
4076
            return yyerror ("Aregs must be same");
4077
 
4078
          if (IS_DREG (yyvsp[0].reg) && !IS_H (yyvsp[0].reg))
4079
            {
4080
              notethat ("dsp32shift: A0 = ASHIFT A0 BY dregs_lo\n");
4081
              yyval.instr = DSP32SHIFT (3, 0, &yyvsp[0].reg, 0, 0, IS_A1 (yyvsp[-4].reg));
4082
            }
4083
          else
4084
            return yyerror ("Dregs expected");
4085
        }
4086
    break;
4087
 
4088
  case 90:
4089
#line 1874 "bfin-parse.y"
4090
    {
4091
          if (IS_DREG (yyvsp[-1].reg) && !IS_H (yyvsp[-1].reg))
4092
            {
4093
              notethat ("dsp32shift: dregs_half = ASHIFT dregs_half BY dregs_lo\n");
4094
              yyval.instr = DSP32SHIFT (0, &yyvsp[-6].reg, &yyvsp[-1].reg, &yyvsp[-3].reg, yyvsp[0].modcodes.s0, HL2 (yyvsp[-6].reg, yyvsp[-3].reg));
4095
            }
4096
          else
4097
            return yyerror ("Dregs expected");
4098
        }
4099
    break;
4100
 
4101
  case 91:
4102
#line 1885 "bfin-parse.y"
4103
    {
4104
          if (!REG_SAME (yyvsp[-3].reg, yyvsp[-2].reg))
4105
            return yyerror ("Aregs must be same");
4106
 
4107
          if (IS_UIMM (yyvsp[0].expr, 5))
4108
            {
4109
              notethat ("dsp32shiftimm: A0 = A0 << uimm5\n");
4110
              yyval.instr = DSP32SHIFTIMM (3, 0, imm5 (yyvsp[0].expr), 0, 0, IS_A1 (yyvsp[-3].reg));
4111
            }
4112
          else
4113
            return yyerror ("Bad shift value");
4114
        }
4115
    break;
4116
 
4117
  case 92:
4118
#line 1899 "bfin-parse.y"
4119
    {
4120
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4121
            {
4122
              if (yyvsp[0].modcodes.r0)
4123
                {
4124
                  /*  Vector?  */
4125
                  notethat ("dsp32shiftimm: dregs = dregs << expr (V, .)\n");
4126
                  yyval.instr = DSP32SHIFTIMM (1, &yyvsp[-5].reg, imm4 (yyvsp[-1].expr), &yyvsp[-3].reg, yyvsp[0].modcodes.s0 ? 1 : 2, 0);
4127
                }
4128
              else
4129
                {
4130
                  notethat ("dsp32shiftimm: dregs =  dregs << uimm5 (.)\n");
4131
                  yyval.instr = DSP32SHIFTIMM (2, &yyvsp[-5].reg, imm6 (yyvsp[-1].expr), &yyvsp[-3].reg, yyvsp[0].modcodes.s0 ? 1 : 2, 0);
4132
                }
4133
            }
4134
          else if (yyvsp[0].modcodes.s0 == 0 && IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-3].reg))
4135
            {
4136
              if (EXPR_VALUE (yyvsp[-1].expr) == 2)
4137
                {
4138
                  notethat ("PTR2op: pregs = pregs << 2\n");
4139
                  yyval.instr = PTR2OP (&yyvsp[-5].reg, &yyvsp[-3].reg, 1);
4140
                }
4141
              else if (EXPR_VALUE (yyvsp[-1].expr) == 1)
4142
                {
4143
                  notethat ("COMP3op: pregs = pregs << 1\n");
4144
                  yyval.instr = COMP3OP (&yyvsp[-5].reg, &yyvsp[-3].reg, &yyvsp[-3].reg, 5);
4145
                }
4146
              else
4147
                return yyerror ("Bad shift value");
4148
            }
4149
          else
4150
            return yyerror ("Bad shift value or register");
4151
        }
4152
    break;
4153
 
4154
  case 93:
4155
#line 1933 "bfin-parse.y"
4156
    {
4157
          if (IS_UIMM (yyvsp[0].expr, 4))
4158
            {
4159
              notethat ("dsp32shiftimm: dregs_half = dregs_half << uimm4\n");
4160
              yyval.instr = DSP32SHIFTIMM (0x0, &yyvsp[-4].reg, imm5 (yyvsp[0].expr), &yyvsp[-2].reg, 2, HL2 (yyvsp[-4].reg, yyvsp[-2].reg));
4161
            }
4162
          else
4163
            return yyerror ("Bad shift value");
4164
        }
4165
    break;
4166
 
4167
  case 94:
4168
#line 1943 "bfin-parse.y"
4169
    {
4170
          if (IS_UIMM (yyvsp[-1].expr, 4))
4171
            {
4172
              notethat ("dsp32shiftimm: dregs_half = dregs_half << uimm4\n");
4173
              yyval.instr = DSP32SHIFTIMM (0x0, &yyvsp[-5].reg, imm5 (yyvsp[-1].expr), &yyvsp[-3].reg, yyvsp[0].modcodes.s0, HL2 (yyvsp[-5].reg, yyvsp[-3].reg));
4174
            }
4175
          else
4176
            return yyerror ("Bad shift value");
4177
        }
4178
    break;
4179
 
4180
  case 95:
4181
#line 1953 "bfin-parse.y"
4182
    {
4183
          int op;
4184
 
4185
          if (IS_DREG (yyvsp[-6].reg) && IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg) && !IS_H (yyvsp[-1].reg))
4186
            {
4187
              if (yyvsp[0].modcodes.r0)
4188
                {
4189
                  op = 1;
4190
                  notethat ("dsp32shift: dregs = ASHIFT dregs BY "
4191
                           "dregs_lo (V, .)\n");
4192
                }
4193
              else
4194
                {
4195
 
4196
                  op = 2;
4197
                  notethat ("dsp32shift: dregs = ASHIFT dregs BY dregs_lo (.)\n");
4198
                }
4199
              yyval.instr = DSP32SHIFT (op, &yyvsp[-6].reg, &yyvsp[-1].reg, &yyvsp[-3].reg, yyvsp[0].modcodes.s0, 0);
4200
            }
4201
          else
4202
            return yyerror ("Dregs expected");
4203
        }
4204
    break;
4205
 
4206
  case 96:
4207
#line 1978 "bfin-parse.y"
4208
    {
4209
          if (IS_DREG_L (yyvsp[-8].reg) && IS_DREG_L (yyvsp[-4].reg) && IS_DREG_L (yyvsp[-2].reg))
4210
            {
4211
              notethat ("dsp32shift: dregs_lo = EXPADJ (dregs , dregs_lo )\n");
4212
              yyval.instr = DSP32SHIFT (7, &yyvsp[-8].reg, &yyvsp[-2].reg, &yyvsp[-4].reg, yyvsp[0].r0.r0, 0);
4213
            }
4214
          else
4215
            return yyerror ("Bad shift value or register");
4216
        }
4217
    break;
4218
 
4219
  case 97:
4220
#line 1990 "bfin-parse.y"
4221
    {
4222
          if (IS_DREG_L (yyvsp[-7].reg) && IS_DREG_L (yyvsp[-3].reg) && IS_DREG_L (yyvsp[-1].reg))
4223
            {
4224
              notethat ("dsp32shift: dregs_lo = EXPADJ (dregs_lo, dregs_lo)\n");
4225
              yyval.instr = DSP32SHIFT (7, &yyvsp[-7].reg, &yyvsp[-1].reg, &yyvsp[-3].reg, 2, 0);
4226
            }
4227
          else if (IS_DREG_L (yyvsp[-7].reg) && IS_DREG_H (yyvsp[-3].reg) && IS_DREG_L (yyvsp[-1].reg))
4228
            {
4229
              notethat ("dsp32shift: dregs_lo = EXPADJ (dregs_hi, dregs_lo)\n");
4230
              yyval.instr = DSP32SHIFT (7, &yyvsp[-7].reg, &yyvsp[-1].reg, &yyvsp[-3].reg, 3, 0);
4231
            }
4232
          else
4233
            return yyerror ("Bad shift value or register");
4234
        }
4235
    break;
4236
 
4237
  case 98:
4238
#line 2008 "bfin-parse.y"
4239
    {
4240
          if (IS_DREG (yyvsp[-7].reg) && IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
4241
            {
4242
              notethat ("dsp32shift: dregs = DEPOSIT (dregs , dregs )\n");
4243
              yyval.instr = DSP32SHIFT (10, &yyvsp[-7].reg, &yyvsp[-1].reg, &yyvsp[-3].reg, 2, 0);
4244
            }
4245
          else
4246
            return yyerror ("Register mismatch");
4247
        }
4248
    break;
4249
 
4250
  case 99:
4251
#line 2019 "bfin-parse.y"
4252
    {
4253
          if (IS_DREG (yyvsp[-10].reg) && IS_DREG (yyvsp[-6].reg) && IS_DREG (yyvsp[-4].reg))
4254
            {
4255
              notethat ("dsp32shift: dregs = DEPOSIT (dregs , dregs ) (X)\n");
4256
              yyval.instr = DSP32SHIFT (10, &yyvsp[-10].reg, &yyvsp[-4].reg, &yyvsp[-6].reg, 3, 0);
4257
            }
4258
          else
4259
            return yyerror ("Register mismatch");
4260
        }
4261
    break;
4262
 
4263
  case 100:
4264
#line 2030 "bfin-parse.y"
4265
    {
4266
          if (IS_DREG (yyvsp[-8].reg) && IS_DREG (yyvsp[-4].reg) && IS_DREG_L (yyvsp[-2].reg))
4267
            {
4268
              notethat ("dsp32shift: dregs = EXTRACT (dregs, dregs_lo ) (.)\n");
4269
              yyval.instr = DSP32SHIFT (10, &yyvsp[-8].reg, &yyvsp[-2].reg, &yyvsp[-4].reg, yyvsp[0].r0.r0, 0);
4270
            }
4271
          else
4272
            return yyerror ("Register mismatch");
4273
        }
4274
    break;
4275
 
4276
  case 101:
4277
#line 2041 "bfin-parse.y"
4278
    {
4279
          if (!REG_SAME (yyvsp[-3].reg, yyvsp[-2].reg))
4280
            return yyerror ("Aregs must be same");
4281
 
4282
          if (IS_UIMM (yyvsp[0].expr, 5))
4283
            {
4284
              notethat ("dsp32shiftimm: Ax = Ax >>> uimm5\n");
4285
              yyval.instr = DSP32SHIFTIMM (3, 0, -imm6 (yyvsp[0].expr), 0, 0, IS_A1 (yyvsp[-3].reg));
4286
            }
4287
          else
4288
            return yyerror ("Shift value range error");
4289
        }
4290
    break;
4291
 
4292
  case 102:
4293
#line 2054 "bfin-parse.y"
4294
    {
4295
          if (REG_SAME (yyvsp[-4].reg, yyvsp[-2].reg) && IS_DREG_L (yyvsp[0].reg))
4296
            {
4297
              notethat ("dsp32shift: Ax = LSHIFT Ax BY dregs_lo\n");
4298
              yyval.instr = DSP32SHIFT (3, 0, &yyvsp[0].reg, 0, 1, IS_A1 (yyvsp[-4].reg));
4299
            }
4300
          else
4301
            return yyerror ("Register mismatch");
4302
        }
4303
    break;
4304
 
4305
  case 103:
4306
#line 2065 "bfin-parse.y"
4307
    {
4308
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-2].reg) && IS_DREG_L (yyvsp[0].reg))
4309
            {
4310
              notethat ("dsp32shift: dregs_lo = LSHIFT dregs_hi BY dregs_lo\n");
4311
              yyval.instr = DSP32SHIFT (0, &yyvsp[-5].reg, &yyvsp[0].reg, &yyvsp[-2].reg, 2, HL2 (yyvsp[-5].reg, yyvsp[-2].reg));
4312
            }
4313
          else
4314
            return yyerror ("Register mismatch");
4315
        }
4316
    break;
4317
 
4318
  case 104:
4319
#line 2076 "bfin-parse.y"
4320
    {
4321
          if (IS_DREG (yyvsp[-6].reg) && IS_DREG (yyvsp[-3].reg) && IS_DREG_L (yyvsp[-1].reg))
4322
            {
4323
              notethat ("dsp32shift: dregs = LSHIFT dregs BY dregs_lo (V )\n");
4324
              yyval.instr = DSP32SHIFT (yyvsp[0].r0.r0 ? 1: 2, &yyvsp[-6].reg, &yyvsp[-1].reg, &yyvsp[-3].reg, 2, 0);
4325
            }
4326
          else
4327
            return yyerror ("Register mismatch");
4328
        }
4329
    break;
4330
 
4331
  case 105:
4332
#line 2087 "bfin-parse.y"
4333
    {
4334
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-2].reg) && IS_DREG_L (yyvsp[0].reg))
4335
            {
4336
              notethat ("dsp32shift: dregs = SHIFT dregs BY dregs_lo\n");
4337
              yyval.instr = DSP32SHIFT (2, &yyvsp[-5].reg, &yyvsp[0].reg, &yyvsp[-2].reg, 2, 0);
4338
            }
4339
          else
4340
            return yyerror ("Register mismatch");
4341
        }
4342
    break;
4343
 
4344
  case 106:
4345
#line 2098 "bfin-parse.y"
4346
    {
4347
          if (REG_SAME (yyvsp[-3].reg, yyvsp[-2].reg) && IS_IMM (yyvsp[0].expr, 6) >= 0)
4348
            {
4349
              notethat ("dsp32shiftimm: Ax = Ax >> imm6\n");
4350
              yyval.instr = DSP32SHIFTIMM (3, 0, -imm6 (yyvsp[0].expr), 0, 1, IS_A1 (yyvsp[-3].reg));
4351
            }
4352
          else
4353
            return yyerror ("Accu register expected");
4354
        }
4355
    break;
4356
 
4357
  case 107:
4358
#line 2109 "bfin-parse.y"
4359
    {
4360
          if (yyvsp[0].r0.r0 == 1)
4361
            {
4362
              if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4363
                {
4364
                  notethat ("dsp32shiftimm: dregs = dregs >> uimm5 (V)\n");
4365
                  yyval.instr = DSP32SHIFTIMM (1, &yyvsp[-5].reg, -uimm5 (yyvsp[-1].expr), &yyvsp[-3].reg, 2, 0);
4366
                }
4367
              else
4368
                return yyerror ("Register mismatch");
4369
            }
4370
          else
4371
            {
4372
              if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4373
                {
4374
                  notethat ("dsp32shiftimm: dregs = dregs >> uimm5\n");
4375
                  yyval.instr = DSP32SHIFTIMM (2, &yyvsp[-5].reg, -imm6 (yyvsp[-1].expr), &yyvsp[-3].reg, 2, 0);
4376
                }
4377
              else if (IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-3].reg) && EXPR_VALUE (yyvsp[-1].expr) == 2)
4378
                {
4379
                  notethat ("PTR2op: pregs = pregs >> 2\n");
4380
                  yyval.instr = PTR2OP (&yyvsp[-5].reg, &yyvsp[-3].reg, 3);
4381
                }
4382
              else if (IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-3].reg) && EXPR_VALUE (yyvsp[-1].expr) == 1)
4383
                {
4384
                  notethat ("PTR2op: pregs = pregs >> 1\n");
4385
                  yyval.instr = PTR2OP (&yyvsp[-5].reg, &yyvsp[-3].reg, 4);
4386
                }
4387
              else
4388
                return yyerror ("Register mismatch");
4389
            }
4390
        }
4391
    break;
4392
 
4393
  case 108:
4394
#line 2142 "bfin-parse.y"
4395
    {
4396
          if (IS_UIMM (yyvsp[0].expr, 5))
4397
            {
4398
              notethat ("dsp32shiftimm:  dregs_half =  dregs_half >> uimm5\n");
4399
              yyval.instr = DSP32SHIFTIMM (0, &yyvsp[-4].reg, -uimm5 (yyvsp[0].expr), &yyvsp[-2].reg, 2, HL2 (yyvsp[-4].reg, yyvsp[-2].reg));
4400
            }
4401
          else
4402
            return yyerror ("Register mismatch");
4403
        }
4404
    break;
4405
 
4406
  case 109:
4407
#line 2152 "bfin-parse.y"
4408
    {
4409
          if (IS_UIMM (yyvsp[-1].expr, 5))
4410
            {
4411
              notethat ("dsp32shiftimm: dregs_half = dregs_half >>> uimm5\n");
4412
              yyval.instr = DSP32SHIFTIMM (0, &yyvsp[-5].reg, -uimm5 (yyvsp[-1].expr), &yyvsp[-3].reg,
4413
                                  yyvsp[0].modcodes.s0, HL2 (yyvsp[-5].reg, yyvsp[-3].reg));
4414
            }
4415
          else
4416
            return yyerror ("Register or modifier mismatch");
4417
        }
4418
    break;
4419
 
4420
  case 110:
4421
#line 2165 "bfin-parse.y"
4422
    {
4423
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4424
            {
4425
              if (yyvsp[0].modcodes.r0)
4426
                {
4427
                  /* Vector?  */
4428
                  notethat ("dsp32shiftimm: dregs  =  dregs >>> uimm5 (V, .)\n");
4429
                  yyval.instr = DSP32SHIFTIMM (1, &yyvsp[-5].reg, -uimm5 (yyvsp[-1].expr), &yyvsp[-3].reg, yyvsp[0].modcodes.s0, 0);
4430
                }
4431
              else
4432
                {
4433
                  notethat ("dsp32shiftimm: dregs  =  dregs >>> uimm5 (.)\n");
4434
                  yyval.instr = DSP32SHIFTIMM (2, &yyvsp[-5].reg, -uimm5 (yyvsp[-1].expr), &yyvsp[-3].reg, yyvsp[0].modcodes.s0, 0);
4435
                }
4436
            }
4437
          else
4438
            return yyerror ("Register mismatch");
4439
        }
4440
    break;
4441
 
4442
  case 111:
4443
#line 2185 "bfin-parse.y"
4444
    {
4445
          if (IS_DREG_L (yyvsp[-3].reg) && IS_DREG (yyvsp[0].reg))
4446
            {
4447
              notethat ("dsp32shift: dregs_lo = ONES dregs\n");
4448
              yyval.instr = DSP32SHIFT (6, &yyvsp[-3].reg, 0, &yyvsp[0].reg, 3, 0);
4449
            }
4450
          else
4451
            return yyerror ("Register mismatch");
4452
        }
4453
    break;
4454
 
4455
  case 112:
4456
#line 2196 "bfin-parse.y"
4457
    {
4458
          if (IS_DREG (yyvsp[-7].reg) && IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
4459
            {
4460
              notethat ("dsp32shift: dregs = PACK (dregs_hi , dregs_hi )\n");
4461
              yyval.instr = DSP32SHIFT (4, &yyvsp[-7].reg, &yyvsp[-1].reg, &yyvsp[-3].reg, HL2 (yyvsp[-3].reg, yyvsp[-1].reg), 0);
4462
            }
4463
          else
4464
            return yyerror ("Register mismatch");
4465
        }
4466
    break;
4467
 
4468
  case 113:
4469
#line 2207 "bfin-parse.y"
4470
    {
4471
          if (IS_DREG (yyvsp[-9].reg)
4472
              && yyvsp[-3].reg.regno == REG_A0
4473
              && IS_DREG (yyvsp[-1].reg) && !IS_H (yyvsp[-9].reg) && !IS_A1 (yyvsp[-3].reg))
4474
            {
4475
              notethat ("dsp32shift: dregs_lo = CC = BXORSHIFT (A0 , dregs )\n");
4476
              yyval.instr = DSP32SHIFT (11, &yyvsp[-9].reg, &yyvsp[-1].reg, 0, 0, 0);
4477
            }
4478
          else
4479
            return yyerror ("Register mismatch");
4480
        }
4481
    break;
4482
 
4483
  case 114:
4484
#line 2220 "bfin-parse.y"
4485
    {
4486
          if (IS_DREG (yyvsp[-9].reg)
4487
              && yyvsp[-3].reg.regno == REG_A0
4488
              && IS_DREG (yyvsp[-1].reg) && !IS_H (yyvsp[-9].reg) && !IS_A1 (yyvsp[-3].reg))
4489
            {
4490
              notethat ("dsp32shift: dregs_lo = CC = BXOR (A0 , dregs)\n");
4491
              yyval.instr = DSP32SHIFT (11, &yyvsp[-9].reg, &yyvsp[-1].reg, 0, 1, 0);
4492
            }
4493
          else
4494
            return yyerror ("Register mismatch");
4495
        }
4496
    break;
4497
 
4498
  case 115:
4499
#line 2233 "bfin-parse.y"
4500
    {
4501
          if (IS_DREG (yyvsp[-11].reg) && !IS_H (yyvsp[-11].reg) && !REG_SAME (yyvsp[-5].reg, yyvsp[-3].reg))
4502
            {
4503
              notethat ("dsp32shift: dregs_lo = CC = BXOR (A0 , A1 , CC)\n");
4504
              yyval.instr = DSP32SHIFT (12, &yyvsp[-11].reg, 0, 0, 1, 0);
4505
            }
4506
          else
4507
            return yyerror ("Register mismatch");
4508
        }
4509
    break;
4510
 
4511
  case 116:
4512
#line 2244 "bfin-parse.y"
4513
    {
4514
          if (REG_SAME (yyvsp[-4].reg, yyvsp[-2].reg) && IS_DREG_L (yyvsp[0].reg))
4515
            {
4516
              notethat ("dsp32shift: Ax = ROT Ax BY dregs_lo\n");
4517
              yyval.instr = DSP32SHIFT (3, 0, &yyvsp[0].reg, 0, 2, IS_A1 (yyvsp[-4].reg));
4518
            }
4519
          else
4520
            return yyerror ("Register mismatch");
4521
        }
4522
    break;
4523
 
4524
  case 117:
4525
#line 2255 "bfin-parse.y"
4526
    {
4527
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-2].reg) && IS_DREG_L (yyvsp[0].reg))
4528
            {
4529
              notethat ("dsp32shift: dregs = ROT dregs BY dregs_lo\n");
4530
              yyval.instr = DSP32SHIFT (2, &yyvsp[-5].reg, &yyvsp[0].reg, &yyvsp[-2].reg, 3, 0);
4531
            }
4532
          else
4533
            return yyerror ("Register mismatch");
4534
        }
4535
    break;
4536
 
4537
  case 118:
4538
#line 2266 "bfin-parse.y"
4539
    {
4540
          if (IS_IMM (yyvsp[0].expr, 6))
4541
            {
4542
              notethat ("dsp32shiftimm: An = ROT An BY imm6\n");
4543
              yyval.instr = DSP32SHIFTIMM (3, 0, imm6 (yyvsp[0].expr), 0, 2, IS_A1 (yyvsp[-4].reg));
4544
            }
4545
          else
4546
            return yyerror ("Register mismatch");
4547
        }
4548
    break;
4549
 
4550
  case 119:
4551
#line 2277 "bfin-parse.y"
4552
    {
4553
          if (IS_DREG (yyvsp[-5].reg) && IS_DREG (yyvsp[-2].reg) && IS_IMM (yyvsp[0].expr, 6))
4554
            {
4555
              yyval.instr = DSP32SHIFTIMM (2, &yyvsp[-5].reg, imm6 (yyvsp[0].expr), &yyvsp[-2].reg, 3, IS_A1 (yyvsp[-5].reg));
4556
            }
4557
          else
4558
            return yyerror ("Register mismatch");
4559
        }
4560
    break;
4561
 
4562
  case 120:
4563
#line 2287 "bfin-parse.y"
4564
    {
4565
          if (IS_DREG_L (yyvsp[-3].reg))
4566
            {
4567
              notethat ("dsp32shift: dregs_lo = SIGNBITS An\n");
4568
              yyval.instr = DSP32SHIFT (6, &yyvsp[-3].reg, 0, 0, IS_A1 (yyvsp[0].reg), 0);
4569
            }
4570
          else
4571
            return yyerror ("Register mismatch");
4572
        }
4573
    break;
4574
 
4575
  case 121:
4576
#line 2298 "bfin-parse.y"
4577
    {
4578
          if (IS_DREG_L (yyvsp[-3].reg) && IS_DREG (yyvsp[0].reg))
4579
            {
4580
              notethat ("dsp32shift: dregs_lo = SIGNBITS dregs\n");
4581
              yyval.instr = DSP32SHIFT (5, &yyvsp[-3].reg, 0, &yyvsp[0].reg, 0, 0);
4582
            }
4583
          else
4584
            return yyerror ("Register mismatch");
4585
        }
4586
    break;
4587
 
4588
  case 122:
4589
#line 2309 "bfin-parse.y"
4590
    {
4591
          if (IS_DREG_L (yyvsp[-3].reg))
4592
            {
4593
              notethat ("dsp32shift: dregs_lo = SIGNBITS dregs_lo\n");
4594
              yyval.instr = DSP32SHIFT (5, &yyvsp[-3].reg, 0, &yyvsp[0].reg, 1 + IS_H (yyvsp[0].reg), 0);
4595
            }
4596
          else
4597
            return yyerror ("Register mismatch");
4598
        }
4599
    break;
4600
 
4601
  case 123:
4602
#line 2321 "bfin-parse.y"
4603
    {
4604
          if (IS_DREG_L (yyvsp[-6].reg) && IS_DREG (yyvsp[-2].reg))
4605
            {
4606
              notethat ("dsp32shift: dregs_lo = VIT_MAX (dregs) (..)\n");
4607
              yyval.instr = DSP32SHIFT (9, &yyvsp[-6].reg, 0, &yyvsp[-2].reg, (yyvsp[0].r0.r0 ? 0 : 1), 0);
4608
            }
4609
          else
4610
            return yyerror ("Register mismatch");
4611
        }
4612
    break;
4613
 
4614
  case 124:
4615
#line 2332 "bfin-parse.y"
4616
    {
4617
          if (IS_DREG (yyvsp[-8].reg) && IS_DREG (yyvsp[-4].reg) && IS_DREG (yyvsp[-2].reg))
4618
            {
4619
              notethat ("dsp32shift: dregs = VIT_MAX (dregs, dregs) (ASR)\n");
4620
              yyval.instr = DSP32SHIFT (9, &yyvsp[-8].reg, &yyvsp[-2].reg, &yyvsp[-4].reg, 2 | (yyvsp[0].r0.r0 ? 0 : 1), 0);
4621
            }
4622
          else
4623
            return yyerror ("Register mismatch");
4624
        }
4625
    break;
4626
 
4627
  case 125:
4628
#line 2343 "bfin-parse.y"
4629
    {
4630
          if (IS_DREG (yyvsp[-6].reg) && IS_DREG (yyvsp[-4].reg) && !IS_A1 (yyvsp[-2].reg))
4631
            {
4632
              notethat ("dsp32shift: BITMUX (dregs , dregs , A0) (ASR)\n");
4633
              yyval.instr = DSP32SHIFT (8, 0, &yyvsp[-6].reg, &yyvsp[-4].reg, yyvsp[0].r0.r0, 0);
4634
            }
4635
          else
4636
            return yyerror ("Register mismatch");
4637
        }
4638
    break;
4639
 
4640
  case 126:
4641
#line 2354 "bfin-parse.y"
4642
    {
4643
          if (!IS_A1 (yyvsp[-8].reg) && !IS_A1 (yyvsp[-5].reg) && IS_A1 (yyvsp[-3].reg))
4644
            {
4645
              notethat ("dsp32shift: A0 = BXORSHIFT (A0 , A1 , CC )\n");
4646
              yyval.instr = DSP32SHIFT (12, 0, 0, 0, 0, 0);
4647
            }
4648
          else
4649
            return yyerror ("Dregs expected");
4650
        }
4651
    break;
4652
 
4653
  case 127:
4654
#line 2367 "bfin-parse.y"
4655
    {
4656
          if (IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4657
            {
4658
              notethat ("LOGI2op: BITCLR (dregs , uimm5 )\n");
4659
              yyval.instr = LOGI2OP (yyvsp[-3].reg, uimm5 (yyvsp[-1].expr), 4);
4660
            }
4661
          else
4662
            return yyerror ("Register mismatch");
4663
        }
4664
    break;
4665
 
4666
  case 128:
4667
#line 2379 "bfin-parse.y"
4668
    {
4669
          if (IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4670
            {
4671
              notethat ("LOGI2op: BITCLR (dregs , uimm5 )\n");
4672
              yyval.instr = LOGI2OP (yyvsp[-3].reg, uimm5 (yyvsp[-1].expr), 2);
4673
            }
4674
          else
4675
            return yyerror ("Register mismatch");
4676
        }
4677
    break;
4678
 
4679
  case 129:
4680
#line 2391 "bfin-parse.y"
4681
    {
4682
          if (IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4683
            {
4684
              notethat ("LOGI2op: BITCLR (dregs , uimm5 )\n");
4685
              yyval.instr = LOGI2OP (yyvsp[-3].reg, uimm5 (yyvsp[-1].expr), 3);
4686
            }
4687
          else
4688
            return yyerror ("Register mismatch");
4689
        }
4690
    break;
4691
 
4692
  case 130:
4693
#line 2402 "bfin-parse.y"
4694
    {
4695
          if (IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4696
            {
4697
              notethat ("LOGI2op: CC =! BITTST (dregs , uimm5 )\n");
4698
              yyval.instr = LOGI2OP (yyvsp[-3].reg, uimm5 (yyvsp[-1].expr), 0);
4699
            }
4700
          else
4701
            return yyerror ("Register mismatch or value error");
4702
        }
4703
    break;
4704
 
4705
  case 131:
4706
#line 2413 "bfin-parse.y"
4707
    {
4708
          if (IS_DREG (yyvsp[-3].reg) && IS_UIMM (yyvsp[-1].expr, 5))
4709
            {
4710
              notethat ("LOGI2op: CC = BITTST (dregs , uimm5 )\n");
4711
              yyval.instr = LOGI2OP (yyvsp[-3].reg, uimm5 (yyvsp[-1].expr), 1);
4712
            }
4713
          else
4714
            return yyerror ("Register mismatch or value error");
4715
        }
4716
    break;
4717
 
4718
  case 132:
4719
#line 2424 "bfin-parse.y"
4720
    {
4721
          if ((IS_DREG (yyvsp[-2].reg) || IS_PREG (yyvsp[-2].reg))
4722
              && (IS_DREG (yyvsp[0].reg) || IS_PREG (yyvsp[0].reg)))
4723
            {
4724
              notethat ("ccMV: IF ! CC gregs = gregs\n");
4725
              yyval.instr = CCMV (&yyvsp[0].reg, &yyvsp[-2].reg, 0);
4726
            }
4727
          else
4728
            return yyerror ("Register mismatch");
4729
        }
4730
    break;
4731
 
4732
  case 133:
4733
#line 2436 "bfin-parse.y"
4734
    {
4735
          if ((IS_DREG (yyvsp[0].reg) || IS_PREG (yyvsp[0].reg))
4736
              && (IS_DREG (yyvsp[-2].reg) || IS_PREG (yyvsp[-2].reg)))
4737
            {
4738
              notethat ("ccMV: IF CC gregs = gregs\n");
4739
              yyval.instr = CCMV (&yyvsp[0].reg, &yyvsp[-2].reg, 1);
4740
            }
4741
          else
4742
            return yyerror ("Register mismatch");
4743
        }
4744
    break;
4745
 
4746
  case 134:
4747
#line 2448 "bfin-parse.y"
4748
    {
4749
          if (IS_PCREL10 (yyvsp[0].expr))
4750
            {
4751
              notethat ("BRCC: IF !CC JUMP  pcrel11m2\n");
4752
              yyval.instr = BRCC (0, 0, yyvsp[0].expr);
4753
            }
4754
          else
4755
            return yyerror ("Bad jump offset");
4756
        }
4757
    break;
4758
 
4759
  case 135:
4760
#line 2459 "bfin-parse.y"
4761
    {
4762
          if (IS_PCREL10 (yyvsp[-3].expr))
4763
            {
4764
              notethat ("BRCC: IF !CC JUMP  pcrel11m2\n");
4765
              yyval.instr = BRCC (0, 1, yyvsp[-3].expr);
4766
            }
4767
          else
4768
            return yyerror ("Bad jump offset");
4769
        }
4770
    break;
4771
 
4772
  case 136:
4773
#line 2470 "bfin-parse.y"
4774
    {
4775
          if (IS_PCREL10 (yyvsp[0].expr))
4776
            {
4777
              notethat ("BRCC: IF CC JUMP  pcrel11m2\n");
4778
              yyval.instr = BRCC (1, 0, yyvsp[0].expr);
4779
            }
4780
          else
4781
            return yyerror ("Bad jump offset");
4782
        }
4783
    break;
4784
 
4785
  case 137:
4786
#line 2481 "bfin-parse.y"
4787
    {
4788
          if (IS_PCREL10 (yyvsp[-3].expr))
4789
            {
4790
              notethat ("BRCC: IF !CC JUMP  pcrel11m2\n");
4791
              yyval.instr = BRCC (1, 1, yyvsp[-3].expr);
4792
            }
4793
          else
4794
            return yyerror ("Bad jump offset");
4795
        }
4796
    break;
4797
 
4798
  case 138:
4799
#line 2491 "bfin-parse.y"
4800
    {
4801
          notethat ("ProgCtrl: NOP\n");
4802
          yyval.instr = PROGCTRL (0, 0);
4803
        }
4804
    break;
4805
 
4806
  case 139:
4807
#line 2497 "bfin-parse.y"
4808
    {
4809
          notethat ("ProgCtrl: RTS\n");
4810
          yyval.instr = PROGCTRL (1, 0);
4811
        }
4812
    break;
4813
 
4814
  case 140:
4815
#line 2503 "bfin-parse.y"
4816
    {
4817
          notethat ("ProgCtrl: RTI\n");
4818
          yyval.instr = PROGCTRL (1, 1);
4819
        }
4820
    break;
4821
 
4822
  case 141:
4823
#line 2509 "bfin-parse.y"
4824
    {
4825
          notethat ("ProgCtrl: RTX\n");
4826
          yyval.instr = PROGCTRL (1, 2);
4827
        }
4828
    break;
4829
 
4830
  case 142:
4831
#line 2515 "bfin-parse.y"
4832
    {
4833
          notethat ("ProgCtrl: RTN\n");
4834
          yyval.instr = PROGCTRL (1, 3);
4835
        }
4836
    break;
4837
 
4838
  case 143:
4839
#line 2521 "bfin-parse.y"
4840
    {
4841
          notethat ("ProgCtrl: RTE\n");
4842
          yyval.instr = PROGCTRL (1, 4);
4843
        }
4844
    break;
4845
 
4846
  case 144:
4847
#line 2527 "bfin-parse.y"
4848
    {
4849
          notethat ("ProgCtrl: IDLE\n");
4850
          yyval.instr = PROGCTRL (2, 0);
4851
        }
4852
    break;
4853
 
4854
  case 145:
4855
#line 2533 "bfin-parse.y"
4856
    {
4857
          notethat ("ProgCtrl: CSYNC\n");
4858
          yyval.instr = PROGCTRL (2, 3);
4859
        }
4860
    break;
4861
 
4862
  case 146:
4863
#line 2539 "bfin-parse.y"
4864
    {
4865
          notethat ("ProgCtrl: SSYNC\n");
4866
          yyval.instr = PROGCTRL (2, 4);
4867
        }
4868
    break;
4869
 
4870
  case 147:
4871
#line 2545 "bfin-parse.y"
4872
    {
4873
          notethat ("ProgCtrl: EMUEXCPT\n");
4874
          yyval.instr = PROGCTRL (2, 5);
4875
        }
4876
    break;
4877
 
4878
  case 148:
4879
#line 2551 "bfin-parse.y"
4880
    {
4881
          if (IS_DREG (yyvsp[0].reg))
4882
            {
4883
              notethat ("ProgCtrl: CLI dregs\n");
4884
              yyval.instr = PROGCTRL (3, yyvsp[0].reg.regno & CODE_MASK);
4885
            }
4886
          else
4887
            return yyerror ("Dreg expected for CLI");
4888
        }
4889
    break;
4890
 
4891
  case 149:
4892
#line 2562 "bfin-parse.y"
4893
    {
4894
          if (IS_DREG (yyvsp[0].reg))
4895
            {
4896
              notethat ("ProgCtrl: STI dregs\n");
4897
              yyval.instr = PROGCTRL (4, yyvsp[0].reg.regno & CODE_MASK);
4898
            }
4899
          else
4900
            return yyerror ("Dreg expected for STI");
4901
        }
4902
    break;
4903
 
4904
  case 150:
4905
#line 2573 "bfin-parse.y"
4906
    {
4907
          if (IS_PREG (yyvsp[-1].reg))
4908
            {
4909
              notethat ("ProgCtrl: JUMP (pregs )\n");
4910
              yyval.instr = PROGCTRL (5, yyvsp[-1].reg.regno & CODE_MASK);
4911
            }
4912
          else
4913
            return yyerror ("Bad register for indirect jump");
4914
        }
4915
    break;
4916
 
4917
  case 151:
4918
#line 2584 "bfin-parse.y"
4919
    {
4920
          if (IS_PREG (yyvsp[-1].reg))
4921
            {
4922
              notethat ("ProgCtrl: CALL (pregs )\n");
4923
              yyval.instr = PROGCTRL (6, yyvsp[-1].reg.regno & CODE_MASK);
4924
            }
4925
          else
4926
            return yyerror ("Bad register for indirect call");
4927
        }
4928
    break;
4929
 
4930
  case 152:
4931
#line 2595 "bfin-parse.y"
4932
    {
4933
          if (IS_PREG (yyvsp[-1].reg))
4934
            {
4935
              notethat ("ProgCtrl: CALL (PC + pregs )\n");
4936
              yyval.instr = PROGCTRL (7, yyvsp[-1].reg.regno & CODE_MASK);
4937
            }
4938
          else
4939
            return yyerror ("Bad register for indirect call");
4940
        }
4941
    break;
4942
 
4943
  case 153:
4944
#line 2606 "bfin-parse.y"
4945
    {
4946
          if (IS_PREG (yyvsp[-1].reg))
4947
            {
4948
              notethat ("ProgCtrl: JUMP (PC + pregs )\n");
4949
              yyval.instr = PROGCTRL (8, yyvsp[-1].reg.regno & CODE_MASK);
4950
            }
4951
          else
4952
            return yyerror ("Bad register for indirect jump");
4953
        }
4954
    break;
4955
 
4956
  case 154:
4957
#line 2617 "bfin-parse.y"
4958
    {
4959
          if (IS_UIMM (yyvsp[0].expr, 4))
4960
            {
4961
              notethat ("ProgCtrl: RAISE uimm4\n");
4962
              yyval.instr = PROGCTRL (9, uimm4 (yyvsp[0].expr));
4963
            }
4964
          else
4965
            return yyerror ("Bad value for RAISE");
4966
        }
4967
    break;
4968
 
4969
  case 155:
4970
#line 2628 "bfin-parse.y"
4971
    {
4972
                notethat ("ProgCtrl: EMUEXCPT\n");
4973
                yyval.instr = PROGCTRL (10, uimm4 (yyvsp[0].expr));
4974
        }
4975
    break;
4976
 
4977
  case 156:
4978
#line 2634 "bfin-parse.y"
4979
    {
4980
          if (IS_PREG (yyvsp[-1].reg))
4981
            {
4982
              notethat ("ProgCtrl: TESTSET (pregs )\n");
4983
              yyval.instr = PROGCTRL (11, yyvsp[-1].reg.regno & CODE_MASK);
4984
            }
4985
          else
4986
            return yyerror ("Preg expected");
4987
        }
4988
    break;
4989
 
4990
  case 157:
4991
#line 2645 "bfin-parse.y"
4992
    {
4993
          if (IS_PCREL12 (yyvsp[0].expr))
4994
            {
4995
              notethat ("UJUMP: JUMP pcrel12\n");
4996
              yyval.instr = UJUMP (yyvsp[0].expr);
4997
            }
4998
          else
4999
            return yyerror ("Bad value for relative jump");
5000
        }
5001
    break;
5002
 
5003
  case 158:
5004
#line 2656 "bfin-parse.y"
5005
    {
5006
          if (IS_PCREL12 (yyvsp[0].expr))
5007
            {
5008
              notethat ("UJUMP: JUMP_DOT_S pcrel12\n");
5009
              yyval.instr = UJUMP(yyvsp[0].expr);
5010
            }
5011
          else
5012
            return yyerror ("Bad value for relative jump");
5013
        }
5014
    break;
5015
 
5016
  case 159:
5017
#line 2667 "bfin-parse.y"
5018
    {
5019
          if (IS_PCREL24 (yyvsp[0].expr))
5020
            {
5021
              notethat ("CALLa: jump.l pcrel24\n");
5022
              yyval.instr = CALLA (yyvsp[0].expr, 0);
5023
            }
5024
          else
5025
            return yyerror ("Bad value for long jump");
5026
        }
5027
    break;
5028
 
5029
  case 160:
5030
#line 2678 "bfin-parse.y"
5031
    {
5032
          if (IS_PCREL24 (yyvsp[0].expr))
5033
            {
5034
              notethat ("CALLa: jump.l pcrel24\n");
5035
              yyval.instr = CALLA (yyvsp[0].expr, 2);
5036
            }
5037
          else
5038
            return yyerror ("Bad value for long jump");
5039
        }
5040
    break;
5041
 
5042
  case 161:
5043
#line 2689 "bfin-parse.y"
5044
    {
5045
          if (IS_PCREL24 (yyvsp[0].expr))
5046
            {
5047
              notethat ("CALLa: CALL pcrel25m2\n");
5048
              yyval.instr = CALLA (yyvsp[0].expr, 1);
5049
            }
5050
          else
5051
            return yyerror ("Bad call address");
5052
        }
5053
    break;
5054
 
5055
  case 162:
5056
#line 2699 "bfin-parse.y"
5057
    {
5058
          if (IS_PCREL24 (yyvsp[0].expr))
5059
            {
5060
              notethat ("CALLa: CALL pcrel25m2\n");
5061
              yyval.instr = CALLA (yyvsp[0].expr, 2);
5062
            }
5063
          else
5064
            return yyerror ("Bad call address");
5065
        }
5066
    break;
5067
 
5068
  case 163:
5069
#line 2712 "bfin-parse.y"
5070
    {
5071
          if (IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
5072
            yyval.instr = ALU2OP (&yyvsp[-3].reg, &yyvsp[-1].reg, 8);
5073
          else
5074
            return yyerror ("Bad registers for DIVQ");
5075
        }
5076
    break;
5077
 
5078
  case 164:
5079
#line 2720 "bfin-parse.y"
5080
    {
5081
          if (IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[-1].reg))
5082
            yyval.instr = ALU2OP (&yyvsp[-3].reg, &yyvsp[-1].reg, 9);
5083
          else
5084
            return yyerror ("Bad registers for DIVS");
5085
        }
5086
    break;
5087
 
5088
  case 165:
5089
#line 2728 "bfin-parse.y"
5090
    {
5091
          if (IS_DREG (yyvsp[-4].reg) && IS_DREG (yyvsp[-1].reg))
5092
            {
5093
              if (yyvsp[0].modcodes.r0 == 0 && yyvsp[0].modcodes.s0 == 0 && yyvsp[0].modcodes.aop == 0)
5094
                {
5095
                  notethat ("ALU2op: dregs = - dregs\n");
5096
                  yyval.instr = ALU2OP (&yyvsp[-4].reg, &yyvsp[-1].reg, 14);
5097
                }
5098
              else if (yyvsp[0].modcodes.r0 == 1 && yyvsp[0].modcodes.s0 == 0 && yyvsp[0].modcodes.aop == 3)
5099
                {
5100
                  notethat ("dsp32alu: dregs = - dregs (.)\n");
5101
                  yyval.instr = DSP32ALU (15, 0, 0, &yyvsp[-4].reg, &yyvsp[-1].reg, 0, yyvsp[0].modcodes.s0, 0, 3);
5102
                }
5103
              else
5104
                {
5105
                  notethat ("dsp32alu: dregs = - dregs (.)\n");
5106
                  yyval.instr = DSP32ALU (7, 0, 0, &yyvsp[-4].reg, &yyvsp[-1].reg, 0, yyvsp[0].modcodes.s0, 0, 3);
5107
                }
5108
            }
5109
          else
5110
            return yyerror ("Dregs expected");
5111
        }
5112
    break;
5113
 
5114
  case 166:
5115
#line 2752 "bfin-parse.y"
5116
    {
5117
          if (IS_DREG (yyvsp[-3].reg) && IS_DREG (yyvsp[0].reg))
5118
            {
5119
              notethat ("ALU2op: dregs = ~dregs\n");
5120
              yyval.instr = ALU2OP (&yyvsp[-3].reg, &yyvsp[0].reg, 15);
5121
            }
5122
          else
5123
            return yyerror ("Dregs expected");
5124
        }
5125
    break;
5126
 
5127
  case 167:
5128
#line 2763 "bfin-parse.y"
5129
    {
5130
          if (IS_DREG (yyvsp[-2].reg) && IS_DREG (yyvsp[0].reg))
5131
            {
5132
              notethat ("ALU2op: dregs >>= dregs\n");
5133
              yyval.instr = ALU2OP (&yyvsp[-2].reg, &yyvsp[0].reg, 1);
5134
            }
5135
          else
5136
            return yyerror ("Dregs expected");
5137
        }
5138
    break;
5139
 
5140
  case 168:
5141
#line 2774 "bfin-parse.y"
5142
    {
5143
          if (IS_DREG (yyvsp[-2].reg) && IS_UIMM (yyvsp[0].expr, 5))
5144
            {
5145
              notethat ("LOGI2op: dregs >>= uimm5\n");
5146
              yyval.instr = LOGI2OP (yyvsp[-2].reg, uimm5 (yyvsp[0].expr), 6);
5147
            }
5148
          else
5149
            return yyerror ("Dregs expected or value error");
5150
        }
5151
    break;
5152
 
5153
  case 169:
5154
#line 2785 "bfin-parse.y"
5155
    {
5156
          if (IS_DREG (yyvsp[-2].reg) && IS_DREG (yyvsp[0].reg))
5157
            {
5158
              notethat ("ALU2op: dregs >>>= dregs\n");
5159
              yyval.instr = ALU2OP (&yyvsp[-2].reg, &yyvsp[0].reg, 0);
5160
            }
5161
          else
5162
            return yyerror ("Dregs expected");
5163
        }
5164
    break;
5165
 
5166
  case 170:
5167
#line 2796 "bfin-parse.y"
5168
    {
5169
          if (IS_DREG (yyvsp[-2].reg) && IS_DREG (yyvsp[0].reg))
5170
            {
5171
              notethat ("ALU2op: dregs <<= dregs\n");
5172
              yyval.instr = ALU2OP (&yyvsp[-2].reg, &yyvsp[0].reg, 2);
5173
            }
5174
          else
5175
            return yyerror ("Dregs expected");
5176
        }
5177
    break;
5178
 
5179
  case 171:
5180
#line 2807 "bfin-parse.y"
5181
    {
5182
          if (IS_DREG (yyvsp[-2].reg) && IS_UIMM (yyvsp[0].expr, 5))
5183
            {
5184
              notethat ("LOGI2op: dregs <<= uimm5\n");
5185
              yyval.instr = LOGI2OP (yyvsp[-2].reg, uimm5 (yyvsp[0].expr), 7);
5186
            }
5187
          else
5188
            return yyerror ("Dregs expected or const value error");
5189
        }
5190
    break;
5191
 
5192
  case 172:
5193
#line 2819 "bfin-parse.y"
5194
    {
5195
          if (IS_DREG (yyvsp[-2].reg) && IS_UIMM (yyvsp[0].expr, 5))
5196
            {
5197
              notethat ("LOGI2op: dregs >>>= uimm5\n");
5198
              yyval.instr = LOGI2OP (yyvsp[-2].reg, uimm5 (yyvsp[0].expr), 5);
5199
            }
5200
          else
5201
            return yyerror ("Dregs expected");
5202
        }
5203
    break;
5204
 
5205
  case 173:
5206
#line 2832 "bfin-parse.y"
5207
    {
5208
          notethat ("CaCTRL: FLUSH [ pregs ]\n");
5209
          if (IS_PREG (yyvsp[-1].reg))
5210
            yyval.instr = CACTRL (&yyvsp[-1].reg, 0, 2);
5211
          else
5212
            return yyerror ("Bad register(s) for FLUSH");
5213
        }
5214
    break;
5215
 
5216
  case 174:
5217
#line 2841 "bfin-parse.y"
5218
    {
5219
          if (IS_PREG (yyvsp[0].reg))
5220
            {
5221
              notethat ("CaCTRL: FLUSH [ pregs ++ ]\n");
5222
              yyval.instr = CACTRL (&yyvsp[0].reg, 1, 2);
5223
            }
5224
          else
5225
            return yyerror ("Bad register(s) for FLUSH");
5226
        }
5227
    break;
5228
 
5229
  case 175:
5230
#line 2852 "bfin-parse.y"
5231
    {
5232
          if (IS_PREG (yyvsp[-1].reg))
5233
            {
5234
              notethat ("CaCTRL: FLUSHINV [ pregs ]\n");
5235
              yyval.instr = CACTRL (&yyvsp[-1].reg, 0, 1);
5236
            }
5237
          else
5238
            return yyerror ("Bad register(s) for FLUSH");
5239
        }
5240
    break;
5241
 
5242
  case 176:
5243
#line 2863 "bfin-parse.y"
5244
    {
5245
          if (IS_PREG (yyvsp[0].reg))
5246
            {
5247
              notethat ("CaCTRL: FLUSHINV [ pregs ++ ]\n");
5248
              yyval.instr = CACTRL (&yyvsp[0].reg, 1, 1);
5249
            }
5250
          else
5251
            return yyerror ("Bad register(s) for FLUSH");
5252
        }
5253
    break;
5254
 
5255
  case 177:
5256
#line 2875 "bfin-parse.y"
5257
    {
5258
          if (IS_PREG (yyvsp[-1].reg))
5259
            {
5260
              notethat ("CaCTRL: IFLUSH [ pregs ]\n");
5261
              yyval.instr = CACTRL (&yyvsp[-1].reg, 0, 3);
5262
            }
5263
          else
5264
            return yyerror ("Bad register(s) for FLUSH");
5265
        }
5266
    break;
5267
 
5268
  case 178:
5269
#line 2886 "bfin-parse.y"
5270
    {
5271
          if (IS_PREG (yyvsp[0].reg))
5272
            {
5273
              notethat ("CaCTRL: IFLUSH [ pregs ++ ]\n");
5274
              yyval.instr = CACTRL (&yyvsp[0].reg, 1, 3);
5275
            }
5276
          else
5277
            return yyerror ("Bad register(s) for FLUSH");
5278
        }
5279
    break;
5280
 
5281
  case 179:
5282
#line 2897 "bfin-parse.y"
5283
    {
5284
          if (IS_PREG (yyvsp[-1].reg))
5285
            {
5286
              notethat ("CaCTRL: PREFETCH [ pregs ]\n");
5287
              yyval.instr = CACTRL (&yyvsp[-1].reg, 0, 0);
5288
            }
5289
          else
5290
            return yyerror ("Bad register(s) for PREFETCH");
5291
        }
5292
    break;
5293
 
5294
  case 180:
5295
#line 2908 "bfin-parse.y"
5296
    {
5297
          if (IS_PREG (yyvsp[0].reg))
5298
            {
5299
              notethat ("CaCTRL: PREFETCH [ pregs ++ ]\n");
5300
              yyval.instr = CACTRL (&yyvsp[0].reg, 1, 0);
5301
            }
5302
          else
5303
            return yyerror ("Bad register(s) for PREFETCH");
5304
        }
5305
    break;
5306
 
5307
  case 181:
5308
#line 2922 "bfin-parse.y"
5309
    {
5310
          if (IS_PREG (yyvsp[-4].reg) && IS_DREG (yyvsp[0].reg))
5311
            {
5312
              notethat ("LDST: B [ pregs <post_op> ] = dregs\n");
5313
              yyval.instr = LDST (&yyvsp[-4].reg, &yyvsp[0].reg, yyvsp[-3].modcodes.x0, 2, 0, 1);
5314
            }
5315
          else
5316
            return yyerror ("Register mismatch");
5317
        }
5318
    break;
5319
 
5320
  case 182:
5321
#line 2934 "bfin-parse.y"
5322
    {
5323
          if (IS_PREG (yyvsp[-5].reg) && IS_RANGE(16, yyvsp[-3].expr, yyvsp[-4].r0.r0, 1) && IS_DREG (yyvsp[0].reg))
5324
            {
5325
              notethat ("LDST: B [ pregs + imm16 ] = dregs\n");
5326
              if (yyvsp[-4].r0.r0)
5327
                neg_value (yyvsp[-3].expr);
5328
              yyval.instr = LDSTIDXI (&yyvsp[-5].reg, &yyvsp[0].reg, 1, 2, 0, yyvsp[-3].expr);
5329
            }
5330
          else
5331
            return yyerror ("Register mismatch or const size wrong");
5332
        }
5333
    break;
5334
 
5335
  case 183:
5336
#line 2949 "bfin-parse.y"
5337
    {
5338
          if (IS_PREG (yyvsp[-5].reg) && IS_URANGE (4, yyvsp[-3].expr, yyvsp[-4].r0.r0, 2) && IS_DREG (yyvsp[0].reg))
5339
            {
5340
              notethat ("LDSTii: W [ pregs +- uimm5m2 ] = dregs\n");
5341
              yyval.instr = LDSTII (&yyvsp[-5].reg, &yyvsp[0].reg, yyvsp[-3].expr, 1, 1);
5342
            }
5343
          else if (IS_PREG (yyvsp[-5].reg) && IS_RANGE(16, yyvsp[-3].expr, yyvsp[-4].r0.r0, 2) && IS_DREG (yyvsp[0].reg))
5344
            {
5345
              notethat ("LDSTidxI: W [ pregs + imm17m2 ] = dregs\n");
5346
              if (yyvsp[-4].r0.r0)
5347
                neg_value (yyvsp[-3].expr);
5348
              yyval.instr = LDSTIDXI (&yyvsp[-5].reg, &yyvsp[0].reg, 1, 1, 0, yyvsp[-3].expr);
5349
            }
5350
          else
5351
            return yyerror ("Bad register(s) or wrong constant size");
5352
        }
5353
    break;
5354
 
5355
  case 184:
5356
#line 2968 "bfin-parse.y"
5357
    {
5358
          if (IS_PREG (yyvsp[-4].reg) && IS_DREG (yyvsp[0].reg))
5359
            {
5360
              notethat ("LDST: W [ pregs <post_op> ] = dregs\n");
5361
              yyval.instr = LDST (&yyvsp[-4].reg, &yyvsp[0].reg, yyvsp[-3].modcodes.x0, 1, 0, 1);
5362
            }
5363
          else
5364
            return yyerror ("Bad register(s) for STORE");
5365
        }
5366
    break;
5367
 
5368
  case 185:
5369
#line 2979 "bfin-parse.y"
5370
    {
5371
          if (IS_IREG (yyvsp[-4].reg))
5372
            {
5373
              notethat ("dspLDST: W [ iregs <post_op> ] = dregs_half\n");
5374
              yyval.instr = DSPLDST (&yyvsp[-4].reg, 1 + IS_H (yyvsp[0].reg), &yyvsp[0].reg, yyvsp[-3].modcodes.x0, 1);
5375
            }
5376
          else if (yyvsp[-3].modcodes.x0 == 2 && IS_PREG (yyvsp[-4].reg) && IS_DREG (yyvsp[0].reg))
5377
            {
5378
              notethat ("LDSTpmod: W [ pregs <post_op>] = dregs_half\n");
5379
              yyval.instr = LDSTPMOD (&yyvsp[-4].reg, &yyvsp[0].reg, &yyvsp[-4].reg, 1 + IS_H (yyvsp[0].reg), 1);
5380
 
5381
            }
5382
          else
5383
            return yyerror ("Bad register(s) for STORE");
5384
        }
5385
    break;
5386
 
5387
  case 186:
5388
#line 2997 "bfin-parse.y"
5389
    {
5390
          Expr_Node *tmp = yyvsp[-3].expr;
5391
          int ispreg = IS_PREG (yyvsp[0].reg);
5392
 
5393
          if (!IS_PREG (yyvsp[-5].reg))
5394
            return yyerror ("Preg expected for indirect");
5395
 
5396
          if (!IS_DREG (yyvsp[0].reg) && !ispreg)
5397
            return yyerror ("Bad source register for STORE");
5398
 
5399
          if (yyvsp[-4].r0.r0)
5400
            tmp = unary (Expr_Op_Type_NEG, tmp);
5401
 
5402
          if (in_range_p (tmp, 0, 63, 3))
5403
            {
5404
              notethat ("LDSTii: dpregs = [ pregs + uimm6m4 ]\n");
5405
              yyval.instr = LDSTII (&yyvsp[-5].reg, &yyvsp[0].reg, tmp, 1, ispreg ? 3 : 0);
5406
            }
5407
          else if (yyvsp[-5].reg.regno == REG_FP && in_range_p (tmp, -128, 0, 3))
5408
            {
5409
              notethat ("LDSTiiFP: dpregs = [ FP - uimm7m4 ]\n");
5410
              tmp = unary (Expr_Op_Type_NEG, tmp);
5411
              yyval.instr = LDSTIIFP (tmp, &yyvsp[0].reg, 1);
5412
            }
5413
          else if (in_range_p (tmp, -131072, 131071, 3))
5414
            {
5415
              notethat ("LDSTidxI: [ pregs + imm18m4 ] = dpregs\n");
5416
              yyval.instr = LDSTIDXI (&yyvsp[-5].reg, &yyvsp[0].reg, 1, 0, ispreg ? 1: 0, tmp);
5417
            }
5418
          else
5419
            return yyerror ("Displacement out of range for store");
5420
        }
5421
    break;
5422
 
5423
  case 187:
5424
#line 3031 "bfin-parse.y"
5425
    {
5426
          if (IS_DREG (yyvsp[-8].reg) && IS_PREG (yyvsp[-4].reg) && IS_URANGE (4, yyvsp[-2].expr, yyvsp[-3].r0.r0, 2))
5427
            {
5428
              notethat ("LDSTii: dregs = W [ pregs + uimm4s2 ] (.)\n");
5429
              yyval.instr = LDSTII (&yyvsp[-4].reg, &yyvsp[-8].reg, yyvsp[-2].expr, 0, 1 << yyvsp[0].r0.r0);
5430
            }
5431
          else if (IS_DREG (yyvsp[-8].reg) && IS_PREG (yyvsp[-4].reg) && IS_RANGE(16, yyvsp[-2].expr, yyvsp[-3].r0.r0, 2))
5432
            {
5433
              notethat ("LDSTidxI: dregs = W [ pregs + imm17m2 ] (.)\n");
5434
              if (yyvsp[-3].r0.r0)
5435
                neg_value (yyvsp[-2].expr);
5436
              yyval.instr = LDSTIDXI (&yyvsp[-4].reg, &yyvsp[-8].reg, 0, 1, yyvsp[0].r0.r0, yyvsp[-2].expr);
5437
            }
5438
          else
5439
            return yyerror ("Bad register or constant for LOAD");
5440
        }
5441
    break;
5442
 
5443
  case 188:
5444
#line 3049 "bfin-parse.y"
5445
    {
5446
          if (IS_IREG (yyvsp[-2].reg))
5447
            {
5448
              notethat ("dspLDST: dregs_half = W [ iregs ]\n");
5449
              yyval.instr = DSPLDST(&yyvsp[-2].reg, 1 + IS_H (yyvsp[-6].reg), &yyvsp[-6].reg, yyvsp[-1].modcodes.x0, 0);
5450
            }
5451
          else if (yyvsp[-1].modcodes.x0 == 2 && IS_DREG (yyvsp[-6].reg) && IS_PREG (yyvsp[-2].reg))
5452
            {
5453
              notethat ("LDSTpmod: dregs_half = W [ pregs ]\n");
5454
              yyval.instr = LDSTPMOD (&yyvsp[-2].reg, &yyvsp[-6].reg, &yyvsp[-2].reg, 1 + IS_H (yyvsp[-6].reg), 0);
5455
            }
5456
          else
5457
            return yyerror ("Bad register or post_op for LOAD");
5458
        }
5459
    break;
5460
 
5461
  case 189:
5462
#line 3066 "bfin-parse.y"
5463
    {
5464
          if (IS_DREG (yyvsp[-7].reg) && IS_PREG (yyvsp[-3].reg))
5465
            {
5466
              notethat ("LDST: dregs = W [ pregs <post_op> ] (.)\n");
5467
              yyval.instr = LDST (&yyvsp[-3].reg, &yyvsp[-7].reg, yyvsp[-2].modcodes.x0, 1, yyvsp[0].r0.r0, 0);
5468
            }
5469
          else
5470
            return yyerror ("Bad register for LOAD");
5471
        }
5472
    break;
5473
 
5474
  case 190:
5475
#line 3077 "bfin-parse.y"
5476
    {
5477
          if (IS_DREG (yyvsp[-8].reg) && IS_PREG (yyvsp[-4].reg) && IS_PREG (yyvsp[-2].reg))
5478
            {
5479
              notethat ("LDSTpmod: dregs = W [ pregs ++ pregs ] (.)\n");
5480
              yyval.instr = LDSTPMOD (&yyvsp[-4].reg, &yyvsp[-8].reg, &yyvsp[-2].reg, 3, yyvsp[0].r0.r0);
5481
            }
5482
          else
5483
            return yyerror ("Bad register for LOAD");
5484
        }
5485
    break;
5486
 
5487
  case 191:
5488
#line 3088 "bfin-parse.y"
5489
    {
5490
          if (IS_DREG (yyvsp[-7].reg) && IS_PREG (yyvsp[-3].reg) && IS_PREG (yyvsp[-1].reg))
5491
            {
5492
              notethat ("LDSTpmod: dregs_half = W [ pregs ++ pregs ]\n");
5493
              yyval.instr = LDSTPMOD (&yyvsp[-3].reg, &yyvsp[-7].reg, &yyvsp[-1].reg, 1 + IS_H (yyvsp[-7].reg), 0);
5494
            }
5495
          else
5496
            return yyerror ("Bad register for LOAD");
5497
        }
5498
    break;
5499
 
5500
  case 192:
5501
#line 3099 "bfin-parse.y"
5502
    {
5503
          if (IS_IREG (yyvsp[-4].reg) && IS_DREG (yyvsp[0].reg))
5504
            {
5505
              notethat ("dspLDST: [ iregs <post_op> ] = dregs\n");
5506
              yyval.instr = DSPLDST(&yyvsp[-4].reg, 0, &yyvsp[0].reg, yyvsp[-3].modcodes.x0, 1);
5507
            }
5508
          else if (IS_PREG (yyvsp[-4].reg) && IS_DREG (yyvsp[0].reg))
5509
            {
5510
              notethat ("LDST: [ pregs <post_op> ] = dregs\n");
5511
              yyval.instr = LDST (&yyvsp[-4].reg, &yyvsp[0].reg, yyvsp[-3].modcodes.x0, 0, 0, 1);
5512
            }
5513
          else if (IS_PREG (yyvsp[-4].reg) && IS_PREG (yyvsp[0].reg))
5514
            {
5515
              notethat ("LDST: [ pregs <post_op> ] = pregs\n");
5516
              yyval.instr = LDST (&yyvsp[-4].reg, &yyvsp[0].reg, yyvsp[-3].modcodes.x0, 0, 1, 1);
5517
            }
5518
          else
5519
            return yyerror ("Bad register for STORE");
5520
        }
5521
    break;
5522
 
5523
  case 193:
5524
#line 3120 "bfin-parse.y"
5525
    {
5526
          if (! IS_DREG (yyvsp[0].reg))
5527
            return yyerror ("Expected Dreg for last argument");
5528
 
5529
          if (IS_IREG (yyvsp[-5].reg) && IS_MREG (yyvsp[-3].reg))
5530
            {
5531
              notethat ("dspLDST: [ iregs ++ mregs ] = dregs\n");
5532
              yyval.instr = DSPLDST(&yyvsp[-5].reg, yyvsp[-3].reg.regno & CODE_MASK, &yyvsp[0].reg, 3, 1);
5533
            }
5534
          else if (IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-3].reg))
5535
            {
5536
              notethat ("LDSTpmod: [ pregs ++ pregs ] = dregs\n");
5537
              yyval.instr = LDSTPMOD (&yyvsp[-5].reg, &yyvsp[0].reg, &yyvsp[-3].reg, 0, 1);
5538
            }
5539
          else
5540
            return yyerror ("Bad register for STORE");
5541
        }
5542
    break;
5543
 
5544
  case 194:
5545
#line 3139 "bfin-parse.y"
5546
    {
5547
          if (!IS_DREG (yyvsp[0].reg))
5548
            return yyerror ("Expect Dreg as last argument");
5549
          if (IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-3].reg))
5550
            {
5551
              notethat ("LDSTpmod: W [ pregs ++ pregs ] = dregs_half\n");
5552
              yyval.instr = LDSTPMOD (&yyvsp[-5].reg, &yyvsp[0].reg, &yyvsp[-3].reg, 1 + IS_H (yyvsp[0].reg), 1);
5553
            }
5554
          else
5555
            return yyerror ("Bad register for STORE");
5556
        }
5557
    break;
5558
 
5559
  case 195:
5560
#line 3152 "bfin-parse.y"
5561
    {
5562
          if (IS_DREG (yyvsp[-8].reg) && IS_PREG (yyvsp[-4].reg) && IS_RANGE(16, yyvsp[-2].expr, yyvsp[-3].r0.r0, 1))
5563
            {
5564
              notethat ("LDSTidxI: dregs = B [ pregs + imm16 ] (%c)\n",
5565
                       yyvsp[0].r0.r0 ? 'X' : 'Z');
5566
              if (yyvsp[-3].r0.r0)
5567
                neg_value (yyvsp[-2].expr);
5568
              yyval.instr = LDSTIDXI (&yyvsp[-4].reg, &yyvsp[-8].reg, 0, 2, yyvsp[0].r0.r0, yyvsp[-2].expr);
5569
            }
5570
          else
5571
            return yyerror ("Bad register or value for LOAD");
5572
        }
5573
    break;
5574
 
5575
  case 196:
5576
#line 3166 "bfin-parse.y"
5577
    {
5578
          if (IS_DREG (yyvsp[-7].reg) && IS_PREG (yyvsp[-3].reg))
5579
            {
5580
              notethat ("LDST: dregs = B [ pregs <post_op> ] (%c)\n",
5581
                       yyvsp[0].r0.r0 ? 'X' : 'Z');
5582
              yyval.instr = LDST (&yyvsp[-3].reg, &yyvsp[-7].reg, yyvsp[-2].modcodes.x0, 2, yyvsp[0].r0.r0, 0);
5583
            }
5584
          else
5585
            return yyerror ("Bad register for LOAD");
5586
        }
5587
    break;
5588
 
5589
  case 197:
5590
#line 3178 "bfin-parse.y"
5591
    {
5592
          if (IS_DREG (yyvsp[-6].reg) && IS_IREG (yyvsp[-3].reg) && IS_MREG (yyvsp[-1].reg))
5593
            {
5594
              notethat ("dspLDST: dregs = [ iregs ++ mregs ]\n");
5595
              yyval.instr = DSPLDST(&yyvsp[-3].reg, yyvsp[-1].reg.regno & CODE_MASK, &yyvsp[-6].reg, 3, 0);
5596
            }
5597
          else if (IS_DREG (yyvsp[-6].reg) && IS_PREG (yyvsp[-3].reg) && IS_PREG (yyvsp[-1].reg))
5598
            {
5599
              notethat ("LDSTpmod: dregs = [ pregs ++ pregs ]\n");
5600
              yyval.instr = LDSTPMOD (&yyvsp[-3].reg, &yyvsp[-6].reg, &yyvsp[-1].reg, 0, 0);
5601
            }
5602
          else
5603
            return yyerror ("Bad register for LOAD");
5604
        }
5605
    break;
5606
 
5607
  case 198:
5608
#line 3194 "bfin-parse.y"
5609
    {
5610
          Expr_Node *tmp = yyvsp[-1].expr;
5611
          int ispreg = IS_PREG (yyvsp[-6].reg);
5612
          int isgot = IS_RELOC(yyvsp[-1].expr);
5613
 
5614
          if (!IS_PREG (yyvsp[-3].reg))
5615
            return yyerror ("Preg expected for indirect");
5616
 
5617
          if (!IS_DREG (yyvsp[-6].reg) && !ispreg)
5618
            return yyerror ("Bad destination register for LOAD");
5619
 
5620
          if (yyvsp[-2].r0.r0)
5621
            tmp = unary (Expr_Op_Type_NEG, tmp);
5622
 
5623
          if(isgot){
5624
              notethat ("LDSTidxI: dpregs = [ pregs + sym@got ]\n");
5625
              yyval.instr = LDSTIDXI (&yyvsp[-3].reg, &yyvsp[-6].reg, 0, 0, ispreg ? 1: 0, tmp);
5626
          }
5627
          else if (in_range_p (tmp, 0, 63, 3))
5628
            {
5629
              notethat ("LDSTii: dpregs = [ pregs + uimm7m4 ]\n");
5630
              yyval.instr = LDSTII (&yyvsp[-3].reg, &yyvsp[-6].reg, tmp, 0, ispreg ? 3 : 0);
5631
            }
5632
          else if (yyvsp[-3].reg.regno == REG_FP && in_range_p (tmp, -128, 0, 3))
5633
            {
5634
              notethat ("LDSTiiFP: dpregs = [ FP - uimm7m4 ]\n");
5635
              tmp = unary (Expr_Op_Type_NEG, tmp);
5636
              yyval.instr = LDSTIIFP (tmp, &yyvsp[-6].reg, 0);
5637
            }
5638
          else if (in_range_p (tmp, -131072, 131071, 3))
5639
            {
5640
              notethat ("LDSTidxI: dpregs = [ pregs + imm18m4 ]\n");
5641
              yyval.instr = LDSTIDXI (&yyvsp[-3].reg, &yyvsp[-6].reg, 0, 0, ispreg ? 1: 0, tmp);
5642
 
5643
            }
5644
          else
5645
            return yyerror ("Displacement out of range for load");
5646
        }
5647
    break;
5648
 
5649
  case 199:
5650
#line 3234 "bfin-parse.y"
5651
    {
5652
          if (IS_DREG (yyvsp[-5].reg) && IS_IREG (yyvsp[-2].reg))
5653
            {
5654
              notethat ("dspLDST: dregs = [ iregs <post_op> ]\n");
5655
              yyval.instr = DSPLDST (&yyvsp[-2].reg, 0, &yyvsp[-5].reg, yyvsp[-1].modcodes.x0, 0);
5656
            }
5657
          else if (IS_DREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-2].reg))
5658
            {
5659
              notethat ("LDST: dregs = [ pregs <post_op> ]\n");
5660
              yyval.instr = LDST (&yyvsp[-2].reg, &yyvsp[-5].reg, yyvsp[-1].modcodes.x0, 0, 0, 0);
5661
            }
5662
          else if (IS_PREG (yyvsp[-5].reg) && IS_PREG (yyvsp[-2].reg))
5663
            {
5664
              if (REG_SAME (yyvsp[-5].reg, yyvsp[-2].reg) && yyvsp[-1].modcodes.x0 != 2)
5665
                return yyerror ("Pregs can't be same");
5666
 
5667
              notethat ("LDST: pregs = [ pregs <post_op> ]\n");
5668
              yyval.instr = LDST (&yyvsp[-2].reg, &yyvsp[-5].reg, yyvsp[-1].modcodes.x0, 0, 1, 0);
5669
            }
5670
          else if (yyvsp[-2].reg.regno == REG_SP && IS_ALLREG (yyvsp[-5].reg) && yyvsp[-1].modcodes.x0 == 0)
5671
            {
5672
              notethat ("PushPopReg: allregs = [ SP ++ ]\n");
5673
              yyval.instr = PUSHPOPREG (&yyvsp[-5].reg, 0);
5674
            }
5675
          else
5676
            return yyerror ("Bad register or value");
5677
        }
5678
    break;
5679
 
5680
  case 200:
5681
#line 3265 "bfin-parse.y"
5682
    {
5683
          if (yyvsp[-10].reg.regno != REG_SP)
5684
            yyerror ("Stack Pointer expected");
5685
          if (yyvsp[-7].reg.regno == REG_R7
5686
              && IN_RANGE (yyvsp[-5].expr, 0, 7)
5687
              && yyvsp[-3].reg.regno == REG_P5
5688
              && IN_RANGE (yyvsp[-1].expr, 0, 5))
5689
            {
5690
              notethat ("PushPopMultiple: [ -- SP ] = (R7 : reglim , P5 : reglim )\n");
5691
              yyval.instr = PUSHPOPMULTIPLE (imm5 (yyvsp[-5].expr), imm5 (yyvsp[-1].expr), 1, 1, 1);
5692
            }
5693
          else
5694
            return yyerror ("Bad register for PushPopMultiple");
5695
        }
5696
    break;
5697
 
5698
  case 201:
5699
#line 3281 "bfin-parse.y"
5700
    {
5701
          if (yyvsp[-6].reg.regno != REG_SP)
5702
            yyerror ("Stack Pointer expected");
5703
 
5704
          if (yyvsp[-3].reg.regno == REG_R7 && IN_RANGE (yyvsp[-1].expr, 0, 7))
5705
            {
5706
              notethat ("PushPopMultiple: [ -- SP ] = (R7 : reglim )\n");
5707
              yyval.instr = PUSHPOPMULTIPLE (imm5 (yyvsp[-1].expr), 0, 1, 0, 1);
5708
            }
5709
          else if (yyvsp[-3].reg.regno == REG_P5 && IN_RANGE (yyvsp[-1].expr, 0, 6))
5710
            {
5711
              notethat ("PushPopMultiple: [ -- SP ] = (P5 : reglim )\n");
5712
              yyval.instr = PUSHPOPMULTIPLE (0, imm5 (yyvsp[-1].expr), 0, 1, 1);
5713
            }
5714
          else
5715
            return yyerror ("Bad register for PushPopMultiple");
5716
        }
5717
    break;
5718
 
5719
  case 202:
5720
#line 3300 "bfin-parse.y"
5721
    {
5722
          if (yyvsp[0].reg.regno != REG_SP)
5723
            yyerror ("Stack Pointer expected");
5724
          if (yyvsp[-9].reg.regno == REG_R7 && (IN_RANGE (yyvsp[-7].expr, 0, 7))
5725
              && yyvsp[-5].reg.regno == REG_P5 && (IN_RANGE (yyvsp[-3].expr, 0, 6)))
5726
            {
5727
              notethat ("PushPopMultiple: (R7 : reglim , P5 : reglim ) = [ SP ++ ]\n");
5728
              yyval.instr = PUSHPOPMULTIPLE (imm5 (yyvsp[-7].expr), imm5 (yyvsp[-3].expr), 1, 1, 0);
5729
            }
5730
          else
5731
            return yyerror ("Bad register range for PushPopMultiple");
5732
        }
5733
    break;
5734
 
5735
  case 203:
5736
#line 3314 "bfin-parse.y"
5737
    {
5738
          if (yyvsp[0].reg.regno != REG_SP)
5739
            yyerror ("Stack Pointer expected");
5740
 
5741
          if (yyvsp[-5].reg.regno == REG_R7 && IN_RANGE (yyvsp[-3].expr, 0, 7))
5742
            {
5743
              notethat ("PushPopMultiple: (R7 : reglim ) = [ SP ++ ]\n");
5744
              yyval.instr = PUSHPOPMULTIPLE (imm5 (yyvsp[-3].expr), 0, 1, 0, 0);
5745
            }
5746
          else if (yyvsp[-5].reg.regno == REG_P5 && IN_RANGE (yyvsp[-3].expr, 0, 6))
5747
            {
5748
              notethat ("PushPopMultiple: (P5 : reglim ) = [ SP ++ ]\n");
5749
              yyval.instr = PUSHPOPMULTIPLE (0, imm5 (yyvsp[-3].expr), 0, 1, 0);
5750
            }
5751
          else
5752
            return yyerror ("Bad register range for PushPopMultiple");
5753
        }
5754
    break;
5755
 
5756
  case 204:
5757
#line 3333 "bfin-parse.y"
5758
    {
5759
          if (yyvsp[-2].reg.regno != REG_SP)
5760
            yyerror ("Stack Pointer expected");
5761
 
5762
          if (IS_ALLREG (yyvsp[0].reg))
5763
            {
5764
              notethat ("PushPopReg: [ -- SP ] = allregs\n");
5765
              yyval.instr = PUSHPOPREG (&yyvsp[0].reg, 1);
5766
            }
5767
          else
5768
            return yyerror ("Bad register for PushPopReg");
5769
        }
5770
    break;
5771
 
5772
  case 205:
5773
#line 3349 "bfin-parse.y"
5774
    {
5775
          if (IS_URANGE (16, yyvsp[0].expr, 0, 4))
5776
            yyval.instr = LINKAGE (0, uimm16s4 (yyvsp[0].expr));
5777
          else
5778
            return yyerror ("Bad constant for LINK");
5779
        }
5780
    break;
5781
 
5782
  case 206:
5783
#line 3357 "bfin-parse.y"
5784
    {
5785
                notethat ("linkage: UNLINK\n");
5786
                yyval.instr = LINKAGE (1, 0);
5787
        }
5788
    break;
5789
 
5790
  case 207:
5791
#line 3366 "bfin-parse.y"
5792
    {
5793
          if (IS_PCREL4 (yyvsp[-4].expr) && IS_LPPCREL10 (yyvsp[-2].expr) && IS_CREG (yyvsp[0].reg))
5794
            {
5795
              notethat ("LoopSetup: LSETUP (pcrel4 , lppcrel10 ) counters\n");
5796
              yyval.instr = LOOPSETUP (yyvsp[-4].expr, &yyvsp[0].reg, 0, yyvsp[-2].expr, 0);
5797
            }
5798
          else
5799
            return yyerror ("Bad register or values for LSETUP");
5800
 
5801
        }
5802
    break;
5803
 
5804
  case 208:
5805
#line 3377 "bfin-parse.y"
5806
    {
5807
          if (IS_PCREL4 (yyvsp[-6].expr) && IS_LPPCREL10 (yyvsp[-4].expr)
5808
              && IS_PREG (yyvsp[0].reg) && IS_CREG (yyvsp[-2].reg))
5809
            {
5810
              notethat ("LoopSetup: LSETUP (pcrel4 , lppcrel10 ) counters = pregs\n");
5811
              yyval.instr = LOOPSETUP (yyvsp[-6].expr, &yyvsp[-2].reg, 1, yyvsp[-4].expr, &yyvsp[0].reg);
5812
            }
5813
          else
5814
            return yyerror ("Bad register or values for LSETUP");
5815
        }
5816
    break;
5817
 
5818
  case 209:
5819
#line 3389 "bfin-parse.y"
5820
    {
5821
          if (IS_PCREL4 (yyvsp[-8].expr) && IS_LPPCREL10 (yyvsp[-6].expr)
5822
              && IS_PREG (yyvsp[-2].reg) && IS_CREG (yyvsp[-4].reg)
5823
              && EXPR_VALUE (yyvsp[0].expr) == 1)
5824
            {
5825
              notethat ("LoopSetup: LSETUP (pcrel4 , lppcrel10 ) counters = pregs >> 1\n");
5826
              yyval.instr = LOOPSETUP (yyvsp[-8].expr, &yyvsp[-4].reg, 3, yyvsp[-6].expr, &yyvsp[-2].reg);
5827
            }
5828
          else
5829
            return yyerror ("Bad register or values for LSETUP");
5830
        }
5831
    break;
5832
 
5833
  case 210:
5834
#line 3403 "bfin-parse.y"
5835
    {
5836
          if (!IS_RELOC (yyvsp[-1].expr))
5837
            return yyerror ("Invalid expression in loop statement");
5838
          if (!IS_CREG (yyvsp[0].reg))
5839
            return yyerror ("Invalid loop counter register");
5840
        yyval.instr = bfin_gen_loop (yyvsp[-1].expr, &yyvsp[0].reg, 0, 0);
5841
        }
5842
    break;
5843
 
5844
  case 211:
5845
#line 3411 "bfin-parse.y"
5846
    {
5847
          if (IS_RELOC (yyvsp[-3].expr) && IS_PREG (yyvsp[0].reg) && IS_CREG (yyvsp[-2].reg))
5848
            {
5849
              notethat ("Loop: LOOP expr counters = pregs\n");
5850
              yyval.instr = bfin_gen_loop (yyvsp[-3].expr, &yyvsp[-2].reg, 1, &yyvsp[0].reg);
5851
            }
5852
          else
5853
            return yyerror ("Bad register or values for LOOP");
5854
        }
5855
    break;
5856
 
5857
  case 212:
5858
#line 3421 "bfin-parse.y"
5859
    {
5860
          if (IS_RELOC (yyvsp[-5].expr) && IS_PREG (yyvsp[-2].reg) && IS_CREG (yyvsp[-4].reg) && EXPR_VALUE (yyvsp[0].expr) == 1)
5861
            {
5862
              notethat ("Loop: LOOP expr counters = pregs >> 1\n");
5863
              yyval.instr = bfin_gen_loop (yyvsp[-5].expr, &yyvsp[-4].reg, 3, &yyvsp[-2].reg);
5864
            }
5865
          else
5866
            return yyerror ("Bad register or values for LOOP");
5867
        }
5868
    break;
5869
 
5870
  case 213:
5871
#line 3433 "bfin-parse.y"
5872
    {
5873
          notethat ("pseudoDEBUG: DBG\n");
5874
          yyval.instr = bfin_gen_pseudodbg (3, 7, 0);
5875
        }
5876
    break;
5877
 
5878
  case 214:
5879
#line 3438 "bfin-parse.y"
5880
    {
5881
          notethat ("pseudoDEBUG: DBG REG_A\n");
5882
          yyval.instr = bfin_gen_pseudodbg (3, IS_A1 (yyvsp[0].reg), 0);
5883
        }
5884
    break;
5885
 
5886
  case 215:
5887
#line 3443 "bfin-parse.y"
5888
    {
5889
          notethat ("pseudoDEBUG: DBG allregs\n");
5890
          yyval.instr = bfin_gen_pseudodbg (0, yyvsp[0].reg.regno & CODE_MASK, yyvsp[0].reg.regno & CLASS_MASK);
5891
        }
5892
    break;
5893
 
5894
  case 216:
5895
#line 3449 "bfin-parse.y"
5896
    {
5897
          if (!IS_DREG (yyvsp[-1].reg))
5898
            return yyerror ("Dregs expected");
5899
          notethat ("pseudoDEBUG: DBGCMPLX (dregs )\n");
5900
          yyval.instr = bfin_gen_pseudodbg (3, 6, yyvsp[-1].reg.regno & CODE_MASK);
5901
        }
5902
    break;
5903
 
5904
  case 217:
5905
#line 3457 "bfin-parse.y"
5906
    {
5907
          notethat ("psedoDEBUG: DBGHALT\n");
5908
          yyval.instr = bfin_gen_pseudodbg (3, 5, 0);
5909
        }
5910
    break;
5911
 
5912
  case 218:
5913
#line 3463 "bfin-parse.y"
5914
    {
5915
          notethat ("pseudodbg_assert: DBGA (dregs_lo , uimm16 )\n");
5916
          yyval.instr = bfin_gen_pseudodbg_assert (IS_H (yyvsp[-3].reg), &yyvsp[-3].reg, uimm16 (yyvsp[-1].expr));
5917
        }
5918
    break;
5919
 
5920
  case 219:
5921
#line 3469 "bfin-parse.y"
5922
    {
5923
          notethat ("pseudodbg_assert: DBGAH (dregs , uimm16 )\n");
5924
          yyval.instr = bfin_gen_pseudodbg_assert (3, &yyvsp[-3].reg, uimm16 (yyvsp[-1].expr));
5925
        }
5926
    break;
5927
 
5928
  case 220:
5929
#line 3475 "bfin-parse.y"
5930
    {
5931
          notethat ("psedodbg_assert: DBGAL (dregs , uimm16 )\n");
5932
          yyval.instr = bfin_gen_pseudodbg_assert (2, &yyvsp[-3].reg, uimm16 (yyvsp[-1].expr));
5933
        }
5934
    break;
5935
 
5936
  case 221:
5937
#line 3488 "bfin-parse.y"
5938
    {
5939
        yyval.reg = yyvsp[0].reg;
5940
        }
5941
    break;
5942
 
5943
  case 222:
5944
#line 3492 "bfin-parse.y"
5945
    {
5946
        yyval.reg = yyvsp[0].reg;
5947
        }
5948
    break;
5949
 
5950
  case 223:
5951
#line 3501 "bfin-parse.y"
5952
    {
5953
        yyval.mod.MM = 0;
5954
        yyval.mod.mod = 0;
5955
        }
5956
    break;
5957
 
5958
  case 224:
5959
#line 3506 "bfin-parse.y"
5960
    {
5961
        yyval.mod.MM = 1;
5962
        yyval.mod.mod = yyvsp[-1].value;
5963
        }
5964
    break;
5965
 
5966
  case 225:
5967
#line 3511 "bfin-parse.y"
5968
    {
5969
        yyval.mod.MM = 1;
5970
        yyval.mod.mod = yyvsp[-3].value;
5971
        }
5972
    break;
5973
 
5974
  case 226:
5975
#line 3516 "bfin-parse.y"
5976
    {
5977
        yyval.mod.MM = 0;
5978
        yyval.mod.mod = yyvsp[-1].value;
5979
        }
5980
    break;
5981
 
5982
  case 227:
5983
#line 3521 "bfin-parse.y"
5984
    {
5985
        yyval.mod.MM = 1;
5986
        yyval.mod.mod = 0;
5987
        }
5988
    break;
5989
 
5990
  case 228:
5991
#line 3528 "bfin-parse.y"
5992
    {
5993
        yyval.r0.r0 = 1;
5994
        }
5995
    break;
5996
 
5997
  case 229:
5998
#line 3532 "bfin-parse.y"
5999
    {
6000
        yyval.r0.r0 = 0;
6001
        }
6002
    break;
6003
 
6004
  case 230:
6005
#line 3538 "bfin-parse.y"
6006
    {
6007
        yyval.modcodes.s0 = 0;
6008
        yyval.modcodes.x0 = 0;
6009
        }
6010
    break;
6011
 
6012
  case 231:
6013
#line 3543 "bfin-parse.y"
6014
    {
6015
        yyval.modcodes.s0 = 1;
6016
        yyval.modcodes.x0 = 0;
6017
        }
6018
    break;
6019
 
6020
  case 232:
6021
#line 3548 "bfin-parse.y"
6022
    {
6023
        yyval.modcodes.s0 = 0;
6024
        yyval.modcodes.x0 = 1;
6025
        }
6026
    break;
6027
 
6028
  case 233:
6029
#line 3553 "bfin-parse.y"
6030
    {
6031
        yyval.modcodes.s0 = 1;
6032
        yyval.modcodes.x0 = 1;
6033
        }
6034
    break;
6035
 
6036
  case 234:
6037
#line 3561 "bfin-parse.y"
6038
    {
6039
        yyval.r0.r0 = 1;
6040
        }
6041
    break;
6042
 
6043
  case 235:
6044
#line 3565 "bfin-parse.y"
6045
    {
6046
        yyval.r0.r0 = 0;
6047
        }
6048
    break;
6049
 
6050
  case 236:
6051
#line 3571 "bfin-parse.y"
6052
    {
6053
        yyval.modcodes.s0 = 0;
6054
        yyval.modcodes.x0 = 0;
6055
        }
6056
    break;
6057
 
6058
  case 237:
6059
#line 3576 "bfin-parse.y"
6060
    {
6061
        yyval.modcodes.s0 = yyvsp[-1].modcodes.s0;
6062
        yyval.modcodes.x0 = yyvsp[-1].modcodes.x0;
6063
        }
6064
    break;
6065
 
6066
  case 238:
6067
#line 3583 "bfin-parse.y"
6068
    {
6069
        yyval.modcodes.s0 = 0;
6070
        yyval.modcodes.x0 = 0;
6071
        yyval.modcodes.aop = 0;
6072
        }
6073
    break;
6074
 
6075
  case 239:
6076
#line 3589 "bfin-parse.y"
6077
    {
6078
        yyval.modcodes.s0 = 0;
6079
        yyval.modcodes.x0 = 0;
6080
        yyval.modcodes.aop = 1;
6081
        }
6082
    break;
6083
 
6084
  case 240:
6085
#line 3595 "bfin-parse.y"
6086
    {
6087
        yyval.modcodes.s0 = 1;
6088
        yyval.modcodes.x0 = 0;
6089
        yyval.modcodes.aop = 1;
6090
        }
6091
    break;
6092
 
6093
  case 241:
6094
#line 3603 "bfin-parse.y"
6095
    {
6096
        yyval.modcodes.r0 = 0;
6097
        yyval.modcodes.s0 = 0;
6098
        yyval.modcodes.x0 = 0;
6099
        }
6100
    break;
6101
 
6102
  case 242:
6103
#line 3609 "bfin-parse.y"
6104
    {
6105
        yyval.modcodes.r0 = 2 + yyvsp[-1].r0.r0;
6106
        yyval.modcodes.s0 = 0;
6107
        yyval.modcodes.x0 = 0;
6108
        }
6109
    break;
6110
 
6111
  case 243:
6112
#line 3615 "bfin-parse.y"
6113
    {
6114
        yyval.modcodes.r0 = 0;
6115
        yyval.modcodes.s0 = yyvsp[-1].modcodes.s0;
6116
        yyval.modcodes.x0 = yyvsp[-1].modcodes.x0;
6117
        }
6118
    break;
6119
 
6120
  case 244:
6121
#line 3621 "bfin-parse.y"
6122
    {
6123
        yyval.modcodes.r0 = 2 + yyvsp[-3].r0.r0;
6124
        yyval.modcodes.s0 = yyvsp[-1].modcodes.s0;
6125
        yyval.modcodes.x0 = yyvsp[-1].modcodes.x0;
6126
        }
6127
    break;
6128
 
6129
  case 245:
6130
#line 3627 "bfin-parse.y"
6131
    {
6132
        yyval.modcodes.r0 = 2 + yyvsp[-1].r0.r0;
6133
        yyval.modcodes.s0 = yyvsp[-3].modcodes.s0;
6134
        yyval.modcodes.x0 = yyvsp[-3].modcodes.x0;
6135
        }
6136
    break;
6137
 
6138
  case 246:
6139
#line 3635 "bfin-parse.y"
6140
    {
6141
        yyval.r0.r0 = 0;
6142
        }
6143
    break;
6144
 
6145
  case 247:
6146
#line 3639 "bfin-parse.y"
6147
    {
6148
        yyval.r0.r0 = 0;
6149
        }
6150
    break;
6151
 
6152
  case 248:
6153
#line 3643 "bfin-parse.y"
6154
    {
6155
        yyval.r0.r0 = 1;
6156
        }
6157
    break;
6158
 
6159
  case 249:
6160
#line 3649 "bfin-parse.y"
6161
    {
6162
        yyval.r0.r0 = 0;
6163
        }
6164
    break;
6165
 
6166
  case 250:
6167
#line 3653 "bfin-parse.y"
6168
    {
6169
        yyval.r0.r0 = 0;
6170
        }
6171
    break;
6172
 
6173
  case 251:
6174
#line 3657 "bfin-parse.y"
6175
    {
6176
        yyval.r0.r0 = 1;
6177
        }
6178
    break;
6179
 
6180
  case 252:
6181
#line 3663 "bfin-parse.y"
6182
    {
6183
        yyval.modcodes.r0 = 0;
6184
        yyval.modcodes.s0 = 0;
6185
        yyval.modcodes.aop = 0;
6186
        }
6187
    break;
6188
 
6189
  case 253:
6190
#line 3669 "bfin-parse.y"
6191
    {
6192
        yyval.modcodes.r0 = 0;
6193
        yyval.modcodes.s0 = 0;
6194
        yyval.modcodes.aop = 3;
6195
        }
6196
    break;
6197
 
6198
  case 254:
6199
#line 3675 "bfin-parse.y"
6200
    {
6201
        yyval.modcodes.r0 = 0;
6202
        yyval.modcodes.s0 = 1;
6203
        yyval.modcodes.aop = 3;
6204
        }
6205
    break;
6206
 
6207
  case 255:
6208
#line 3681 "bfin-parse.y"
6209
    {
6210
        yyval.modcodes.r0 = 1;
6211
        yyval.modcodes.s0 = 0;
6212
        yyval.modcodes.aop = 3;
6213
        }
6214
    break;
6215
 
6216
  case 256:
6217
#line 3687 "bfin-parse.y"
6218
    {
6219
        yyval.modcodes.r0 = 1;
6220
        yyval.modcodes.s0 = 1;
6221
        }
6222
    break;
6223
 
6224
  case 257:
6225
#line 3692 "bfin-parse.y"
6226
    {
6227
        yyval.modcodes.r0 = 1;
6228
        yyval.modcodes.s0 = 1;
6229
        }
6230
    break;
6231
 
6232
  case 258:
6233
#line 3699 "bfin-parse.y"
6234
    {
6235
        yyval.r0.r0 = 0;
6236
        }
6237
    break;
6238
 
6239
  case 259:
6240
#line 3703 "bfin-parse.y"
6241
    {
6242
        yyval.r0.r0 = 1;
6243
        }
6244
    break;
6245
 
6246
  case 260:
6247
#line 3709 "bfin-parse.y"
6248
    {
6249
        yyval.modcodes.s0 = 0;
6250
        }
6251
    break;
6252
 
6253
  case 261:
6254
#line 3713 "bfin-parse.y"
6255
    {
6256
        yyval.modcodes.s0 = 1;
6257
        }
6258
    break;
6259
 
6260
  case 262:
6261
#line 3720 "bfin-parse.y"
6262
    {
6263
        yyval.r0.r0 = 1;
6264
        }
6265
    break;
6266
 
6267
  case 263:
6268
#line 3724 "bfin-parse.y"
6269
    {
6270
        yyval.r0.r0 = 0;
6271
        }
6272
    break;
6273
 
6274
  case 264:
6275
#line 3728 "bfin-parse.y"
6276
    {
6277
        yyval.r0.r0 = 3;
6278
        }
6279
    break;
6280
 
6281
  case 265:
6282
#line 3732 "bfin-parse.y"
6283
    {
6284
        yyval.r0.r0 = 2;
6285
        }
6286
    break;
6287
 
6288
  case 266:
6289
#line 3738 "bfin-parse.y"
6290
    {
6291
        yyval.r0.r0 = 0;
6292
        }
6293
    break;
6294
 
6295
  case 267:
6296
#line 3742 "bfin-parse.y"
6297
    {
6298
        yyval.r0.r0 = 1;
6299
        }
6300
    break;
6301
 
6302
  case 268:
6303
#line 3749 "bfin-parse.y"
6304
    {
6305
        yyval.modcodes.r0 = 0;
6306
        yyval.modcodes.s0 = 1;
6307
        }
6308
    break;
6309
 
6310
  case 269:
6311
#line 3754 "bfin-parse.y"
6312
    {
6313
        if (yyvsp[-1].value != M_T)
6314
          return yyerror ("Bad modifier");
6315
        yyval.modcodes.r0 = 1;
6316
        yyval.modcodes.s0 = 0;
6317
        }
6318
    break;
6319
 
6320
  case 270:
6321
#line 3761 "bfin-parse.y"
6322
    {
6323
        if (yyvsp[-3].value != M_T)
6324
          return yyerror ("Bad modifier");
6325
        yyval.modcodes.r0 = 1;
6326
        yyval.modcodes.s0 = 1;
6327
        }
6328
    break;
6329
 
6330
  case 271:
6331
#line 3768 "bfin-parse.y"
6332
    {
6333
        if (yyvsp[-1].value != M_T)
6334
          return yyerror ("Bad modifier");
6335
        yyval.modcodes.r0 = 1;
6336
        yyval.modcodes.s0 = 1;
6337
        }
6338
    break;
6339
 
6340
  case 272:
6341
#line 3780 "bfin-parse.y"
6342
    {
6343
        yyval.r0.r0 = 0;
6344
        }
6345
    break;
6346
 
6347
  case 273:
6348
#line 3784 "bfin-parse.y"
6349
    {
6350
        yyval.r0.r0 = 1;
6351
        }
6352
    break;
6353
 
6354
  case 274:
6355
#line 3788 "bfin-parse.y"
6356
    {
6357
        yyval.r0.r0 = 2;
6358
        }
6359
    break;
6360
 
6361
  case 275:
6362
#line 3794 "bfin-parse.y"
6363
    {
6364
        yyval.r0.r0 = 0;
6365
        }
6366
    break;
6367
 
6368
  case 276:
6369
#line 3798 "bfin-parse.y"
6370
    {
6371
          if (yyvsp[-1].value == M_W32)
6372
            yyval.r0.r0 = 1;
6373
          else
6374
            return yyerror ("Only (W32) allowed");
6375
        }
6376
    break;
6377
 
6378
  case 277:
6379
#line 3807 "bfin-parse.y"
6380
    {
6381
        yyval.r0.r0 = 1;
6382
        }
6383
    break;
6384
 
6385
  case 278:
6386
#line 3811 "bfin-parse.y"
6387
    {
6388
          if (yyvsp[-1].value == M_IU)
6389
            yyval.r0.r0 = 3;
6390
          else
6391
            return yyerror ("(IU) expected");
6392
        }
6393
    break;
6394
 
6395
  case 279:
6396
#line 3820 "bfin-parse.y"
6397
    {
6398
        yyval.reg = yyvsp[-1].reg;
6399
        }
6400
    break;
6401
 
6402
  case 280:
6403
#line 3826 "bfin-parse.y"
6404
    {
6405
        yyval.reg = yyvsp[-2].reg;
6406
        }
6407
    break;
6408
 
6409
  case 281:
6410
#line 3835 "bfin-parse.y"
6411
    {
6412
        yyval.r0.r0 = 1;
6413
        }
6414
    break;
6415
 
6416
  case 282:
6417
#line 3839 "bfin-parse.y"
6418
    {
6419
        yyval.r0.r0 = 0;
6420
        }
6421
    break;
6422
 
6423
  case 283:
6424
#line 3846 "bfin-parse.y"
6425
    {
6426
        yyval.r0.r0 = 0;
6427
        }
6428
    break;
6429
 
6430
  case 284:
6431
#line 3850 "bfin-parse.y"
6432
    {
6433
        yyval.r0.r0 = 1;
6434
        }
6435
    break;
6436
 
6437
  case 285:
6438
#line 3854 "bfin-parse.y"
6439
    {
6440
        yyval.r0.r0 = 2;
6441
        }
6442
    break;
6443
 
6444
  case 286:
6445
#line 3858 "bfin-parse.y"
6446
    {
6447
        yyval.r0.r0 = 3;
6448
        }
6449
    break;
6450
 
6451
  case 287:
6452
#line 3865 "bfin-parse.y"
6453
    {
6454
        yyval.r0.r0 = 0;
6455
        }
6456
    break;
6457
 
6458
  case 288:
6459
#line 3869 "bfin-parse.y"
6460
    {
6461
        yyval.r0.r0 = 1;
6462
        }
6463
    break;
6464
 
6465
  case 289:
6466
#line 3876 "bfin-parse.y"
6467
    {
6468
          yyval.modcodes.r0 = 1;        /* HL.  */
6469
          yyval.modcodes.s0 = 0; /* s.  */
6470
          yyval.modcodes.x0 = 0; /* x.  */
6471
          yyval.modcodes.aop = 0;        /* aop.  */
6472
        }
6473
    break;
6474
 
6475
  case 290:
6476
#line 3884 "bfin-parse.y"
6477
    {
6478
          yyval.modcodes.r0 = 1;        /* HL.  */
6479
          yyval.modcodes.s0 = 0; /* s.  */
6480
          yyval.modcodes.x0 = 0; /* x.  */
6481
          yyval.modcodes.aop = 1;       /* aop.  */
6482
        }
6483
    break;
6484
 
6485
  case 291:
6486
#line 3892 "bfin-parse.y"
6487
    {
6488
          yyval.modcodes.r0 = 0; /* HL.  */
6489
          yyval.modcodes.s0 = 0; /* s.  */
6490
          yyval.modcodes.x0 = 0; /* x.  */
6491
          yyval.modcodes.aop = 0;        /* aop.  */
6492
        }
6493
    break;
6494
 
6495
  case 292:
6496
#line 3900 "bfin-parse.y"
6497
    {
6498
          yyval.modcodes.r0 = 0; /* HL.  */
6499
          yyval.modcodes.s0 = 0; /* s.  */
6500
          yyval.modcodes.x0 = 0; /* x.  */
6501
          yyval.modcodes.aop = 1;
6502
        }
6503
    break;
6504
 
6505
  case 293:
6506
#line 3908 "bfin-parse.y"
6507
    {
6508
          yyval.modcodes.r0 = 1;        /* HL.  */
6509
          yyval.modcodes.s0 = 1;        /* s.  */
6510
          yyval.modcodes.x0 = 0; /* x.  */
6511
          yyval.modcodes.aop = 0;        /* aop.  */
6512
        }
6513
    break;
6514
 
6515
  case 294:
6516
#line 3915 "bfin-parse.y"
6517
    {
6518
          yyval.modcodes.r0 = 1;        /* HL.  */
6519
          yyval.modcodes.s0 = 1;        /* s.  */
6520
          yyval.modcodes.x0 = 0; /* x.  */
6521
          yyval.modcodes.aop = 1;       /* aop.  */
6522
        }
6523
    break;
6524
 
6525
  case 295:
6526
#line 3922 "bfin-parse.y"
6527
    {
6528
          yyval.modcodes.r0 = 0; /* HL.  */
6529
          yyval.modcodes.s0 = 1;        /* s.  */
6530
          yyval.modcodes.x0 = 0; /* x.  */
6531
          yyval.modcodes.aop = 0;        /* aop.  */
6532
        }
6533
    break;
6534
 
6535
  case 296:
6536
#line 3930 "bfin-parse.y"
6537
    {
6538
          yyval.modcodes.r0 = 0; /* HL.  */
6539
          yyval.modcodes.s0 = 1;        /* s.  */
6540
          yyval.modcodes.x0 = 0; /* x.  */
6541
          yyval.modcodes.aop = 1;       /* aop.  */
6542
        }
6543
    break;
6544
 
6545
  case 297:
6546
#line 3940 "bfin-parse.y"
6547
    {
6548
          yyval.modcodes.s0 = 0; /* s.  */
6549
          yyval.modcodes.x0 = 0; /* HL.  */
6550
        }
6551
    break;
6552
 
6553
  case 298:
6554
#line 3945 "bfin-parse.y"
6555
    {
6556
          yyval.modcodes.s0 = 0; /* s.  */
6557
          yyval.modcodes.x0 = 1;        /* HL.  */
6558
        }
6559
    break;
6560
 
6561
  case 299:
6562
#line 3950 "bfin-parse.y"
6563
    {
6564
          yyval.modcodes.s0 = 1;        /* s.  */
6565
          yyval.modcodes.x0 = 0; /* HL.  */
6566
        }
6567
    break;
6568
 
6569
  case 300:
6570
#line 3955 "bfin-parse.y"
6571
    {
6572
          yyval.modcodes.s0 = 1;        /* s.  */
6573
          yyval.modcodes.x0 = 1;        /* HL.  */
6574
        }
6575
    break;
6576
 
6577
  case 301:
6578
#line 3962 "bfin-parse.y"
6579
    {
6580
        yyval.modcodes.x0 = 2;
6581
        }
6582
    break;
6583
 
6584
  case 302:
6585
#line 3966 "bfin-parse.y"
6586
    {
6587
        yyval.modcodes.x0 = 0;
6588
        }
6589
    break;
6590
 
6591
  case 303:
6592
#line 3970 "bfin-parse.y"
6593
    {
6594
        yyval.modcodes.x0 = 1;
6595
        }
6596
    break;
6597
 
6598
  case 304:
6599
#line 3979 "bfin-parse.y"
6600
    {
6601
        yyval.reg = yyvsp[-1].reg;
6602
        }
6603
    break;
6604
 
6605
  case 305:
6606
#line 3986 "bfin-parse.y"
6607
    {
6608
        yyval.reg = yyvsp[-1].reg;
6609
        }
6610
    break;
6611
 
6612
  case 306:
6613
#line 3993 "bfin-parse.y"
6614
    {
6615
        yyval.reg = yyvsp[-1].reg;
6616
        }
6617
    break;
6618
 
6619
  case 307:
6620
#line 4000 "bfin-parse.y"
6621
    {
6622
          if (IS_A1 (yyvsp[0].reg) && IS_EVEN (yyvsp[-2].reg))
6623
            return yyerror ("Cannot move A1 to even register");
6624
          else if (!IS_A1 (yyvsp[0].reg) && !IS_EVEN (yyvsp[-2].reg))
6625
            return yyerror ("Cannot move A0 to odd register");
6626
 
6627
          yyval.macfunc.w = 1;
6628
          yyval.macfunc.P = 1;
6629
          yyval.macfunc.n = IS_A1 (yyvsp[0].reg);
6630
          yyval.macfunc.op = 3;
6631
          yyval.macfunc.dst = yyvsp[-2].reg;
6632
          yyval.macfunc.s0.regno = 0;
6633
          yyval.macfunc.s1.regno = 0;
6634
        }
6635
    break;
6636
 
6637
  case 308:
6638
#line 4015 "bfin-parse.y"
6639
    {
6640
          yyval.macfunc = yyvsp[0].macfunc;
6641
          yyval.macfunc.w = 0; yyval.macfunc.P = 0;
6642
          yyval.macfunc.dst.regno = 0;
6643
        }
6644
    break;
6645
 
6646
  case 309:
6647
#line 4021 "bfin-parse.y"
6648
    {
6649
          if (yyvsp[-1].macfunc.n && IS_EVEN (yyvsp[-4].reg))
6650
            return yyerror ("Cannot move A1 to even register");
6651
          else if (!yyvsp[-1].macfunc.n && !IS_EVEN (yyvsp[-4].reg))
6652
            return yyerror ("Cannot move A0 to odd register");
6653
 
6654
          yyval.macfunc = yyvsp[-1].macfunc;
6655
          yyval.macfunc.w = 1;
6656
          yyval.macfunc.P = 1;
6657
          yyval.macfunc.dst = yyvsp[-4].reg;
6658
        }
6659
    break;
6660
 
6661
  case 310:
6662
#line 4034 "bfin-parse.y"
6663
    {
6664
          if (yyvsp[-1].macfunc.n && !IS_H (yyvsp[-4].reg))
6665
            return yyerror ("Cannot move A1 to low half of register");
6666
          else if (!yyvsp[-1].macfunc.n && IS_H (yyvsp[-4].reg))
6667
            return yyerror ("Cannot move A0 to high half of register");
6668
 
6669
          yyval.macfunc = yyvsp[-1].macfunc;
6670
          yyval.macfunc.w = 1;
6671
          yyval.macfunc.P = 0;
6672
          yyval.macfunc.dst = yyvsp[-4].reg;
6673
        }
6674
    break;
6675
 
6676
  case 311:
6677
#line 4047 "bfin-parse.y"
6678
    {
6679
          if (IS_A1 (yyvsp[0].reg) && !IS_H (yyvsp[-2].reg))
6680
            return yyerror ("Cannot move A1 to low half of register");
6681
          else if (!IS_A1 (yyvsp[0].reg) && IS_H (yyvsp[-2].reg))
6682
            return yyerror ("Cannot move A0 to high half of register");
6683
 
6684
          yyval.macfunc.w = 1;
6685
          yyval.macfunc.P = 0;
6686
          yyval.macfunc.n = IS_A1 (yyvsp[0].reg);
6687
          yyval.macfunc.op = 3;
6688
          yyval.macfunc.dst = yyvsp[-2].reg;
6689
          yyval.macfunc.s0.regno = 0;
6690
          yyval.macfunc.s1.regno = 0;
6691
        }
6692
    break;
6693
 
6694
  case 312:
6695
#line 4065 "bfin-parse.y"
6696
    {
6697
          yyval.macfunc.n = IS_A1 (yyvsp[-1].reg);
6698
          yyval.macfunc.op = 0;
6699
          yyval.macfunc.s0 = yyvsp[0].macfunc.s0;
6700
          yyval.macfunc.s1 = yyvsp[0].macfunc.s1;
6701
        }
6702
    break;
6703
 
6704
  case 313:
6705
#line 4072 "bfin-parse.y"
6706
    {
6707
          yyval.macfunc.n = IS_A1 (yyvsp[-1].reg);
6708
          yyval.macfunc.op = 1;
6709
          yyval.macfunc.s0 = yyvsp[0].macfunc.s0;
6710
          yyval.macfunc.s1 = yyvsp[0].macfunc.s1;
6711
        }
6712
    break;
6713
 
6714
  case 314:
6715
#line 4079 "bfin-parse.y"
6716
    {
6717
          yyval.macfunc.n = IS_A1 (yyvsp[-1].reg);
6718
          yyval.macfunc.op = 2;
6719
          yyval.macfunc.s0 = yyvsp[0].macfunc.s0;
6720
          yyval.macfunc.s1 = yyvsp[0].macfunc.s1;
6721
        }
6722
    break;
6723
 
6724
  case 315:
6725
#line 4089 "bfin-parse.y"
6726
    {
6727
          if (IS_DREG (yyvsp[-2].reg) && IS_DREG (yyvsp[0].reg))
6728
            {
6729
              yyval.macfunc.s0 = yyvsp[-2].reg;
6730
              yyval.macfunc.s1 = yyvsp[0].reg;
6731
            }
6732
          else
6733
            return yyerror ("Dregs expected");
6734
        }
6735
    break;
6736
 
6737
  case 316:
6738
#line 4102 "bfin-parse.y"
6739
    {
6740
        yyval.r0.r0 = 0;
6741
        }
6742
    break;
6743
 
6744
  case 317:
6745
#line 4106 "bfin-parse.y"
6746
    {
6747
        yyval.r0.r0 = 1;
6748
        }
6749
    break;
6750
 
6751
  case 318:
6752
#line 4110 "bfin-parse.y"
6753
    {
6754
        yyval.r0.r0 = 2;
6755
        }
6756
    break;
6757
 
6758
  case 319:
6759
#line 4114 "bfin-parse.y"
6760
    {
6761
        yyval.r0.r0 = 3;
6762
        }
6763
    break;
6764
 
6765
  case 320:
6766
#line 4121 "bfin-parse.y"
6767
    {
6768
        yyval.modcodes.r0 = yyvsp[0].reg.regno;
6769
        yyval.modcodes.x0 = yyvsp[-1].r0.r0;
6770
        yyval.modcodes.s0 = 0;
6771
        }
6772
    break;
6773
 
6774
  case 321:
6775
#line 4127 "bfin-parse.y"
6776
    {
6777
        yyval.modcodes.r0 = 0x18;
6778
        yyval.modcodes.x0 = yyvsp[-1].r0.r0;
6779
        yyval.modcodes.s0 = 0;
6780
        }
6781
    break;
6782
 
6783
  case 322:
6784
#line 4133 "bfin-parse.y"
6785
    {
6786
        yyval.modcodes.r0 = yyvsp[-2].reg.regno;
6787
        yyval.modcodes.x0 = yyvsp[-1].r0.r0;
6788
        yyval.modcodes.s0 = 1;
6789
        }
6790
    break;
6791
 
6792
  case 323:
6793
#line 4139 "bfin-parse.y"
6794
    {
6795
        yyval.modcodes.r0 = 0x18;
6796
        yyval.modcodes.x0 = yyvsp[-1].r0.r0;
6797
        yyval.modcodes.s0 = 1;
6798
        }
6799
    break;
6800
 
6801
  case 324:
6802
#line 4149 "bfin-parse.y"
6803
    {
6804
        Expr_Node_Value val;
6805
        val.s_value = S_GET_NAME(yyvsp[0].symbol);
6806
        yyval.expr = Expr_Node_Create (Expr_Node_Reloc, val, NULL, NULL);
6807
        }
6808
    break;
6809
 
6810
  case 325:
6811
#line 4158 "bfin-parse.y"
6812
    { yyval.value = BFD_RELOC_BFIN_GOT; }
6813
    break;
6814
 
6815
  case 326:
6816
#line 4160 "bfin-parse.y"
6817
    { yyval.value = BFD_RELOC_BFIN_GOT17M4; }
6818
    break;
6819
 
6820
  case 327:
6821
#line 4162 "bfin-parse.y"
6822
    { yyval.value = BFD_RELOC_BFIN_FUNCDESC_GOT17M4; }
6823
    break;
6824
 
6825
  case 328:
6826
#line 4166 "bfin-parse.y"
6827
    {
6828
        Expr_Node_Value val;
6829
        val.i_value = yyvsp[0].value;
6830
        yyval.expr = Expr_Node_Create (Expr_Node_GOT_Reloc, val, yyvsp[-2].expr, NULL);
6831
        }
6832
    break;
6833
 
6834
  case 329:
6835
#line 4174 "bfin-parse.y"
6836
    {
6837
        yyval.expr = yyvsp[0].expr;
6838
        }
6839
    break;
6840
 
6841
  case 330:
6842
#line 4178 "bfin-parse.y"
6843
    {
6844
        yyval.expr = yyvsp[0].expr;
6845
        }
6846
    break;
6847
 
6848
  case 331:
6849
#line 4185 "bfin-parse.y"
6850
    {
6851
        yyval.expr = yyvsp[-2].expr;
6852
        }
6853
    break;
6854
 
6855
  case 332:
6856
#line 4191 "bfin-parse.y"
6857
    {
6858
        Expr_Node_Value val;
6859
        val.i_value = yyvsp[0].value;
6860
        yyval.expr = Expr_Node_Create (Expr_Node_Constant, val, NULL, NULL);
6861
        }
6862
    break;
6863
 
6864
  case 333:
6865
#line 4197 "bfin-parse.y"
6866
    {
6867
        yyval.expr = yyvsp[0].expr;
6868
        }
6869
    break;
6870
 
6871
  case 334:
6872
#line 4201 "bfin-parse.y"
6873
    {
6874
        yyval.expr = yyvsp[-1].expr;
6875
        }
6876
    break;
6877
 
6878
  case 335:
6879
#line 4205 "bfin-parse.y"
6880
    {
6881
        yyval.expr = unary (Expr_Op_Type_COMP, yyvsp[0].expr);
6882
        }
6883
    break;
6884
 
6885
  case 336:
6886
#line 4209 "bfin-parse.y"
6887
    {
6888
        yyval.expr = unary (Expr_Op_Type_NEG, yyvsp[0].expr);
6889
        }
6890
    break;
6891
 
6892
  case 337:
6893
#line 4215 "bfin-parse.y"
6894
    {
6895
        yyval.expr = yyvsp[0].expr;
6896
        }
6897
    break;
6898
 
6899
  case 338:
6900
#line 4221 "bfin-parse.y"
6901
    {
6902
        yyval.expr = binary (Expr_Op_Type_Mult, yyvsp[-2].expr, yyvsp[0].expr);
6903
        }
6904
    break;
6905
 
6906
  case 339:
6907
#line 4225 "bfin-parse.y"
6908
    {
6909
        yyval.expr = binary (Expr_Op_Type_Div, yyvsp[-2].expr, yyvsp[0].expr);
6910
        }
6911
    break;
6912
 
6913
  case 340:
6914
#line 4229 "bfin-parse.y"
6915
    {
6916
        yyval.expr = binary (Expr_Op_Type_Mod, yyvsp[-2].expr, yyvsp[0].expr);
6917
        }
6918
    break;
6919
 
6920
  case 341:
6921
#line 4233 "bfin-parse.y"
6922
    {
6923
        yyval.expr = binary (Expr_Op_Type_Add, yyvsp[-2].expr, yyvsp[0].expr);
6924
        }
6925
    break;
6926
 
6927
  case 342:
6928
#line 4237 "bfin-parse.y"
6929
    {
6930
        yyval.expr = binary (Expr_Op_Type_Sub, yyvsp[-2].expr, yyvsp[0].expr);
6931
        }
6932
    break;
6933
 
6934
  case 343:
6935
#line 4241 "bfin-parse.y"
6936
    {
6937
        yyval.expr = binary (Expr_Op_Type_Lshift, yyvsp[-2].expr, yyvsp[0].expr);
6938
        }
6939
    break;
6940
 
6941
  case 344:
6942
#line 4245 "bfin-parse.y"
6943
    {
6944
        yyval.expr = binary (Expr_Op_Type_Rshift, yyvsp[-2].expr, yyvsp[0].expr);
6945
        }
6946
    break;
6947
 
6948
  case 345:
6949
#line 4249 "bfin-parse.y"
6950
    {
6951
        yyval.expr = binary (Expr_Op_Type_BAND, yyvsp[-2].expr, yyvsp[0].expr);
6952
        }
6953
    break;
6954
 
6955
  case 346:
6956
#line 4253 "bfin-parse.y"
6957
    {
6958
        yyval.expr = binary (Expr_Op_Type_LOR, yyvsp[-2].expr, yyvsp[0].expr);
6959
        }
6960
    break;
6961
 
6962
  case 347:
6963
#line 4257 "bfin-parse.y"
6964
    {
6965
        yyval.expr = binary (Expr_Op_Type_BOR, yyvsp[-2].expr, yyvsp[0].expr);
6966
        }
6967
    break;
6968
 
6969
  case 348:
6970
#line 4261 "bfin-parse.y"
6971
    {
6972
        yyval.expr = yyvsp[0].expr;
6973
        }
6974
    break;
6975
 
6976
 
6977
    }
6978
 
6979
/* Line 1000 of yacc.c.  */
6980
#line 6981 "bfin-parse.c"
6981
 
6982
  yyvsp -= yylen;
6983
  yyssp -= yylen;
6984
 
6985
 
6986
  YY_STACK_PRINT (yyss, yyssp);
6987
 
6988
  *++yyvsp = yyval;
6989
 
6990
 
6991
  /* Now `shift' the result of the reduction.  Determine what state
6992
     that goes to, based on the state we popped back to and the rule
6993
     number reduced by.  */
6994
 
6995
  yyn = yyr1[yyn];
6996
 
6997
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6998
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6999
    yystate = yytable[yystate];
7000
  else
7001
    yystate = yydefgoto[yyn - YYNTOKENS];
7002
 
7003
  goto yynewstate;
7004
 
7005
 
7006
/*------------------------------------.
7007
| yyerrlab -- here on detecting error |
7008
`------------------------------------*/
7009
yyerrlab:
7010
  /* If not already recovering from an error, report this error.  */
7011
  if (!yyerrstatus)
7012
    {
7013
      ++yynerrs;
7014
#if YYERROR_VERBOSE
7015
      yyn = yypact[yystate];
7016
 
7017
      if (YYPACT_NINF < yyn && yyn < YYLAST)
7018
        {
7019
          YYSIZE_T yysize = 0;
7020
          int yytype = YYTRANSLATE (yychar);
7021
          const char* yyprefix;
7022
          char *yymsg;
7023
          int yyx;
7024
 
7025
          /* Start YYX at -YYN if negative to avoid negative indexes in
7026
             YYCHECK.  */
7027
          int yyxbegin = yyn < 0 ? -yyn : 0;
7028
 
7029
          /* Stay within bounds of both yycheck and yytname.  */
7030
          int yychecklim = YYLAST - yyn;
7031
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
7032
          int yycount = 0;
7033
 
7034
          yyprefix = ", expecting ";
7035
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
7036
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
7037
              {
7038
                yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
7039
                yycount += 1;
7040
                if (yycount == 5)
7041
                  {
7042
                    yysize = 0;
7043
                    break;
7044
                  }
7045
              }
7046
          yysize += (sizeof ("syntax error, unexpected ")
7047
                     + yystrlen (yytname[yytype]));
7048
          yymsg = (char *) YYSTACK_ALLOC (yysize);
7049
          if (yymsg != 0)
7050
            {
7051
              char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
7052
              yyp = yystpcpy (yyp, yytname[yytype]);
7053
 
7054
              if (yycount < 5)
7055
                {
7056
                  yyprefix = ", expecting ";
7057
                  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
7058
                    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
7059
                      {
7060
                        yyp = yystpcpy (yyp, yyprefix);
7061
                        yyp = yystpcpy (yyp, yytname[yyx]);
7062
                        yyprefix = " or ";
7063
                      }
7064
                }
7065
              yyerror (yymsg);
7066
              YYSTACK_FREE (yymsg);
7067
            }
7068
          else
7069
            yyerror ("syntax error; also virtual memory exhausted");
7070
        }
7071
      else
7072
#endif /* YYERROR_VERBOSE */
7073
        yyerror ("syntax error");
7074
    }
7075
 
7076
 
7077
 
7078
  if (yyerrstatus == 3)
7079
    {
7080
      /* If just tried and failed to reuse lookahead token after an
7081
         error, discard it.  */
7082
 
7083
      if (yychar <= YYEOF)
7084
        {
7085
          /* If at end of input, pop the error token,
7086
             then the rest of the stack, then return failure.  */
7087
          if (yychar == YYEOF)
7088
             for (;;)
7089
               {
7090
                 YYPOPSTACK;
7091
                 if (yyssp == yyss)
7092
                   YYABORT;
7093
                 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
7094
                 yydestruct (yystos[*yyssp], yyvsp);
7095
               }
7096
        }
7097
      else
7098
        {
7099
          YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
7100
          yydestruct (yytoken, &yylval);
7101
          yychar = YYEMPTY;
7102
 
7103
        }
7104
    }
7105
 
7106
  /* Else will try to reuse lookahead token after shifting the error
7107
     token.  */
7108
  goto yyerrlab1;
7109
 
7110
 
7111
/*---------------------------------------------------.
7112
| yyerrorlab -- error raised explicitly by YYERROR.  |
7113
`---------------------------------------------------*/
7114
yyerrorlab:
7115
 
7116
#ifdef __GNUC__
7117
  /* Pacify GCC when the user code never invokes YYERROR and the label
7118
     yyerrorlab therefore never appears in user code.  */
7119
  if (0)
7120
     goto yyerrorlab;
7121
#endif
7122
 
7123
  yyvsp -= yylen;
7124
  yyssp -= yylen;
7125
  yystate = *yyssp;
7126
  goto yyerrlab1;
7127
 
7128
 
7129
/*-------------------------------------------------------------.
7130
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
7131
`-------------------------------------------------------------*/
7132
yyerrlab1:
7133
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
7134
 
7135
  for (;;)
7136
    {
7137
      yyn = yypact[yystate];
7138
      if (yyn != YYPACT_NINF)
7139
        {
7140
          yyn += YYTERROR;
7141
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7142
            {
7143
              yyn = yytable[yyn];
7144
              if (0 < yyn)
7145
                break;
7146
            }
7147
        }
7148
 
7149
      /* Pop the current state because it cannot handle the error token.  */
7150
      if (yyssp == yyss)
7151
        YYABORT;
7152
 
7153
      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
7154
      yydestruct (yystos[yystate], yyvsp);
7155
      YYPOPSTACK;
7156
      yystate = *yyssp;
7157
      YY_STACK_PRINT (yyss, yyssp);
7158
    }
7159
 
7160
  if (yyn == YYFINAL)
7161
    YYACCEPT;
7162
 
7163
  YYDPRINTF ((stderr, "Shifting error token, "));
7164
 
7165
  *++yyvsp = yylval;
7166
 
7167
 
7168
  yystate = yyn;
7169
  goto yynewstate;
7170
 
7171
 
7172
/*-------------------------------------.
7173
| yyacceptlab -- YYACCEPT comes here.  |
7174
`-------------------------------------*/
7175
yyacceptlab:
7176
  yyresult = 0;
7177
  goto yyreturn;
7178
 
7179
/*-----------------------------------.
7180
| yyabortlab -- YYABORT comes here.  |
7181
`-----------------------------------*/
7182
yyabortlab:
7183
  yyresult = 1;
7184
  goto yyreturn;
7185
 
7186
#ifndef yyoverflow
7187
/*----------------------------------------------.
7188
| yyoverflowlab -- parser overflow comes here.  |
7189
`----------------------------------------------*/
7190
yyoverflowlab:
7191
  yyerror ("parser stack overflow");
7192
  yyresult = 2;
7193
  /* Fall through.  */
7194
#endif
7195
 
7196
yyreturn:
7197
#ifndef yyoverflow
7198
  if (yyss != yyssa)
7199
    YYSTACK_FREE (yyss);
7200
#endif
7201
  return yyresult;
7202
}
7203
 
7204
 
7205
#line 4267 "bfin-parse.y"
7206
 
7207
 
7208
EXPR_T
7209
mkexpr (int x, SYMBOL_T s)
7210
{
7211
  EXPR_T e = (EXPR_T) ALLOCATE (sizeof (struct expression_cell));
7212
  e->value = x;
7213
  EXPR_SYMBOL(e) = s;
7214
  return e;
7215
}
7216
 
7217
static int
7218
value_match (Expr_Node *expr, int sz, int sign, int mul, int issigned)
7219
{
7220
  long umax = (1L << sz) - 1;
7221
  long min = -1L << (sz - 1);
7222
  long max = (1L << (sz - 1)) - 1;
7223
 
7224
  long v = EXPR_VALUE (expr);
7225
 
7226
  if ((v % mul) != 0)
7227
    {
7228
      error ("%s:%d: Value Error -- Must align to %d\n", __FILE__, __LINE__, mul);
7229
      return 0;
7230
    }
7231
 
7232
  v /= mul;
7233
 
7234
  if (sign)
7235
    v = -v;
7236
 
7237
  if (issigned)
7238
    {
7239
      if (v >= min && v <= max) return 1;
7240
 
7241
#ifdef DEBUG
7242
      fprintf(stderr, "signed value %lx out of range\n", v * mul);
7243
#endif
7244
      return 0;
7245
    }
7246
  if (v <= umax && v >= 0)
7247
    return 1;
7248
#ifdef DEBUG
7249
  fprintf(stderr, "unsigned value %lx out of range\n", v * mul);
7250
#endif
7251
  return 0;
7252
}
7253
 
7254
/* Return the expression structure that allows symbol operations.
7255
   If the left and right children are constants, do the operation.  */
7256
static Expr_Node *
7257
binary (Expr_Op_Type op, Expr_Node *x, Expr_Node *y)
7258
{
7259
  Expr_Node_Value val;
7260
 
7261
  if (x->type == Expr_Node_Constant && y->type == Expr_Node_Constant)
7262
    {
7263
      switch (op)
7264
        {
7265
        case Expr_Op_Type_Add:
7266
          x->value.i_value += y->value.i_value;
7267
          break;
7268
        case Expr_Op_Type_Sub:
7269
          x->value.i_value -= y->value.i_value;
7270
          break;
7271
        case Expr_Op_Type_Mult:
7272
          x->value.i_value *= y->value.i_value;
7273
          break;
7274
        case Expr_Op_Type_Div:
7275
          if (y->value.i_value == 0)
7276
            error ("Illegal Expression:  Division by zero.");
7277
          else
7278
            x->value.i_value /= y->value.i_value;
7279
          break;
7280
        case Expr_Op_Type_Mod:
7281
          x->value.i_value %= y->value.i_value;
7282
          break;
7283
        case Expr_Op_Type_Lshift:
7284
          x->value.i_value <<= y->value.i_value;
7285
          break;
7286
        case Expr_Op_Type_Rshift:
7287
          x->value.i_value >>= y->value.i_value;
7288
          break;
7289
        case Expr_Op_Type_BAND:
7290
          x->value.i_value &= y->value.i_value;
7291
          break;
7292
        case Expr_Op_Type_BOR:
7293
          x->value.i_value |= y->value.i_value;
7294
          break;
7295
        case Expr_Op_Type_BXOR:
7296
          x->value.i_value ^= y->value.i_value;
7297
          break;
7298
        case Expr_Op_Type_LAND:
7299
          x->value.i_value = x->value.i_value && y->value.i_value;
7300
          break;
7301
        case Expr_Op_Type_LOR:
7302
          x->value.i_value = x->value.i_value || y->value.i_value;
7303
          break;
7304
 
7305
        default:
7306
          error ("%s:%d: Internal compiler error\n", __FILE__, __LINE__);
7307
        }
7308
      return x;
7309
    }
7310
  /* Canonicalize order to EXPR OP CONSTANT.  */
7311
  if (x->type == Expr_Node_Constant)
7312
    {
7313
      Expr_Node *t = x;
7314
      x = y;
7315
      y = t;
7316
    }
7317
  /* Canonicalize subtraction of const to addition of negated const.  */
7318
  if (op == Expr_Op_Type_Sub && y->type == Expr_Node_Constant)
7319
    {
7320
      op = Expr_Op_Type_Add;
7321
      y->value.i_value = -y->value.i_value;
7322
    }
7323
  if (y->type == Expr_Node_Constant && x->type == Expr_Node_Binop
7324
      && x->Right_Child->type == Expr_Node_Constant)
7325
    {
7326
      if (op == x->value.op_value && x->value.op_value == Expr_Op_Type_Add)
7327
        {
7328
          x->Right_Child->value.i_value += y->value.i_value;
7329
          return x;
7330
        }
7331
    }
7332
 
7333
  /* Create a new expression structure.  */
7334
  val.op_value = op;
7335
  return Expr_Node_Create (Expr_Node_Binop, val, x, y);
7336
}
7337
 
7338
static Expr_Node *
7339
unary (Expr_Op_Type op, Expr_Node *x)
7340
{
7341
  if (x->type == Expr_Node_Constant)
7342
    {
7343
      switch (op)
7344
        {
7345
        case Expr_Op_Type_NEG:
7346
          x->value.i_value = -x->value.i_value;
7347
          break;
7348
        case Expr_Op_Type_COMP:
7349
          x->value.i_value = ~x->value.i_value;
7350
          break;
7351
        default:
7352
          error ("%s:%d: Internal compiler error\n", __FILE__, __LINE__);
7353
        }
7354
      return x;
7355
    }
7356
  else
7357
    {
7358
      /* Create a new expression structure.  */
7359
      Expr_Node_Value val;
7360
      val.op_value = op;
7361
      return Expr_Node_Create (Expr_Node_Unop, val, x, NULL);
7362
    }
7363
}
7364
 
7365
int debug_codeselection = 0;
7366
static void
7367
notethat (char *format, ...)
7368
{
7369
  va_list ap;
7370
  va_start (ap, format);
7371
  if (debug_codeselection)
7372
    {
7373
      vfprintf (errorf, format, ap);
7374
    }
7375
  va_end (ap);
7376
}
7377
 
7378
#ifdef TEST
7379
main (int argc, char **argv)
7380
{
7381
  yyparse();
7382
}
7383
#endif
7384
 
7385
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.