#if 0
#endif
case LDA:   {
    WRITE_DEST(SOURCE2 + OFFSET);
  }
  break;

case LDAH:   {
    WRITE_DEST(SOURCE2 + OFFSET);
  }
  break;

case LDBU:   {
    byte_t _result;
    _result = MEMORY_READ;
    WRITE_DEST((uquad_t)_result);
  }
  break;

case LDQ_U:   {
    uquad_t _result;
    _result = MEMORY_READ;
    WRITE_DEST(_result);
  }
  break;

case LDWU:   {
    half_t _result;
    _result = MEMORY_READ;
    WRITE_DEST((uquad_t)_result);
  }
  break;

case STW:   {
    MEMORY_WRITE(SOURCE2);
  }
  break;

case STB:   {
    MEMORY_WRITE(SOURCE2);
  }
  break;

case STQ_U:   {
    MEMORY_WRITE(SOURCE2);
  }
  break;

case FLTV:   {
    /* FIXME: unimplemented */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

#ifdef PAL
case PAL19: 	 {
		WRITE_DEST(MFPR(OFFSET));
	 }
  break;

#endif PAL
#ifdef PAL
case PAL1B: 	 {
		uquad_t _result;
		_result = MEMORY_READ;
		WRITE_DEST(_result);
	 }
  break;

#endif PAL
#ifdef PAL
case PAL1D: 	 {
	  MTPR(OFFSET, SOURCE1);
	 }
  break;

case PAL1E: 	 {
		SET_NPC(MFPR(excAddr));
	 }
  break;

#endif PAL
case LDF:   {
    /* FIXME: unimplemented */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

case LDG:   {
    /* FIXME: unimplemented */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

case LDS:   {
    squad_t _longhold, _e1, _e2;
    _longhold = MEMORY_READ;
    _e1 = _longhold & 0x40000000;
    _e2 = (_longhold >> 23) & ULL(0x7f);
    if (_e1)
      {
	if (_e2 == ULL(0x3f800000))
	  _e2 = ULL(0x7ff);
	else
	  _e2 |= ULL(0x400);
      }
    else
      {
	if (_e2 == 0)
	  _e2 = 0;
	else
	  _e2 |= ULL(0x380);
      }
    WRITE_DEST(((_longhold & ULL(0x80000000)) << 32
		   | _e2 << 52 | (_longhold & ULL(0x7fffff)) << 29));
  }
  break;

case LDT:   {
    uquad_t _result;
    _result = MEMORY_READ;
    WRITE_DEST(_result);
  }
  break;

case STF:   {
    /* FIXME: unimplemented */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

case STG:   {
    /* FIXME: unimplemented */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

case STS:   {
    squad_t _longhold;
    sword_t _inthold;
    _longhold = SOURCE2;
    _inthold = (((_longhold >> 32) & ULL(0xc0000000))
		| ((_longhold >> 29) & ULL(0x3fffffff)));
    MEMORY_WRITE(_inthold);
  }
  break;

case STT:   {
    MEMORY_WRITE(SOURCE2);
  }
  break;

case LDL:   {
    word_t _result;
    _result = MEMORY_READ;
    WRITE_DEST((squad_t)((sword_t)_result));
  }
  break;

case LDQ:   {
    uquad_t _result;
    _result = MEMORY_READ;
    WRITE_DEST(_result);
  }
  break;

case LDL_L:   {
    word_t _result;
    _result = MEMORY_READ;
    LOCK(SOURCE2 + OFFSET);
    WRITE_DEST((squad_t)((sword_t)_result));
  }
  break;

case LDQ_L:   {
    uquad_t _result;
    _result = MEMORY_READ;
    LOCK(SOURCE2 + OFFSET);
    WRITE_DEST(_result);
  }
  break;

case STL:   {
    word_t _src;
    _src = (word_t)(SOURCE2 & ULL(0xffffffff));
    MEMORY_WRITE(_src);
  }
  break;

case STQ:   {
    MEMORY_WRITE(SOURCE2);
  }
  break;

case STL_C:   {
    word_t _src;
    _src = (word_t)(SOURCE2 & ULL(0xffffffff));
    if (LOCK_ACTIVE(SOURCE2 + OFFSET)) {
      MEMORY_WRITE(_src);
    } else {
    }
  }
  break;

case STQ_C:   {
    if (LOCK_ACTIVE(SOURCE2 + OFFSET)) {
      MEMORY_WRITE(SOURCE2);
    } else {
    }
  }
  break;

case BR:   {
    LINK;
    SET_NPC(OFFSET);
  }
  break;

case FBEQ:   {
    if (SOURCE1_F == 0.0)
      SET_NPC(OFFSET);
  }
  break;

case FBLT:   {
    if (SOURCE1_F < 0.0)
      SET_NPC(OFFSET);
  }
  break;

case FBLE:   {
    if (SOURCE1_F <= 0.0)
      SET_NPC(OFFSET);
  }
  break;

case BSR:   {
    LINK;
    SET_NPC(OFFSET);
  }
  break;

case FBNE:   {
    if (SOURCE1_F != 0.0)
      SET_NPC(OFFSET);
  }
  break;

case FBGE:   {
    if (SOURCE1_F >= 0.0)
      SET_NPC(OFFSET);
  }
  break;

case FBGT:   {
    if (SOURCE1_F > 0.0)
      SET_NPC(OFFSET);
  }
  break;

case BLBC:   {
    if (!(SOURCE1 & 1))
      SET_NPC(OFFSET);
  }
  break;

case BEQ:   {
    if (SOURCE1 == ULL(0))
      SET_NPC(OFFSET);
  }
  break;

case BLT:   {
    if ((squad_t)SOURCE1 < LL(0))
      SET_NPC(OFFSET);
  }
  break;

case BLE:   {
    if ((squad_t)SOURCE1 <= LL(0))
      SET_NPC(OFFSET);
  }
  break;

case BLBS:   {
    if (SOURCE1 & 1)
      SET_NPC(OFFSET);
  }
  break;

case BNE:   {
    if (SOURCE1 != ULL(0))
      SET_NPC(OFFSET);
  }
  break;

case BGE:   {
    if ((squad_t)SOURCE1 >= LL(0))
      SET_NPC(OFFSET);
  }
  break;

case BGT:   {
    if ((squad_t)SOURCE1 > LL(0))
      SET_NPC(OFFSET);
  }
  break;

case PAL_CALLSYS:   {
    _SYSCALL_
  }
  break;

case PAL_RDUNIQ:   {
  WRITE_DEST(SOURCE1);
  }
  break;

case PAL_WRUNIQ:   {
  WRITE_DEST(SOURCE1);
  }
  break;

case ADDL:   {
    WRITE_DEST(SEXT32((SOURCE1 + SOURCE2) & ULL(0xffffffff)));
  }
  break;

case ADDLI:   {
    WRITE_DEST(SEXT32((SOURCE1 + OFFSET) & ULL(0xffffffff)));
  }
  break;

case S4ADDL:   {
    WRITE_DEST(SEXT32(((SOURCE1 << 2) + SOURCE2) & ULL(0xffffffff)));
  }
  break;

case S4ADDLI:   {
    WRITE_DEST(SEXT32(((SOURCE1 << 2) + OFFSET) & ULL(0xffffffff)));
  }
  break;

case SUBL:   {
    WRITE_DEST(SEXT32((SOURCE1 - SOURCE2) & ULL(0xffffffff)));
  }
  break;

case SUBLI:   {
    WRITE_DEST(SEXT32((SOURCE1 - OFFSET) & ULL(0xffffffff)));
  }
  break;

case S4SUBL:   {
    WRITE_DEST(SEXT32(((SOURCE1 << 2) - SOURCE2) & ULL(0xffffffff)));
  }
  break;

case S4SUBLI:   {
    WRITE_DEST(SEXT32(((SOURCE1 << 2) - OFFSET) & ULL(0xffffffff)));
  }
  break;

case CMPBGE:   {
    int _i;
    uquad_t _rav, _rbv, temp = 0;
    _rav = SOURCE1;
    _rbv = SOURCE2;
    for (_i = 56; _i >= 0; _i -= 8)
      {
	temp = temp << 1;
	temp = temp | ((_rav >> _i & (squad_t)0xff) >=
			(_rbv >> _i & (squad_t)0xff));
      }
   WRITE_DEST(temp);
  }
  break;

case CMPBGEI:   {
    int _i;
    uquad_t _rav, _rbv, temp = 0;
    _rav = SOURCE1;
    _rbv = OFFSET;
    for (_i = 56; _i >= 0; _i -= 8)
      {
	temp = temp << 1;
	temp = temp | ((_rav >> _i & (squad_t)0xff) >=
			(_rbv >> _i & (squad_t)0xff));
      }
   WRITE_DEST(temp);
  }
  break;

case S8ADDL:   {
    WRITE_DEST(SEXT32(((SOURCE1 << 3) + SOURCE2) & ULL(0xffffffff)));
  }
  break;

case S8ADDLI:   {
    WRITE_DEST(SEXT32(((SOURCE1 << 3) + OFFSET) & ULL(0xffffffff)));
  }
  break;

case S8SUBL:   {
    WRITE_DEST(SEXT32(((SOURCE1 << 3) - SOURCE2) & ULL(0xffffffff)));
  }
  break;

case S8SUBLI:   {
    WRITE_DEST(SEXT32(((SOURCE1 << 3) - OFFSET) & ULL(0xffffffff)));
  }
  break;

case CMPULT:   {
    WRITE_DEST((uquad_t)SOURCE1 < (uquad_t)SOURCE2);
  }
  break;

case CMPULTI:   {
    WRITE_DEST((uquad_t)SOURCE1 < (uquad_t)OFFSET);
  }
  break;

case ADDQ:   {
    WRITE_DEST(SOURCE1 + SOURCE2);
  }
  break;

case ADDQI:   {
    WRITE_DEST(SOURCE1 + OFFSET);
  }
  break;

case S4ADDQ:   {
    WRITE_DEST((SOURCE1 << 2) + SOURCE2);
  }
  break;

case S4ADDQI:   {
    WRITE_DEST((SOURCE1 << 2) + OFFSET);
  }
  break;

case SUBQ:   {
    WRITE_DEST(SOURCE1 - SOURCE2);
  }
  break;

case SUBQI:   {
    WRITE_DEST(SOURCE1 - OFFSET);
  }
  break;

case S4SUBQ:   {
    WRITE_DEST((SOURCE1 << 2) - SOURCE2);
  }
  break;

case S4SUBQI:   {
    WRITE_DEST((SOURCE1 << 2) - OFFSET);
  }
  break;

case CMPEQ:   {
    WRITE_DEST(SOURCE1 == SOURCE2);
  }
  break;

case CMPEQI:   {
    WRITE_DEST(SOURCE1 == (uquad_t)OFFSET);
  }
  break;

case S8ADDQ:   {
    WRITE_DEST((SOURCE1 << 3) + SOURCE2);
  }
  break;

case S8ADDQI:   {
    WRITE_DEST((SOURCE1 << 3) + OFFSET);
  }
  break;

case S8SUBQ:   {
    WRITE_DEST((SOURCE1 << 3) - SOURCE2);
  }
  break;

case S8SUBQI:   {
    WRITE_DEST((SOURCE1 << 3) - OFFSET);
  }
  break;

case CMPULE:   {
    WRITE_DEST((uquad_t)SOURCE1 <= (uquad_t)SOURCE2);
  }
  break;

case CMPULEI:   {
    WRITE_DEST((uquad_t)SOURCE1 <= (uquad_t)OFFSET);
  }
  break;

case ADDLV:   {
    /* FIXME: not checking for overflows... */
    WRITE_DEST(SEXT32((SOURCE1 + SOURCE2) & ULL(0xffffffff)));
  }
  break;

case ADDLVI:   {
    /* FIXME: not checking for overflows... */
    WRITE_DEST(SEXT32((SOURCE1 + OFFSET) & ULL(0xffffffff)));
  }
  break;

case SUBLV:   {
    WRITE_DEST(SEXT32((SOURCE1 - SOURCE2) & ULL(0xffffffff)));
  }
  break;

case SUBLVI:   {
    WRITE_DEST(SEXT32((SOURCE1 - OFFSET) & ULL(0xffffffff)));
  }
  break;

case CMPLT:   {
    WRITE_DEST((squad_t)SOURCE1 < (squad_t)SOURCE2);
  }
  break;

case CMPLTI:   {
    WRITE_DEST((squad_t)SOURCE1 < (squad_t)OFFSET);
  }
  break;

case ADDQV:   {
    /* FIXME: not checking for overflows... */
    WRITE_DEST(SOURCE1 + SOURCE2);
  }
  break;

case ADDQVI:   {
    /* FIXME: not checking for overflows... */
    WRITE_DEST(SOURCE1 + OFFSET);
  }
  break;

case SUBQV:   {
    /* FIXME: not checking for overflows... */
    WRITE_DEST(SOURCE1 - SOURCE2);
  }
  break;

case SUBQVI:   {
    /* FIXME: not checking for overflows... */
    WRITE_DEST(SOURCE1 - OFFSET);
  }
  break;

case CMPLE:   {
    WRITE_DEST((squad_t)SOURCE1 <= (squad_t)SOURCE2);
  }
  break;

case CMPLEI:   {
    WRITE_DEST((squad_t)SOURCE1 <= (squad_t)OFFSET);
  }
  break;

case IMPLVER:   {
    WRITE_DEST(ULL(2));
  }
  break;

case AND:   {
    uquad_t regA = SOURCE1;
    uquad_t regB = SOURCE2;
    WRITE_DEST(regA & regB);
  }
  break;

case ANDI:   {
    WRITE_DEST(SOURCE1 & OFFSET);
  }
  break;

case BIC:   {
    WRITE_DEST(SOURCE1 & ~SOURCE2);
  }
  break;

case BICI:   {
    WRITE_DEST(SOURCE1 & ~OFFSET);
  }
  break;

case CMOVLBS:   {
    if (SOURCE1 & 1)
      WRITE_DEST(SOURCE2);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVLBSI:   {
    if (SOURCE1 & 1)
      WRITE_DEST(OFFSET);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVLBC:   {
    if ((SOURCE1 & 1) == 0)
      WRITE_DEST(SOURCE2);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVLBCI:   {
    if ((SOURCE1 & 1) == 0)
      WRITE_DEST(OFFSET);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case BIS:   {
    uquad_t regA = SOURCE1;
    uquad_t regB = SOURCE2;
    WRITE_DEST(regA | regB);
  }
  break;

case BISI:   {
    WRITE_DEST(SOURCE1 | OFFSET);
  }
  break;

case CMOVEQ:   {
    if (SOURCE1 == 0)
      WRITE_DEST(SOURCE2);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVEQI:   {
    if (SOURCE1 == 0)
      WRITE_DEST(OFFSET);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVNE:   {
    if (SOURCE1 != 0)
      WRITE_DEST(SOURCE2);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVNEI:   {
    if (SOURCE1 != 0)
      WRITE_DEST(OFFSET);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case ORNOT:   {
    WRITE_DEST(SOURCE1 | ~SOURCE2);
  }
  break;

case ORNOTI:   {
    WRITE_DEST(SOURCE1 | ~OFFSET);
  }
  break;

case XOR:   {
    uquad_t regA = SOURCE1;
    uquad_t regB = SOURCE2;
    WRITE_DEST(regA ^ regB);
  }
  break;

case XORI:   {
    WRITE_DEST(SOURCE1 ^ OFFSET);
  }
  break;

case CMOVLT:   {
    if ((squad_t)SOURCE1 < LL(0))
      WRITE_DEST(SOURCE2);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVLTI:   {
    if ((squad_t)SOURCE1 < LL(0))
      WRITE_DEST(OFFSET);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVGE:   {
    if ((squad_t)SOURCE1 >= LL(0))
      WRITE_DEST(SOURCE2);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVGEI:   {
    if ((squad_t)SOURCE1 >= LL(0))
      WRITE_DEST(OFFSET);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case EQV:   {
    WRITE_DEST(SOURCE1 ^ ~SOURCE2);
  }
  break;

case EQVI:   {
    WRITE_DEST(SOURCE1 ^ ~OFFSET);
  }
  break;

case AMASK:   {
    WRITE_DEST(SOURCE2 & ULL(0xfffffffffffffef8) );
  }
  break;

case AMASKI:   {
    WRITE_DEST(OFFSET & ULL(0xfffffffffffffef8) );
  }
  break;

case CMOVLE:   {
    if ((squad_t)SOURCE1 <= LL(0))
      WRITE_DEST(SOURCE2);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVLEI:   {
    if ((squad_t)SOURCE1 <= LL(0))
      WRITE_DEST(OFFSET);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVGT:   {
    if ((squad_t)SOURCE1 > LL(0))
      WRITE_DEST(SOURCE2);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case CMOVGTI:   {
    if ((squad_t)SOURCE1 > LL(0))
      WRITE_DEST(OFFSET);
  else
    WRITE_DEST(OLD_DEST);
  }
  break;

case MSKBL:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xff) << ((SOURCE2 & 0x7) * 8)));
  }
  break;

case MSKBLI:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xff) << ((OFFSET & 0x7) * 8)));
  }
  break;

case EXTBL:   {
    WRITE_DEST((SOURCE1 >> ((SOURCE2 & 0x7) * 8)) & LL(0xff));
  }
  break;

case EXTBLI:   {
    WRITE_DEST((SOURCE1 >> ((OFFSET & 0x7) * 8)) & LL(0xff));
  }
  break;

case INSBL:   {
    WRITE_DEST(((SOURCE1 << ((SOURCE2 & 0x7) * 8))
		     & (ULL(0xff) << ((SOURCE2 & 0x7) * 8))));
  }
  break;

case INSBLI:   {
    WRITE_DEST(((SOURCE1 << ((OFFSET & 0x7) * 8))
		     & (ULL(0xff) << ((OFFSET & 0x7) * 8))));
  }
  break;

case MSKWL:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xffff) << ((SOURCE2 & 0x7) * 8)));
  }
  break;

case MSKWLI:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xffff) << ((OFFSET & 0x7) * 8)));
  }
  break;

case EXTWL:   {
    WRITE_DEST((SOURCE1 >> ((SOURCE2 & 0x7) * 8)) & LL(0xffff));
  }
  break;

case EXTWLI:   {
    WRITE_DEST((SOURCE1 >> ((OFFSET & 0x7) * 8)) & LL(0xffff));
  }
  break;

case INSWL:   {
    WRITE_DEST(((SOURCE1 << ((SOURCE2 & 0x7) * 8))
		     & (ULL(0xffff) << ((SOURCE2 & 0x7) * 8))));
  }
  break;

case INSWLI:   {
    WRITE_DEST(((SOURCE1 << ((OFFSET & 0x7) * 8))
		     & (ULL(0xffff) << ((OFFSET & 0x7) * 8))));
  }
  break;

case MSKLL:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xffffffff) << ((SOURCE2 & 0x7) * 8)));
  }
  break;

case MSKLLI:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xffffffff) << ((OFFSET & 0x7) * 8)));
  }
  break;

case EXTLL:   {
    WRITE_DEST((SOURCE1 >> ((SOURCE2 & 0x7) * 8)) & LL(0xffffffff));
  }
  break;

case EXTLLI:   {
    WRITE_DEST((SOURCE1 >> ((OFFSET & 0x7) * 8)) & LL(0xffffffff));
  }
  break;

case INSLL:   {
    WRITE_DEST(((SOURCE1 << ((SOURCE2 & 0x7) * 8))
		     & (ULL(0xffffffff) << ((SOURCE2 & 0x7) * 8))));
  }
  break;

case INSLLI:   {
    WRITE_DEST(((SOURCE1 << ((OFFSET & 0x7) * 8))
		     & (ULL(0xffffffff) << ((OFFSET & 0x7) * 8))));
  }
  break;

case ZAP:   {
    int _i;
    uquad_t _temp = LL(0xff);
    uquad_t _rav = SOURCE1;
    uquad_t _rbv = SOURCE2;
    uquad_t temp_rcv = 0;
    for (_i = 1; _i < 0x100; _i = _i << 1)
      {
	if (_i & ~_rbv)
	  temp_rcv |= (_rav & _temp);
	_temp = _temp << 8;
      }
   WRITE_DEST(temp_rcv);
  }
  break;

case ZAPI:   {
    int _i;
    uquad_t _temp = LL(0xff);
    uquad_t _rav = SOURCE1;
    uquad_t _rbv = OFFSET;
    uquad_t temp_rcv = 0;
    for (_i = 1; _i < 0x100; _i = _i << 1)
      {
	if (_i & ~_rbv)
	  temp_rcv |= (_rav & _temp);
	_temp = _temp << 8;
      }
   WRITE_DEST(temp_rcv);
  }
  break;

case ZAPNOT:   {
    int _i;
    uquad_t _temp = LL(0xff);
    uquad_t _rav = SOURCE1;
    uquad_t _rbv = SOURCE2;
    uquad_t temp_rcv = 0;
    for (_i = 1; _i < 0x100; _i = _i << 1)
      {
	if (_i & _rbv)
	  temp_rcv |=  (_rav & _temp);
	_temp = _temp << 8;
      }
   WRITE_DEST(temp_rcv);
  }
  break;

case ZAPNOTI:   {
    int _i;
    uquad_t _temp = LL(0xff);
    uquad_t _rav = SOURCE1;
    uquad_t _rbv = OFFSET;
    uquad_t temp_rcv = 0;
    for (_i = 1; _i < 0x100; _i = _i << 1)
      {
	if (_i & _rbv)
	  temp_rcv |= (_rav & _temp);
	_temp = _temp << 8;
      }
   WRITE_DEST(temp_rcv);
  }
  break;

case MSKQL:   {
    WRITE_DEST((SOURCE1
		 & ~(ULL(0xffffffffffffffff)
		     << ((SOURCE2 & 0x7) * 8))));
  }
  break;

case MSKQLI:   {
    WRITE_DEST((SOURCE1
		 & ~(ULL(0xffffffffffffffff) << ((OFFSET & 0x7) * 8))));
  }
  break;

case SRL:   {
    WRITE_DEST(SOURCE1 >> (SOURCE2 & 0x3f));
  }
  break;

case SRLI:   {
    WRITE_DEST(SOURCE1 >> (OFFSET & 0x3f));
  }
  break;

case EXTQL:   {
    WRITE_DEST(SOURCE1 >> ((SOURCE2 & 0x7) * 8));
  }
  break;

case EXTQLI:   {
    WRITE_DEST(SOURCE1 >> ((OFFSET & 0x7) * 8));
  }
  break;

case SLL:   {
    WRITE_DEST(SOURCE1 << (SOURCE2 & 0x3f));
  }
  break;

case SLLI:   {
    WRITE_DEST(SOURCE1 << (OFFSET & 0x3f));
  }
  break;

case INSQL:   {
    WRITE_DEST(((SOURCE1 << ((SOURCE2 & 0x7) * 8))
		 & (ULL(0xffffffffffffffff) << ((SOURCE2 & 0x7) * 8))));
  }
  break;

case INSQLI:   {
    WRITE_DEST(((SOURCE1 << ((OFFSET & 0x7) * 8))
		 & (ULL(0xffffffffffffffff) << ((OFFSET & 0x7) * 8))));
  }
  break;

case SRA:   {
    WRITE_DEST((squad_t)SOURCE1 >> (SOURCE2 & 0x3f));
  }
  break;

case SRAI:   {
    WRITE_DEST((squad_t)SOURCE1 >> (OFFSET & 0x3f));
  }
  break;

case MSKWH:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xffff) >> ((8 - (SOURCE2 & 0x7)) * 8)));
  }
  break;

case MSKWHI:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xffff) >> ((8 - (OFFSET & 0x7)) * 8)));
  }
  break;

case INSWH:   {
    WRITE_DEST(((SOURCE1 >> (63 - (SOURCE2 & 0x7) * 8)) >> 1
		 & (ULL(0xffff) >> ((8 - (SOURCE2 & 0x7)) * 8))));
  }
  break;

case INSWHI:   {
    WRITE_DEST(((SOURCE1 >> (63 - (OFFSET & 0x7) * 8)) >> 1
		 & (ULL(0xffff) >> ((8 - (OFFSET & 0x7)) * 8))));
  }
  break;

case EXTWH:   {
    WRITE_DEST((SOURCE1 << ((64 - (SOURCE2 & 0x7) * 8) & 0x3f)) & LL(0xffff));
  }
  break;

case EXTWHI:   {
    WRITE_DEST((SOURCE1 << ((64 - (OFFSET & 0x7) * 8) & 0x3f)) & LL(0xffff));
  }
  break;

case MSKLH:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xffffffff) >>
			    ((8 - (SOURCE2 & 0x7)) * 8)));
  }
  break;

case MSKLHI:   {
    WRITE_DEST(SOURCE1 & ~(ULL(0xffffffff) >>
			    ((8 - (OFFSET & 0x7)) * 8)));
  }
  break;

case INSLH:   {
    WRITE_DEST(((SOURCE1 >> (63 - (SOURCE2 & 0x7) * 8)) >> 1
		 & (ULL(0xffffffff) >> ((8 - (SOURCE2 & 0x7)) * 8))));
  }
  break;

case INSLHI:   {
    WRITE_DEST(((SOURCE1 >> (63 - (OFFSET & 0x7) * 8)) >> 1
		 & (ULL(0xffffffff) >> ((8 - (OFFSET & 0x7)) * 8))));
  }
  break;

case EXTLH:   {
    WRITE_DEST((SOURCE1 <<
		 ((64 - (SOURCE2 & 0x7) * 8) & 0x3f)) & LL(0xffffffff));
  }
  break;

case EXTLHI:   {
    WRITE_DEST((SOURCE1 << ((64 - (OFFSET & 0x7) * 8) & 0x3f)) & LL(0xffffffff));
  }
  break;

case MSKQH:   {
    WRITE_DEST((SOURCE1 & ~(ULL(0xffffffffffffffff)
			     >> ((8 - (SOURCE2 & 0x7)) * 8))));
  }
  break;

case MSKQHI:   {
    WRITE_DEST((SOURCE1 & ~(ULL(0xffffffffffffffff)
			     >> ((8 - (OFFSET & 0x7)) * 8))));
  }
  break;

case INSQH:   {
    WRITE_DEST(((SOURCE1 >> (63 - (SOURCE2 & 0x7) * 8)) >> 1
		 & (ULL(0xffffffffffffffff)
		    >> ((8 - (SOURCE2 & 0x7)) * 8))));
  }
  break;

case INSQHI:   {
    WRITE_DEST(((SOURCE1 >> (63 - (OFFSET & 0x7) * 8)) >> 1
		 & (ULL(0xffffffffffffffff)
		    >> ((8 - (OFFSET & 0x7)) * 8))));
  }
  break;

case EXTQH:   {
    WRITE_DEST((SOURCE1 << ((64 - (SOURCE2 & 0x7) * 8) & 0x3f)));
  }
  break;

case EXTQHI:   {
    WRITE_DEST((SOURCE1 << ((64 - (OFFSET & 0x7) * 8) & 0x3f)));
  }
  break;

case MULL:   {
    WRITE_DEST(SEXT32((SOURCE1 * SOURCE2) & ULL(0xffffffff)));
  }
  break;

case MULLI:   {
    WRITE_DEST(SEXT32((SOURCE1 * OFFSET) & ULL(0xffffffff)));
  }
  break;

case MULQ:   {
    WRITE_DEST(SOURCE1 * SOURCE2);
  }
  break;

case MULQI:   {
    WRITE_DEST(SOURCE1 * OFFSET);
  }
  break;

case UMULH:   {
    squad_t _v1 = SOURCE1;
    squad_t _v2 = SOURCE2;
    uquad_t _result;
    uquad_t _a, _b, _c, _d;
    uquad_t _bd, _ad, _cb, _ac;
    uquad_t _mid, _mid2, _carry_mid = 0;
    _a = (_v1 >> 32) & LL(0xffffffff);
    _b = _v1 & LL(0xffffffff);
    _c = (_v2 >> 32) & LL(0xffffffff);
    _d = _v2 & LL(0xffffffff);
    _bd = _b * _d;
    _ad = _a * _d;
    _cb = _c * _b;
    _ac = _a * _c;
    _mid = _ad + _cb;
    if (ARITH_OVFL(_mid, _ad, _cb))
      _carry_mid = 1;
    _mid2 = _mid + ((_bd >> 32) & LL(0xffffffff));
    if (ARITH_OVFL(_mid2, _mid, ((_bd >> 32) & LL(0xffffffff))))
      _carry_mid += 1;
    _result =
      _ac + (_carry_mid << 32) + ((_mid2 >> 32) & LL(0xffffffff));
    WRITE_DEST(_result);
  }
  break;

case UMULHI:   {
    squad_t _v1 = SOURCE1;
    squad_t _v2 = OFFSET;
    uquad_t _result;
    uquad_t _a, _b, _c, _d;
    uquad_t _bd, _ad, _cb, _ac;
    uquad_t _mid, _mid2, _carry_mid = 0;
    _a = (_v1 >> 32) & LL(0xffffffff);
    _b = _v1 & LL(0xffffffff);
    _c = (_v2 >> 32) & LL(0xffffffff);
    _d = _v2 & LL(0xffffffff);
    _bd = _b * _d;
    _ad = _a * _d;
    _cb = _c * _b;
    _ac = _a * _c;
    _mid = _ad + _cb;
    if (ARITH_OVFL(_mid, _ad, _cb))
      _carry_mid = 1;
    _mid2 = _mid + ((_bd >> 32) & LL(0xffffffff));
    if (ARITH_OVFL(_mid2, _mid, ((_bd >> 32) & LL(0xffffffff))))
      _carry_mid += 1;
    _result =
      _ac + (_carry_mid << 32) + ((_mid2 >> 32) & LL(0xffffffff));
    WRITE_DEST(_result);
  }
  break;

case ITOFS:   {
    squad_t _longhold, _e1, _e2;
    _longhold = SOURCE1 & ULL(0xffffffff);
    _e1 = _longhold & 0x40000000;
    _e2 = (_longhold >> 23) & ULL(0x7f);
    if (_e1)
      {
	if (_e2 == ULL(0x3f800000))
	  _e2 = ULL(0x7ff);
	else
	  _e2 |= ULL(0x400);
      }
    else
      {
	if (_e2 == 0)
	  _e2 = 0;
	else
	  _e2 |= ULL(0x380);
      }
    WRITE_DEST((((_longhold & ULL(0x80000000)) << 32)
		   | (_e2 << 52) | ((_longhold & ULL(0x7fffff)) << 29)));
  }
  break;

case SQRTF:   {
    /* FIXME: unimplemented */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

case SQRTS:   {
     if( SOURCE2_F < 0.0 )
       ASSERT_FAULT( md_fault_invalid );
   /* -- FIXME: too much precision here */
     WRITE_DEST_F((dfloat_t) sqrt( (double) SOURCE2_F) );
  }
  break;

case ITOFF:   {
    /* FIXME: unimplemented */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

case ITOFT:   {
    WRITE_DEST(SOURCE1);
  }
  break;

case SQRTG:   {
    /* FIXME: unimplemented */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

case SQRTT:   {
     if( SOURCE2_F < 0.0 )
       ASSERT_FAULT( md_fault_invalid );
     WRITE_DEST_F((dfloat_t) sqrt( (double) SOURCE2_F) );
  }
  break;

case ADDS:   {
    /* FIXME: too much precision here... */
    WRITE_DEST_F(SOURCE1_F + SOURCE2_F);
  }
  break;

case SUBS:   {
    /* FIXME: too much precision here... */
    WRITE_DEST_F(SOURCE1_F - SOURCE2_F);
  }
  break;

case MULS:   {
    /* FIXME: too much precision here... */
    WRITE_DEST_F(SOURCE1_F * SOURCE2_F);
  }
  break;

case DIVS:   {
    if (SOURCE2_F == 0.0)
      ASSERT_FAULT(md_fault_div0);
    /* FIXME: too much precision here... */
    WRITE_DEST_F(SOURCE1_F / SOURCE2_F);
  }
  break;

case ADDT:   {
    WRITE_DEST_F(SOURCE1_F + SOURCE2_F);
  }
  break;

case SUBT:   {
    WRITE_DEST_F(SOURCE1_F - SOURCE2_F);
  }
  break;

case MULT:   {
    WRITE_DEST_F(SOURCE1_F * SOURCE2_F);
  }
  break;

case DIVT:   {
    if (SOURCE2_F == 0.0)
      ASSERT_FAULT(md_fault_div0);
    WRITE_DEST_F(SOURCE1_F / SOURCE2_F);
  }
  break;

case CMPTUN:   {
    WRITE_DEST_F((IS_IEEEFP_DBL_NAN( SOURCE1 ) || IS_IEEEFP_DBL_NAN( SOURCE2 ))
	         ? 2.0
	         : 0.0 );
  }
  break;

case CMPTEQ:   {
    WRITE_DEST_F((((SOURCE1 == SOURCE2)
		  || (SOURCE1 << 1 == ULL(0)
		      && SOURCE2 << 1 == ULL(0)))
		 ? 2.0
		 : 0.0));
  }
  break;

case CMPTLT:   {
    WRITE_DEST_F((SOURCE1_F < SOURCE2_F) ? 2.0 : 0.0);
  }
  break;

case CMPTLE:   {
    WRITE_DEST_F((SOURCE1_F <= SOURCE2_F) ? 2.0 : 0.0);
  }
  break;

case CVTTS:   {
    WRITE_DEST_F((float)SOURCE2_F);
  }
  break;

case CVTTQ:   {
    WRITE_DEST((squad_t)SOURCE2_F);
  }
  break;

case CVTQS:   {
    /* FIXME: too much precision here... */
    WRITE_DEST_F((squad_t)SOURCE2);
  }
  break;

case CVTQT:   {
    WRITE_DEST_F((squad_t)SOURCE2);
  }
  break;

case CVTLQ:   {
    squad_t _longhold;
    sword_t _inthold;
    _longhold = SOURCE2;
    _inthold = (((_longhold >> 32) & 0xc0000000)
		| ((_longhold >> 29) & 0x3fffffff));
    WRITE_DEST((squad_t)_inthold);
  }
  break;

case CPYS:   {
    WRITE_DEST(((SOURCE1 & ULL(1) << 63)
		   | (SOURCE2 & LL(0x7fffffffffffffff))));
  }
  break;

case CPYSN:   {
    WRITE_DEST(((SOURCE1 >> 63 ^ 1) << 63
		   | (SOURCE2 & LL(0x7fffffffffffffff))));
  }
  break;

case CPYSE:   {
    WRITE_DEST(((SOURCE1 & ULL(0xfff) << 52)
		   | (SOURCE2 & ULL(0xfffffffffffff))));
  }
  break;

case MT_FPCR:   {
    /* FIXME: this looks incorrect, but what betadyn does... */
    /* -- FIXED, 02/26/99, plakal@cecil, using Glew's fix, read FP reg as quad */
    WRITE_DEST(SOURCE1);
  }
  break;

#ifdef _MSC_VER
case MF_FPCR:   {
    /* FIXME: uquad_t to double conversion not implemented in MSC */
    /* FIXME: this looks incorrect, but what betadyn does... */
    /* -- FIXED, 02/26/99, plakal@cecil, using Glew's fix, set FP reg as quad */
    WRITE_DEST(SOURCE1);
  }
#else /* !_MSC_VER */
case MF_FPCR:   {
    /* FIXME: this looks incorrect, but what betadyn does... */
    /* -- FIXED, 02/26/99, plakal@cecil, using Glew's fix, set FP reg as quad */
    WRITE_DEST(SOURCE1);
  }
#endif /* _MSC_VER */
  break;

case FCMOVEQ:   {
    if ((SOURCE1 << 1) == ULL(0))
      WRITE_DEST_F(SOURCE2_F);
  else
    WRITE_DEST_F(OLD_DEST_F);
  }
  break;

case FCMOVNE:   {
    if ((SOURCE1 << 1) != ULL(0))
      WRITE_DEST_F(SOURCE2_F);
  else
    WRITE_DEST_F(OLD_DEST_F);
  }
  break;

case FCMOVLT:   {
    if (((SOURCE1 << 1) != ULL(0)) && (SOURCE1 >> 63))
      WRITE_DEST_F(SOURCE2_F);
  else
    WRITE_DEST_F(OLD_DEST_F);
  }
  break;

case FCMOVGE:   {
    if (((SOURCE1 << 1) == ULL(0)) || (SOURCE1 >> 63 == ULL(0)))
      WRITE_DEST_F(SOURCE2_F);
  else
    WRITE_DEST_F(OLD_DEST_F);
  }
  break;

case FCMOVLE:   {
    if (((SOURCE1 << 1) == ULL(0)) || (SOURCE1 >> 63))
      WRITE_DEST_F(SOURCE2_F);
  else
    WRITE_DEST_F(OLD_DEST_F);
  }
  break;

case FCMOVGT:   {
    if (((SOURCE1 << 1) != ULL(0)) && (SOURCE1 >> 63 == ULL(0)))
      WRITE_DEST_F(SOURCE2_F);
  else
    WRITE_DEST_F(OLD_DEST_F);
  }
  break;

case CVTQL:   {
    squad_t longhold = SOURCE2;
    WRITE_DEST((((longhold >> 32) & LL(0xc000000000000000))
		   | (longhold & LL(0x3fffffff)) << 29));
  }
  break;

case TRAPB:   {
    /* FIXME: nada... */
  }
  break;

case EXCB:   {
    /* FIXME: nada... */
  }
  break;

case MB:   {
    /* FIXME: not supported... */
  }
  break;

case WMB:   {
    /* FIXME: not supported... */
  }
  break;

case FETCH:   {
    /* FIXME: not supported ... */
    ASSERT_FAULT(md_fault_unimpl);
  }
  break;

case FETCH_M:   {
    /* FIXME: not supported ... */
  }
  break;

case RPCC:   {
    /* FIXME: dumb implementation */
    WRITE_DEST(ULL(0));
  }
  break;

case _RC:   {
    /* FIXME: not supported */
  }
  break;

case ECB:   {
    /* FIXME: nada... */
  }
  break;

case _RS:   {
    /* FIXME: not supported */
  }
  break;

case WH64:   {
    MEMORY_READ;
  }
  break;

case JMP:   {
    LINK;
    SET_NPC(SOURCE2 & ~3);
  }
  break;

case JSR:   {
    LINK;
    SET_NPC(SOURCE2 & ~3);
  }
  break;

case RETN:   {
    LINK;
    SET_NPC(SOURCE2 & ~3);
  }
  break;

case JSR_COROUTINE:   {
    LINK;
    SET_NPC(SOURCE2 & ~3);
  }
  break;

case CTPOP:   {
    int _temp, _i;
    uquad_t _quadhold = SOURCE2;
    _temp = 0;
    for( _i = 0; _i <= 63; _i++ )
      if( _quadhold & (1 << _i))
	_temp++;
    WRITE_DEST((uquad_t)_temp );
  }
  break;

case PERR:   {
    int _i;
    uquad_t _sum_diffs, _quadhold_a, _quadhold_b;
    _quadhold_a = SOURCE1;
    _quadhold_b = SOURCE2;
    _sum_diffs = 0;
    for( _i = 0; _i <= 7; _i++ )
    {
      byte_t _bytehold_a, _bytehold_b;
      _bytehold_a = (_quadhold_a >> (_i*8)) & 0xff;
      _bytehold_b = (_quadhold_b >> (_i*8)) & 0xff;
      if( _bytehold_a >= _bytehold_b )
	_sum_diffs += (_bytehold_a - _bytehold_b);
      else
	_sum_diffs += (_bytehold_b - _bytehold_a);
    }
    WRITE_DEST(_sum_diffs );
  }
  break;

case CTLZ:   {
    int _temp, _i;
    uquad_t _quadhold = SOURCE2;
    _temp = 0;
    for( _i = 63; _i >= 0; _i-- )
    {
      if( _quadhold & (1 << _i))
	break;
      _temp++;
    }
    WRITE_DEST((uquad_t)_temp );
  }
  break;

case CTTZ:   {
    int _temp, _i;
    uquad_t _quadhold = SOURCE2;
    _temp = 0;
    for( _i = 0; _i <= 63; _i++ )
    {
      if( _quadhold & (1 << _i))
	break;
      _temp++;
    }
    WRITE_DEST((uquad_t)_temp );
  }
  break;

case UNPKBW:   {
    uquad_t _temp, _quadhold;
    _temp = 0;
    _quadhold = SOURCE2;
    _temp |= (_quadhold & 0xff);
    _temp |= ( ( (_quadhold >> 8) & 0xff) << 16);
    _temp |= ( ( (_quadhold >> 16) & 0xff) << 32);
    _temp |= ( ( (_quadhold >> 24) & 0xff) << 48);
    WRITE_DEST(_temp);
  }
  break;

case UNPKBL:   {
    uquad_t _temp, _quadhold;
    _temp = 0;
    _quadhold = SOURCE2;
    _temp |= (_quadhold & 0xff);
    _temp |= ( ( (_quadhold >> 8) & 0xff) << 32);
    WRITE_DEST(_temp);
  }
  break;

case PKWB:   {
    uquad_t _temp, _quadhold;
    _temp = 0;
    _quadhold = SOURCE2;
    _temp |= (_quadhold & 0xff);
    _temp |= ( ( (_quadhold >> 16) & 0xff) << 8);
    _temp |= ( ( (_quadhold >> 32) & 0xff) << 16);
    _temp |= ( ( (_quadhold >> 48) & 0xff) << 24);
    WRITE_DEST(_temp);
  }
  break;

case PKLB:   {
    uquad_t _temp, _quadhold;
    _temp = 0;
    _quadhold = SOURCE2;
    _temp |= (_quadhold & 0xff);
    _temp |= ( ( (_quadhold >> 32) & 0xff) << 8);
    WRITE_DEST(_temp);
  }
  break;

case FTOIT:   {
    WRITE_DEST(SOURCE1);
  }
  break;

case FTOIS:   {
    squad_t _longhold;
    sword_t _inthold;
    _longhold = SOURCE1;
    _inthold = (((_longhold >> 32) & ULL(0xc0000000))
		| ((_longhold >> 29) & ULL(0x3fffffff)));
    WRITE_DEST((SEXT32(_longhold >> 63) << 32) | _inthold );
  }
  break;

case MINSB8: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = SOURCE2;
  _quadhold_c = 0;
  for( _i = 0; _i <= 7; _i++ )
  {
    sbyte_t _bytehold_a, _bytehold_b, _bytehold_c;
    _bytehold_a = (_quadhold_a >> (_i * 8)) & 0xff;
    _bytehold_b = (_quadhold_b >> (_i * 8)) & 0xff;
    _bytehold_c = MIN(_bytehold_a, _bytehold_b);
    _quadhold_c |= (((byte_t)_bytehold_c & 0xff) << (_i*8));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MINSB8I: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = OFFSET	;
  _quadhold_c = 0;
  for( _i = 0; _i <= 7; _i++ )
  {
    sbyte_t _bytehold_a, _bytehold_b, _bytehold_c;
    _bytehold_a = (_quadhold_a >> (_i * 8)) & 0xff;
    _bytehold_b = (_quadhold_b >> (_i * 8)) & 0xff;
    _bytehold_c = MIN(_bytehold_a, _bytehold_b);
    _quadhold_c |= (((byte_t)_bytehold_c & 0xff) << (_i*8));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MINSW4: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = SOURCE2;
  _quadhold_c = 0;
  for( _i = 0; _i <= 3; _i++ )
  {
    shalf_t _halfhold_a, _halfhold_b, _halfhold_c;
    _halfhold_a = (_quadhold_a >> (_i * 16)) & 0xffff;
    _halfhold_b = (_quadhold_b >> (_i * 16)) & 0xffff;
    _halfhold_c = MIN(_halfhold_a, _halfhold_b);
    _quadhold_c |= (((half_t)_halfhold_c & 0xffff) << (_i*16));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MINSW4I: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = OFFSET	;
  _quadhold_c = 0;
  for( _i = 0; _i <= 3; _i++ )
  {
    shalf_t _halfhold_a, _halfhold_b, _halfhold_c;
    _halfhold_a = (_quadhold_a >> (_i * 16)) & 0xffff;
    _halfhold_b = (_quadhold_b >> (_i * 16)) & 0xffff;
    _halfhold_c = MIN(_halfhold_a, _halfhold_b);
    _quadhold_c |= (((half_t)_halfhold_c & 0xffff) << (_i*16));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MINUB8: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = SOURCE2;
  _quadhold_c = 0;
  for( _i = 0; _i <= 7; _i++ )
  {
    byte_t _bytehold_a, _bytehold_b, _bytehold_c;
    _bytehold_a = (_quadhold_a >> (_i * 8)) & 0xff;
    _bytehold_b = (_quadhold_b >> (_i * 8)) & 0xff;
    _bytehold_c = MIN(_bytehold_a, _bytehold_b);
    _quadhold_c |= (((byte_t)_bytehold_c & 0xff) << (_i*8));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MINUB8I: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = OFFSET	;
  _quadhold_c = 0;
  for( _i = 0; _i <= 7; _i++ )
  {
    byte_t _bytehold_a, _bytehold_b, _bytehold_c;
    _bytehold_a = (_quadhold_a >> (_i * 8)) & 0xff;
    _bytehold_b = (_quadhold_b >> (_i * 8)) & 0xff;
    _bytehold_c = MIN(_bytehold_a, _bytehold_b);
    _quadhold_c |= (((byte_t)_bytehold_c & 0xff) << (_i*8));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MINUW4: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = SOURCE2;
  _quadhold_c = 0;
  for( _i = 0; _i <= 3; _i++ )
  {
    half_t _halfhold_a, _halfhold_b, _halfhold_c;
    _halfhold_a = (_quadhold_a >> (_i * 16)) & 0xffff;
    _halfhold_b = (_quadhold_b >> (_i * 16)) & 0xffff;
    _halfhold_c = MIN(_halfhold_a, _halfhold_b);
    _quadhold_c |= (((half_t)_halfhold_c & 0xffff) << (_i*16));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MINUW4I: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = OFFSET	;
  _quadhold_c = 0;
  for( _i = 0; _i <= 3; _i++ )
  {
    half_t _halfhold_a, _halfhold_b, _halfhold_c;
    _halfhold_a = (_quadhold_a >> (_i * 16)) & 0xffff;
    _halfhold_b = (_quadhold_b >> (_i * 16)) & 0xffff;
    _halfhold_c = MIN(_halfhold_a, _halfhold_b);
    _quadhold_c |= (((half_t)_halfhold_c & 0xffff) << (_i*16));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MAXUB8: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = SOURCE2;
  _quadhold_c = 0;
  for( _i = 0; _i <= 7; _i++ )
  {
    byte_t _bytehold_a, _bytehold_b, _bytehold_c;
    _bytehold_a = (_quadhold_a >> (_i * 8)) & 0xff;
    _bytehold_b = (_quadhold_b >> (_i * 8)) & 0xff;
    _bytehold_c = MAX(_bytehold_a, _bytehold_b);
    _quadhold_c |= (((byte_t)_bytehold_c & 0xff) << (_i*8));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MAXUB8I: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = OFFSET	;
  _quadhold_c = 0;
  for( _i = 0; _i <= 7; _i++ )
  {
    byte_t _bytehold_a, _bytehold_b, _bytehold_c;
    _bytehold_a = (_quadhold_a >> (_i * 8)) & 0xff;
    _bytehold_b = (_quadhold_b >> (_i * 8)) & 0xff;
    _bytehold_c = MAX(_bytehold_a, _bytehold_b);
    _quadhold_c |= (((byte_t)_bytehold_c & 0xff) << (_i*8));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MAXUW4: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = SOURCE2;
  _quadhold_c = 0;
  for( _i = 0; _i <= 3; _i++ )
  {
    half_t _halfhold_a, _halfhold_b, _halfhold_c;
    _halfhold_a = (_quadhold_a >> (_i * 16)) & 0xffff;
    _halfhold_b = (_quadhold_b >> (_i * 16)) & 0xffff;
    _halfhold_c = MAX(_halfhold_a, _halfhold_b);
    _quadhold_c |= (((half_t)_halfhold_c & 0xffff) << (_i*16));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MAXUW4I: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = OFFSET	;
  _quadhold_c = 0;
  for( _i = 0; _i <= 3; _i++ )
  {
    half_t _halfhold_a, _halfhold_b, _halfhold_c;
    _halfhold_a = (_quadhold_a >> (_i * 16)) & 0xffff;
    _halfhold_b = (_quadhold_b >> (_i * 16)) & 0xffff;
    _halfhold_c = MAX(_halfhold_a, _halfhold_b);
    _quadhold_c |= (((half_t)_halfhold_c & 0xffff) << (_i*16));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MAXSB8: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = SOURCE2;
  _quadhold_c = 0;
  for( _i = 0; _i <= 7; _i++ )
  {
    sbyte_t _bytehold_a, _bytehold_b, _bytehold_c;
    _bytehold_a = (_quadhold_a >> (_i * 8)) & 0xff;
    _bytehold_b = (_quadhold_b >> (_i * 8)) & 0xff;
    _bytehold_c = MAX(_bytehold_a, _bytehold_b);
    _quadhold_c |= (((byte_t)_bytehold_c & 0xff) << (_i*8));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MAXSB8I: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = OFFSET	;
  _quadhold_c = 0;
  for( _i = 0; _i <= 7; _i++ )
  {
    sbyte_t _bytehold_a, _bytehold_b, _bytehold_c;
    _bytehold_a = (_quadhold_a >> (_i * 8)) & 0xff;
    _bytehold_b = (_quadhold_b >> (_i * 8)) & 0xff;
    _bytehold_c = MAX(_bytehold_a, _bytehold_b);
    _quadhold_c |= (((byte_t)_bytehold_c & 0xff) << (_i*8));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MAXSW4: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = SOURCE2;
  _quadhold_c = 0;
  for( _i = 0; _i <= 3; _i++ )
  {
    shalf_t _halfhold_a, _halfhold_b, _halfhold_c;
    _halfhold_a = (_quadhold_a >> (_i * 16)) & 0xffff;
    _halfhold_b = (_quadhold_b >> (_i * 16)) & 0xffff;
    _halfhold_c = MAX(_halfhold_a, _halfhold_b);
    _quadhold_c |= (((half_t)_halfhold_c & 0xffff) << (_i*16));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case MAXSW4I: {
  int _i;
  uquad_t _quadhold_a, _quadhold_b, _quadhold_c;
  _quadhold_a = SOURCE1;
  _quadhold_b = OFFSET	;
  _quadhold_c = 0;
  for( _i = 0; _i <= 3; _i++ )
  {
    shalf_t _halfhold_a, _halfhold_b, _halfhold_c;
    _halfhold_a = (_quadhold_a >> (_i * 16)) & 0xffff;
    _halfhold_b = (_quadhold_b >> (_i * 16)) & 0xffff;
    _halfhold_c = MAX(_halfhold_a, _halfhold_b);
    _quadhold_c |= (((half_t)_halfhold_c & 0xffff) << (_i*16));
  }
  WRITE_DEST(_quadhold_c );
}
  break;

case SEXTB:   {
    WRITE_DEST((uquad_t)(squad_t)(sbyte_t)(SOURCE2 & 0xff));
  }
  break;

case SEXTBI:   {
    WRITE_DEST((uquad_t)(squad_t)(sbyte_t)(OFFSET & 0xff));
  }
  break;

case SEXTW:   {
    WRITE_DEST((uquad_t)(squad_t)(shalf_t)(SOURCE2 & 0xffff));
  }
  break;

case SEXTWI:   {
    WRITE_DEST((uquad_t)(squad_t)(shalf_t)(OFFSET & 0xffff));
  }
  break;

