gamma_asm.c 18.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755
/*
 * Copyright (C) 1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * Copyright (C) 1998 Digital Equipment Corporation
 *
 * This file is part of the SimOS distribution.
 * See LICENSE file for terms of the license.
 *
 */


#include <stdio.h>
#include <alpha/inst.h>

#include "sim_error.h"

#include "gamma.h"
#include "alpha_regs.h"
#include "alpha_insts.h"

#ifdef GAMMA_ASM_EXTERNS
 
OperateFunction gammaOperateTable[1<<13];
MemoryFunction  gammaMemoryTable[1<<6];
FPFunction      gammaFPTable[(1<<17)];

uint            gammaOperateFlags[1<<13];
uint            gammaFPFlags[1<<17];


#define GAMMA_OPTFMT(_opcode,_func,NAME)   \
    extern void NAME ## _ff(Reg,Reg,const Reg *rcp,Reg *rdestp);

#define GAMMA_C_OPTFMT       GAMMA_OPTFMT
#define GAMMA_CANTRAP_OPTFMT GAMMA_OPTFMT
#define GAMMA_COMPLEX_OPTFMT GAMMA_OPTFMT

#define GAMMA_MEM_LOAD(NAME) \
extern void NAME ## _ff(Reg *, const Reg *, Reg*, PA, VA);
#define GAMMA_MEM_STORE   GAMMA_MEM_LOAD
#define GAMMA_MEM_FPLOAD  GAMMA_MEM_LOAD
#define GAMMA_MEM_FPSTORE GAMMA_MEM_LOAD

#define GAMMA_FP_OPER(_o,_f,NAME) extern void NAME ## _ff(const double *a, const double* b, const double *c, double *rdest, Reg *);
#define GAMMA_SFP_OPER(_o,_f,NAME) extern void NAME ## _ff(const double *a, const double *B, const double *c, double *rdest, Reg *);
#define GAMMA_CVTFP_OPER    GAMMA_FP_OPER
#define GAMMA_EMPTY_FP_OPER GAMMA_FP_OPER
#define GAMMA_FPC_OPER      GAMMA_FP_OPER

#define GAMMA_COMPLEX_FP(_o,NAME) extern void NAME ## _ff(const double *a, const double* b, const double *c, double *rdest, Reg *);

#else /* GAMMA_ASM_EXTERNS */

#ifdef GAMMA_ASM_TABLE
#undef GAMMA_OPTFMT
#undef GAMMA_C_OPTFMT
#undef GAMMA_CANTRAP_OPTFMT
#undef GAMMA_COMPLEX_OPTFMT
#undef GAMMA_MEM_LOAD
#undef GAMMA_MEM_FPLOAD
#undef GAMMA_MEM_FPSTORE
#undef GAMMA_FP_OPER
#undef GAMMA_FPC_OPER
#undef GAMMA_SFP_OPER
#undef GAMMA_COMPLEX_FP
#undef GAMMA_CVTFP_OPER
#undef GAMMA_EMPTY_FP_OPER

#define GAMMA_OPTFMT(_opcode,_func,NAME) \
    gammaOperateTable[(_opcode <<7) + _func] = NAME ## _ff; \
    gammaOperateFlags[(_opcode <<7) + _func] = AXPTYPE_INT;

#define GAMMA_C_OPTFMT(_opcode,_func,NAME) \
    gammaOperateTable[(_opcode <<7) + _func] = NAME ## _ff; \
    gammaOperateFlags[(_opcode <<7) + _func] = (AXPTYPE_INT|AXPTYPE_INT_CONDITIONAL);

#define GAMMA_CANTRAP_OPTFMT(_opcode,_func,NAME) \
    gammaOperateTable[(_opcode <<7) + _func] = NAME ## _ff; \
    gammaOperateFlags[(_opcode <<7) + _func] = (AXPTYPE_INT|AXPTYPE_CANTRAP);

#define GAMMA_COMPLEX_OPTFMT(_opcode,_func,NAME) \
    gammaOperateTable[(_opcode <<7) + _func] = NAME ## _ff; \
    gammaOperateFlags[(_opcode <<7) + _func] = (AXPTYPE_INT|AXPTYPE_GAMMA);


#define GAMMA_MEM_LOAD(NAME) \
    gammaMemoryTable[op_ ## NAME] = NAME ## _ff;

#define GAMMA_MEM_STORE  GAMMA_MEM_LOAD
#define GAMMA_MEM_FPLOAD GAMMA_MEM_LOAD
#define GAMMA_MEM_FPSTORE GAMMA_MEM_LOAD

#define GAMMA_FP_OPER(opcode,func,NAME) \
    gammaFPTable[(opcode<<11)+ func] = NAME ## _ff;\
    gammaFPFlags[(opcode<<11)+ func] = (AXPTYPE_FP);

#define GAMMA_SFP_OPER(opcode,func,NAME) \
    gammaFPTable[(opcode<<11)+ func] = NAME ## _ff;\
    gammaFPFlags[(opcode<<11)+ func] = (AXPTYPE_FP|AXPTYPE_FP_SINGLE);

#define GAMMA_CVTFP_OPER(opcode,func,NAME) \
    gammaFPTable[(opcode<<11)+ func] = NAME ## _ff;\
    gammaFPFlags[(opcode<<11)+ func] = (AXPTYPE_FP|AXPTYPE_FP_CVT);

#define GAMMA_EMPTY_FP_OPER(opcode,func,NAME) \
    gammaFPTable[(opcode<<11)+ func] = NAME ## _ff;\
    gammaFPFlags[(opcode<<11)+ func] = (AXPTYPE_FP|AXPTYPE_FP_EMPTY);

#define GAMMA_FPC_OPER(opcode,func,NAME) \
    gammaFPTable[(opcode<<11)+ func] = NAME ## _ff;\
    gammaFPFlags[(opcode<<11)+ func] = (AXPTYPE_FP|AXPTYPE_FP_CONDITIONAL);

#define GAMMA_COMPLEX_FP(o_,NAME) \
    gammaFPTable[(op_ ## o_ <<11)+ o_ ## _ ## NAME] = NAME ## _ff;\
    gammaFPFlags[(op_ ## o_ <<11)+ o_ ## _ ## NAME] = (AXPTYPE_FP);

#else /* GAMMA_ASM_TABLE */
#define GAMMA_OPTFMT(_opcode,_func,NAME) \
void NAME ## _ff(Reg a, Reg b, Reg *c, Reg *rdestp) \
{ \
    Reg lv1;  \
    asm(#NAME " %1, %2, %0"  : "&=r" (lv1): "r" (a) , "r" (b)); \
   *rdestp = lv1; \
}


/* ************************************************************888
 * XXXXX XXXX extremely brittle code
 * make sure that the read spec for lv1 matches the number of the write spec for lv1
 * so that GCC will put both uses in the same register. -Jamey Hicks
 * 
 * *****************/
int never = 0;
#define GAMMA_C_OPTFMT(_opcode,_func,NAME) \
void NAME ## _ff(long a, long b, const long *c, long *rdestp) \
{ \
    long lv1 = *c;  \
    asm(#NAME " %1, %2, %0"  : "&=r" (lv1): "r" (a) , "r" (b), "0" (lv1)); \
   *rdestp = lv1; \
}

#define GAMMA_CANTRAP_OPTFMT(_opcode,_func,NAME) \
void NAME ## _ff(Reg a, Reg b, Reg *c, Reg *rdestp) \
{ \
    Reg lv1;  \
    asm(#NAME " %1, %2, %0; trapb"  : "&=r" (lv1): "r" (a) , "r" (b)); \
   *rdestp = lv1; \
}

/* implementation is in gamma.c */
#define GAMMA_COMPLEX_OPTFMT(_opcode,_func,NAME)

#define GAMMA_MEM_LOAD(NAME) \
void NAME ##_ff (Reg *rdestp, const Reg *raPtr, Reg *mAddr, PA pAddr, VA foo) \
{ \
     Reg lv;  \
     asm(#NAME " %0, 0(%1)" : "&=r" (lv) :  "r" (mAddr)) ; \
     *rdestp = lv;  \
}

#define GAMMA_MEM_STORE(NAME) \
void NAME ##_ff (Reg *rdestp, const Reg *a, Reg *mAddr, PA pAddr, VA foo) \
{ \
     asm(#NAME " %1, %0" : "=o" (*mAddr) :  "r" (*a)) ; \
}

#define GAMMA_MEM_FPLOAD(NAME) \
void NAME ##_ff (Reg *rdestp, const Reg *raPtr, Reg *mAddr, PA pAddr, VA foo) \
{ \
     double lv;  \
     asm(#NAME " %0, 0(%1)" : "&=f" (lv) :  "r" (mAddr)) ; \
     *((double*)rdestp) = lv;  \
}

#define GAMMA_MEM_FPSTORE(NAME) \
void NAME ##_ff (Reg *rdestp, const Reg *a, Reg *mAddr, PA pAddr, VA foo) \
{ \
     double rv = *(double*)a; \
     asm(#NAME " %1, %0" : "=o" (*mAddr) :  "f" (rv)) ; \
}

#define GAMMA_FP_OPER(_o,_f,NAME) \
void NAME ## _ff(const double *a, const double *b, const double *c, double *rdestp, Reg *cr) \
{ \
  register double fav = *a; \
  register double fbv = *b; \
  register double fcv = *c; \
  register double fpcr = *(double *)cr; \
  asm("mt_fpcr %4;" #NAME " %2 %3 %0; mf_fpcr %1 " \
  : "=f" (fcv) , "=f" (fpcr) \
  : "f" (fav) , "f" (fbv), "f" (fpcr)); \
  *rdestp  = fcv; *(double*)cr = fpcr;  \
}

#define GAMMA_FPC_OPER(_o,_f,NAME) \
void NAME ## _ff(const double *a, const double *b, const double *c, double *rdestp, Reg *cr) \
{ \
  register double fav = *a; \
  register double fbv = *b; \
  register double fcv = *c; \
  register double fpcr = *(double*)cr; \
  asm("mt_fpcr %4;" #NAME " %2 %3 %0; mf_fpcr %1 " \
  : "=f" (fcv) , "=f" (fpcr) \
  : "f" (fav) , "f" (fbv), "f" (fpcr), "0" (fcv)); \
  *rdestp  = fcv; *(double*)cr = fpcr;  \
}
#define GAMMA_CVTFP_OPER(_o,_f,NAME) \
void NAME ## _ff(const double *a, const double *b, const double *c, double *rdestp, Reg *cr) \
{ \
  register double fbv = *b; \
  register double fcv = *c; \
  register double fpcr = *(double*)cr; \
  asm("mt_fpcr %3;" #NAME " %2  %0; mf_fpcr %1 " \
  : "=f" (fcv) , "=f" (fpcr) \
  : "f" (fbv), "f" (fpcr)); \
  *rdestp  = fcv; *(double*)cr = fpcr;  \
}

#define GAMMA_SFP_OPER(_o,_f,NAME) \
void NAME ## _ff(const double *a, const double *b, const double *c, double *rdestp, Reg *cr) \
{ \
  register double fav = *a; \
  register double fbv = *b; \
  register double fcv = *c; \
  register double fpcr = *(double*)cr; \
  asm("mt_fpcr %4;" #NAME " %2 %3 %0; mf_fpcr %1 " \
  : "=f" (fcv) , "=f" (fpcr) \
  : "f" (fav) , "f" (fbv), "f" (fpcr)); \
  *rdestp  = fcv; *(double*)cr = fpcr;  \
}


#define GAMMA_EMPTY_FP_OPER(_o,_f,NAME)  \
void NAME ## _ff(const double *a, const double *b, double *rdest, Reg *cr) \
{ \
     CPUWarning("Unimplemented FP opcode %s \n", #NAME);  \
}

#define GAMMA_COMPLEX_FP(o_,NAME)

Reg gammaReadFPCR()
{
  double fpcr;
  Reg result;
  asm("mf_fpcr %0, %0, %0\n" : "=f" (fpcr));
  result = *(Reg*)&fpcr;
  return result;  
}

void gammaWriteFPCR(Reg newfpcr)
{
  double input = *(double *)&newfpcr;
  asm("mt_fpcr %0, %0, %0\n"
      : : "f" (input));
}

Reg gammaExchangeFPCR(Reg newfpcr)
{
  double input = *(double *)&newfpcr;
  double oldfpcr;
  Reg result;
  asm("mf_fpcr %0, %0, %0\n"
      "mt_fpcr %1, %1, %1\n"
      : "=f" (oldfpcr) : "f" (input));
  result = *(Reg*)&oldfpcr;
  return result;  
}

#endif /*GAMMA_ASM_TABLE */
#endif /*GAMMA_ASM_EXTERNS */



#define GAMMA_INTA(NAME) GAMMA_OPTFMT(op_inta,inta_ ##NAME, NAME)
#define GAMMA_INTA_CANTRAP(NAME) GAMMA_CANTRAP_OPTFMT(op_inta,inta_ ##NAME, NAME)

#define GAMMA_INTL(NAME) GAMMA_OPTFMT(op_intl,intl_ ##NAME, NAME)
#define GAMMA_INTL_C(NAME) GAMMA_C_OPTFMT(op_intl,intl_ ##NAME, NAME)
#define GAMMA_INTL_CANTRAP(NAME) GAMMA_CANTRAP_OPTFMT(op_intl,intl_ ##NAME, NAME)
#define GAMMA_INTL_COMPLEX(NAME) GAMMA_COMPLEX_OPTFMT(op_intl,intl_ ##NAME, NAME)

#define GAMMA_INTS(NAME) GAMMA_OPTFMT(op_ints,ints_ ##NAME, NAME)

#define GAMMA_INTM(NAME) GAMMA_OPTFMT(op_intm,intm_ ##NAME, NAME)
#define GAMMA_INTM_CANTRAP(NAME) GAMMA_CANTRAP_OPTFMT(op_intm,intm_ ##NAME, NAME)

#define GAMMA_FPI(NAME)  GAMMA_FP_OPER(op_flti,flti_ ##NAME, NAME)
#define GAMMA_CVTI(NAME) GAMMA_CVTFP_OPER(op_flti,flti_ ##NAME, NAME)
#define GAMMA_CVTL(NAME) GAMMA_CVTFP_OPER(op_fltl,fltl_ ##NAME,NAME)
#define GAMMA_FPL(NAME)  GAMMA_FP_OPER(op_fltl,fltl_ ##NAME, NAME)
#define GAMMA_FPL_C(NAME)  GAMMA_FPC_OPER(op_fltl,fltl_ ##NAME, NAME)
#define GAMMA_SFP(NAME)  GAMMA_SFP_OPER(op_flti,flti_ ##NAME,NAME)
#define GAMMA_EMPTY_FPL(NAME) GAMMA_EMPTY_FP_OPER(op_fltl,fltl_ ##NAME,NAME)

GAMMA_INTA (addl)
GAMMA_INTA (s4addl)
GAMMA_INTA (subl)
GAMMA_INTA (s4subl)
GAMMA_INTA (cmpbge)
GAMMA_INTA (s8addl)
GAMMA_INTA (s8subl)
GAMMA_INTA (cmpult)
GAMMA_INTA (addq)
GAMMA_INTA (s4addq)
GAMMA_INTA (subq)
GAMMA_INTA (s4subq)
GAMMA_INTA (cmpeq)
GAMMA_INTA (s8addq)
GAMMA_INTA (s8subq)
GAMMA_INTA (cmpule)
GAMMA_INTA_CANTRAP (addlv)
GAMMA_INTA_CANTRAP (sublv)
GAMMA_INTA (cmplt)
GAMMA_INTA_CANTRAP (addqv)
GAMMA_INTA_CANTRAP (subqv)
GAMMA_INTA (cmple)

/* Caution: the cmov are fixed. -Jamey Hicks */

GAMMA_INTL   (and)
GAMMA_INTL   (bic)
GAMMA_INTL_C (cmovlbs)
GAMMA_INTL_C (cmovlbc)
GAMMA_INTL   (bis)
GAMMA_INTL_C (cmoveq)
GAMMA_INTL_C (cmovne)
GAMMA_INTL   (ornot)
GAMMA_INTL   (xor)
GAMMA_INTL_C (cmovlt)
GAMMA_INTL_C (cmovge)
GAMMA_INTL_CANTRAP (eqv)  /* bugnion XXX !!! */
GAMMA_INTL_COMPLEX(amask)
GAMMA_INTL_C (cmovle)
GAMMA_INTL_C (cmovgt)
GAMMA_INTL_COMPLEX(implver)

GAMMA_INTS (mskbl)
GAMMA_INTS (extbl)
GAMMA_INTS (insbl)
GAMMA_INTS (mskwl)
GAMMA_INTS (extwl)
GAMMA_INTS (inswl)
GAMMA_INTS (mskll)
GAMMA_INTS (extll)
GAMMA_INTS (insll)
GAMMA_INTS (zap)
GAMMA_INTS (zapnot)
GAMMA_INTS (mskql)
GAMMA_INTS (srl)
GAMMA_INTS (extql)
GAMMA_INTS (sll)
GAMMA_INTS (insql)
GAMMA_INTS (sra)
GAMMA_INTS (mskwh)
GAMMA_INTS (inswh)
GAMMA_INTS (extwh)
GAMMA_INTS (msklh)
GAMMA_INTS (inslh)
GAMMA_INTS (extlh)
GAMMA_INTS (mskqh)
GAMMA_INTS (insqh)
GAMMA_INTS (extqh)

GAMMA_INTM (mull)
GAMMA_INTM (mulq)
GAMMA_INTM (umulh)
GAMMA_INTM_CANTRAP (mullv)
GAMMA_INTM_CANTRAP (mulqv)

GAMMA_MEM_LOAD  (ldq_u)
GAMMA_MEM_LOAD  (ldl)
GAMMA_MEM_LOAD  (ldq)

GAMMA_MEM_STORE (stq_u)
GAMMA_MEM_STORE (stl)
GAMMA_MEM_STORE (stq)

GAMMA_MEM_FPLOAD (ldf)
GAMMA_MEM_FPLOAD (ldg)
GAMMA_MEM_FPLOAD (lds)
GAMMA_MEM_FPLOAD (ldt)

GAMMA_MEM_FPSTORE (stf)
GAMMA_MEM_FPSTORE (stg)
GAMMA_MEM_FPSTORE (sts)
GAMMA_MEM_FPSTORE (stt)

/* VAX opcodes */
#ifdef later
GAMMA_FP_OPER (addfc)
GAMMA_FP_OPER (subfc)
GAMMA_FP_OPER (mulfc)
GAMMA_FP_OPER (divfc)
GAMMA_FP_OPER (addgc)
GAMMA_FP_OPER (subgc)
GAMMA_FP_OPER (mulgc)
GAMMA_FP_OPER (divgc)
GAMMA_FP_OPER (addf)
GAMMA_FP_OPER (subf)
GAMMA_FP_OPER (mulf)
GAMMA_FP_OPER (divf)
GAMMA_FP_OPER (addg)
GAMMA_FP_OPER (subg)
GAMMA_FP_OPER (mulg)
GAMMA_FP_OPER (divg)
GAMMA_FP_OPER (cmpgeq)
GAMMA_FP_OPER (cmpglt)
GAMMA_FP_OPER (cmpgle)
GAMMA_FP_OPER (addfuc)
GAMMA_FP_OPER (subfuc)
GAMMA_FP_OPER (mulfuc)
GAMMA_FP_OPER (divfuc)
GAMMA_FP_OPER (addguc)
GAMMA_FP_OPER (subguc)
GAMMA_FP_OPER (mulguc)
GAMMA_FP_OPER (divguc)
GAMMA_FP_OPER (addfu)
GAMMA_FP_OPER (subfu)
GAMMA_FP_OPER (mulfu)
GAMMA_FP_OPER (divfu)
GAMMA_FP_OPER (addgu)
GAMMA_FP_OPER (subgu)
GAMMA_FP_OPER (mulgu)
GAMMA_FP_OPER (divgu)
GAMMA_FP_OPER (addfsc)
GAMMA_FP_OPER (subfsc)
GAMMA_FP_OPER (mulfsc)
GAMMA_FP_OPER (divfsc)
GAMMA_FP_OPER (addgsc)
GAMMA_FP_OPER (subgsc)
GAMMA_FP_OPER (mulgsc)
GAMMA_FP_OPER (divgsc)
GAMMA_FP_OPER (addfs)
GAMMA_FP_OPER (subfs)
GAMMA_FP_OPER (mulfs)
GAMMA_FP_OPER (divfs)
GAMMA_FP_OPER (addgs)
GAMMA_FP_OPER (subgs)
GAMMA_FP_OPER (mulgs)
GAMMA_FP_OPER (divgs)
GAMMA_FP_OPER (cmpgeqs)
GAMMA_FP_OPER (cmpglts)
GAMMA_FP_OPER (cmpgles)
GAMMA_FP_OPER (addfsuc)
GAMMA_FP_OPER (subfsuc)
GAMMA_FP_OPER (mulfsuc)
GAMMA_FP_OPER (divfsuc)
GAMMA_FP_OPER (addgsuc)
GAMMA_FP_OPER (subgsuc)
GAMMA_FP_OPER (mulgsuc)
GAMMA_FP_OPER (divgsuc)
GAMMA_FP_OPER (addfsu)
GAMMA_FP_OPER (subfsu)
GAMMA_FP_OPER (mulfsu)
GAMMA_FP_OPER (divfsu)
GAMMA_FP_OPER (addgsu)
GAMMA_FP_OPER (subgsu)
GAMMA_FP_OPER (mulgsu)
GAMMA_FP_OPER (divgsu) 
#endif /* later: VAX */
GAMMA_FPI (addsc)
GAMMA_FPI (subsc)
GAMMA_FPI (mulsc)
GAMMA_FPI (divsc)
GAMMA_FPI (addtc)
GAMMA_FPI (subtc)
GAMMA_FPI (multc)
GAMMA_FPI (divtc)
GAMMA_FPI (addsm)
GAMMA_FPI (subsm)
GAMMA_FPI (mulsm)
GAMMA_FPI (divsm)
GAMMA_FPI (addtm)
GAMMA_FPI (subtm)
GAMMA_FPI (multm)
GAMMA_FPI (divtm)

GAMMA_COMPLEX_FP(fltl,mf_fpcr)
GAMMA_COMPLEX_FP(fltl,mt_fpcr)

/*
 * single precision
 */

GAMMA_SFP(adds)
GAMMA_SFP(subs)
GAMMA_SFP(muls)
GAMMA_SFP(divs)


GAMMA_FPI (addt)
GAMMA_FPI (subt)
GAMMA_FPI (mult)
GAMMA_FPI (divt)
GAMMA_FPI (cmptun)
GAMMA_FPI (cmpteq)
GAMMA_FPI (cmptlt)
GAMMA_FPI (cmptle)
GAMMA_FPI (addsd)
GAMMA_FPI (subsd)
GAMMA_FPI (mulsd)
GAMMA_FPI (divsd)
GAMMA_FPI (addtd)
GAMMA_FPI (subtd)
GAMMA_FPI (multd)
GAMMA_FPI (divtd)
GAMMA_FPI (addsuc)
GAMMA_FPI (subsuc)
GAMMA_FPI (mulsuc)
GAMMA_FPI (divsuc)
GAMMA_FPI (addtuc)
GAMMA_FPI (subtuc)
GAMMA_FPI (multuc)
GAMMA_FPI (divtuc)
GAMMA_FPI (addsum)
GAMMA_FPI (subsum)
GAMMA_FPI (mulsum)
GAMMA_FPI (divsum)
GAMMA_FPI (addtum)
GAMMA_FPI (subtum)
GAMMA_FPI (multum)
GAMMA_FPI (divtum)
GAMMA_FPI (addsu)
GAMMA_FPI (subsu)
GAMMA_FPI (mulsu)
GAMMA_FPI (divsu)
GAMMA_FPI (addtu)
GAMMA_FPI (subtu)
GAMMA_FPI (multu)
GAMMA_FPI (divtu)
GAMMA_FPI (addsud)
GAMMA_FPI (subsud)
GAMMA_FPI (mulsud)
GAMMA_FPI (divsud)
GAMMA_FPI (addtud)
GAMMA_FPI (subtud)
GAMMA_FPI (multud)
GAMMA_FPI (divtud)
GAMMA_FPI (addssuc)
GAMMA_FPI (subssuc)
GAMMA_FPI (mulssuc)
GAMMA_FPI (divssuc)
GAMMA_FPI (addtsuc)
GAMMA_FPI (subtsuc)
GAMMA_FPI (multsuc)
GAMMA_FPI (divtsuc)
GAMMA_FPI (addssum)
GAMMA_FPI (subssum)
GAMMA_FPI (mulssum)
GAMMA_FPI (divssum)
GAMMA_FPI (addtsum)
GAMMA_FPI (subtsum)
GAMMA_FPI (multsum)
GAMMA_FPI (divtsum)
GAMMA_FPI (addssu)
GAMMA_FPI (subssu)
GAMMA_FPI (mulssu)
GAMMA_FPI (divssu)
GAMMA_FPI (addtsu)
GAMMA_FPI (subtsu)
GAMMA_FPI (multsu)
GAMMA_FPI (divtsu)
GAMMA_FPI (cmptunsu)
GAMMA_FPI (cmpteqsu)
GAMMA_FPI (cmptltsu)
GAMMA_FPI (cmptlesu)
GAMMA_FPI (addssud)
GAMMA_FPI (subssud)
GAMMA_FPI (mulssud)
GAMMA_FPI (divssud)
GAMMA_FPI (addtsud)
GAMMA_FPI (subtsud)
GAMMA_FPI (multsud)
GAMMA_FPI (divtsud)
GAMMA_FPI (addssuic)
GAMMA_FPI (subssuic)
GAMMA_FPI (mulssuic)
GAMMA_FPI (divssuic)
GAMMA_FPI (addtsuic)
GAMMA_FPI (subtsuic)
GAMMA_FPI (multsuic)
GAMMA_FPI (divtsuic)
GAMMA_FPI (addssuim)
GAMMA_FPI (subssuim)
GAMMA_FPI (mulssuim)
GAMMA_FPI (divssuim)
GAMMA_FPI (addtsuim)
GAMMA_FPI (subtsuim)
GAMMA_FPI (multsuim)
GAMMA_FPI (divtsuim)
GAMMA_FPI (addssui)
GAMMA_FPI (subssui)
GAMMA_FPI (mulssui)
GAMMA_FPI (divssui)
GAMMA_FPI (addtsui)
GAMMA_FPI (subtsui)
GAMMA_FPI (multsui)
GAMMA_FPI (divtsui)
GAMMA_FPI (addssuid)
GAMMA_FPI (subssuid)
GAMMA_FPI (mulssuid)
GAMMA_FPI (divssuid)
GAMMA_FPI (addtsuid)
GAMMA_FPI (subtsuid)
GAMMA_FPI (multsuid)
GAMMA_FPI (divtsuid)
GAMMA_FPL (cpys)
GAMMA_FPL (cpysn)
GAMMA_FPL (cpyse)

GAMMA_FPL_C(fcmoveq)
GAMMA_FPL_C(fcmovne)
GAMMA_FPL_C(fcmovlt)
GAMMA_FPL_C(fcmovge)
GAMMA_FPL_C(fcmovle)
GAMMA_FPL_C(fcmovgt)


#ifdef later_vms
FP_CVT (cvtdgc)
FP_CVT (cvtgfc)
FP_CVT (cvtgdc)
FP_CVT (cvtgqc)
FP_CVT (cvtqfc)
FP_CVT (cvtqgc)
FP_CVT (cvtdg)
FP_CVT (cvtgf)
FP_CVT (cvtgd)
FP_CVT (cvtgq)
FP_CVT (cvtqf)
FP_CVT (cvtqg)
FP_CVT (cvtdguc)
FP_CVT (cvtgfuc)
FP_CVT (cvtgduc)
FP_CVT (cvtgqvc)
FP_CVT (cvtdgu)
xFP_CVT (cvtgfu)
FP_CVT (cvtgdu)
FP_CVT (cvtgqv)
FP_CVT (cvtdgsc)
FP_CVT (cvtgfsc)
FP_CVT (cvtgdsc)
FP_CVT (cvtgqsc)
FP_CVT (cvtdgs)
FP_CVT (cvtgfs)
FP_CVT (cvtgds)
FP_CVT (cvtgqs)
FP_CVT (cvtdgsuc)
FP_CVT (cvtgfsuc)
FP_CVT (cvtgdsuc)
FP_CVT (cvtgqsvc)
FP_CVT (cvtdgsu)
FP_CVT (cvtgfsu)
FP_CVT (cvtgdsu)
FP_CVT (cvtgqsv)

#endif /*later_vax */
GAMMA_CVTI (cvttsc)
GAMMA_CVTI (cvttqc)
GAMMA_CVTI (cvtqsc)
GAMMA_CVTI (cvtqtc)
GAMMA_CVTI (cvttsm)
GAMMA_CVTI (cvttqm)
GAMMA_CVTI (cvtqsm)
GAMMA_CVTI (cvtqtm)
GAMMA_CVTI (cvtts)
GAMMA_CVTI (cvttq)
GAMMA_CVTI (cvtqs)
GAMMA_CVTI (cvtqt)
GAMMA_CVTI (cvttsd)
GAMMA_CVTI (cvttqd)
GAMMA_CVTI (cvtqsd)
GAMMA_CVTI (cvtqtd)
GAMMA_CVTI (cvttsuc)
GAMMA_CVTI (cvttqvc)
GAMMA_CVTI (cvttsum)
GAMMA_CVTI (cvttqvm)
GAMMA_CVTI (cvttsu)
GAMMA_CVTI (cvttqv)
GAMMA_CVTI (cvttsud)
GAMMA_CVTI (cvttqvd)
GAMMA_CVTI (cvtst)
GAMMA_CVTI (cvtsts)
GAMMA_CVTI (cvttssuc)
GAMMA_CVTI (cvttqsvc)
GAMMA_CVTI (cvttssum)
GAMMA_CVTI (cvttqsvm)
GAMMA_CVTI (cvttssu)
GAMMA_CVTI (cvttqsv)
GAMMA_CVTI (cvttssud)
GAMMA_CVTI (cvttqsvd)
/* GAMMA_CVTI(cvttss) - gcc claims no such operation */
GAMMA_CVTI (cvttssuic)
GAMMA_CVTI (cvttqsvic)
GAMMA_CVTI (cvtqssuic)
GAMMA_CVTI (cvtqtsuic)
GAMMA_CVTI (cvttssuim)
GAMMA_CVTI (cvttqsvim)
GAMMA_CVTI (cvtqssuim)
GAMMA_CVTI (cvtqtsuim)
GAMMA_CVTI (cvttssui)
GAMMA_CVTI (cvttqsvi)
GAMMA_CVTI (cvtqssui)
GAMMA_CVTI (cvtqtsui)
GAMMA_CVTI (cvttssuid)
GAMMA_CVTI (cvttqsvid)
GAMMA_CVTI (cvtqssuid)
GAMMA_CVTI (cvtqtsuid)

GAMMA_CVTL (cvtlq)
GAMMA_CVTL (cvtql)
GAMMA_CVTL (cvtqlv)
GAMMA_CVTL (cvtqlsv)


#define GAMMA_EMPTY_OPC14(NAME) GAMMA_EMPTY_FP_OPER(op_opc14,opc14_ ##NAME,NAME)

GAMMA_EMPTY_OPC14(sqrttc)
GAMMA_EMPTY_OPC14(sqrttm)
GAMMA_COMPLEX_FP(opc14,sqrtt)
GAMMA_EMPTY_OPC14(sqrttd)
GAMMA_EMPTY_OPC14(sqrttuc)
GAMMA_EMPTY_OPC14(sqrttum)
GAMMA_EMPTY_OPC14(sqrttu)
GAMMA_EMPTY_OPC14(sqrttud)
GAMMA_EMPTY_OPC14(sqrttsuc)
GAMMA_EMPTY_OPC14(sqrttsum)
GAMMA_EMPTY_OPC14(sqrttsu)
GAMMA_EMPTY_OPC14(sqrttsud)
GAMMA_EMPTY_OPC14(sqrttsuic)
GAMMA_EMPTY_OPC14(sqrttsuim)
GAMMA_EMPTY_OPC14(sqrttsui)
GAMMA_EMPTY_OPC14(sqrttsuid)

GAMMA_EMPTY_OPC14(sqrtsc)
GAMMA_EMPTY_OPC14(sqrtsm)
GAMMA_COMPLEX_FP(opc14,sqrts)
GAMMA_EMPTY_OPC14(sqrtsd)
GAMMA_EMPTY_OPC14(sqrtsuc)
GAMMA_EMPTY_OPC14(sqrtsum)
GAMMA_EMPTY_OPC14(sqrtsu)
GAMMA_EMPTY_OPC14(sqrtsud)
GAMMA_EMPTY_OPC14(sqrtssuc)
GAMMA_EMPTY_OPC14(sqrtssum)
GAMMA_EMPTY_OPC14(sqrtssu)
GAMMA_EMPTY_OPC14(sqrtssud)
GAMMA_EMPTY_OPC14(sqrtssuic)
GAMMA_EMPTY_OPC14(sqrtssuim)
GAMMA_EMPTY_OPC14(sqrtssui)
GAMMA_EMPTY_OPC14(sqrtssuid)


GAMMA_COMPLEX_FP(opc14,itofs)
GAMMA_COMPLEX_FP(opc14,itoff)
GAMMA_COMPLEX_FP(opc14,itoft)