fp.isa (7384:f12b4f28e5eb) fp.isa (7385:493aea5e1006)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

--- 372 unchanged lines hidden (view full) ---

381 header_output = ""
382 decoder_output = ""
383 exec_output = ""
384
385 vmulSCode = '''
386 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
387 VfpSavedState state = prepVfpFpscr(Fpscr);
388 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

--- 372 unchanged lines hidden (view full) ---

381 header_output = ""
382 decoder_output = ""
383 exec_output = ""
384
385 vmulSCode = '''
386 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
387 VfpSavedState state = prepVfpFpscr(Fpscr);
388 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
389 FpDest = fixNan(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
389 FpDest = fixDest(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
390 __asm__ __volatile__("" :: "m" (FpDest));
391 Fpscr = setVfpFpscr(Fpscr, state);
392 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
393 FpDest = NAN;
394 }
395 '''
396 vmulSIop = InstObjParams("vmuls", "VmulS", "VfpRegRegRegOp",
397 { "code": vmulSCode,

--- 4 unchanged lines hidden (view full) ---

402
403 vmulDCode = '''
404 IntDoubleUnion cOp1, cOp2, cDest;
405 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
406 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
407 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
408 VfpSavedState state = prepVfpFpscr(Fpscr);
409 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
390 __asm__ __volatile__("" :: "m" (FpDest));
391 Fpscr = setVfpFpscr(Fpscr, state);
392 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
393 FpDest = NAN;
394 }
395 '''
396 vmulSIop = InstObjParams("vmuls", "VmulS", "VfpRegRegRegOp",
397 { "code": vmulSCode,

--- 4 unchanged lines hidden (view full) ---

402
403 vmulDCode = '''
404 IntDoubleUnion cOp1, cOp2, cDest;
405 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
406 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
407 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
408 VfpSavedState state = prepVfpFpscr(Fpscr);
409 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
410 cDest.fp = fixNan(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
410 cDest.fp = fixDest(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
411 __asm__ __volatile__("" :: "m" (cDest.fp));
412 Fpscr = setVfpFpscr(Fpscr, state);
413 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
414 (isinf(cOp2.fp) && cOp1.fp == 0)) {
415 cDest.fp = NAN;
416 }
417 FpDestP0.uw = cDest.bits;
418 FpDestP1.uw = cDest.bits >> 32;

--- 52 unchanged lines hidden (view full) ---

471 header_output += VfpRegRegOpDeclare.subst(vabsDIop);
472 decoder_output += VfpRegRegOpConstructor.subst(vabsDIop);
473 exec_output += PredOpExecute.subst(vabsDIop);
474
475 vaddSCode = '''
476 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
477 VfpSavedState state = prepVfpFpscr(Fpscr);
478 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
411 __asm__ __volatile__("" :: "m" (cDest.fp));
412 Fpscr = setVfpFpscr(Fpscr, state);
413 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
414 (isinf(cOp2.fp) && cOp1.fp == 0)) {
415 cDest.fp = NAN;
416 }
417 FpDestP0.uw = cDest.bits;
418 FpDestP1.uw = cDest.bits >> 32;

--- 52 unchanged lines hidden (view full) ---

471 header_output += VfpRegRegOpDeclare.subst(vabsDIop);
472 decoder_output += VfpRegRegOpConstructor.subst(vabsDIop);
473 exec_output += PredOpExecute.subst(vabsDIop);
474
475 vaddSCode = '''
476 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
477 VfpSavedState state = prepVfpFpscr(Fpscr);
478 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
479 FpDest = fixNan(Fpscr, FpOp1 + FpOp2, FpOp1, FpOp2);
479 FpDest = fixDest(Fpscr, FpOp1 + FpOp2, FpOp1, FpOp2);
480 __asm__ __volatile__("" :: "m" (FpDest));
481 Fpscr = setVfpFpscr(Fpscr, state);
482 '''
483 vaddSIop = InstObjParams("vadds", "VaddS", "VfpRegRegRegOp",
484 { "code": vaddSCode,
485 "predicate_test": predicateTest }, [])
486 header_output += VfpRegRegRegOpDeclare.subst(vaddSIop);
487 decoder_output += VfpRegRegRegOpConstructor.subst(vaddSIop);
488 exec_output += PredOpExecute.subst(vaddSIop);
489
490 vaddDCode = '''
491 IntDoubleUnion cOp1, cOp2, cDest;
492 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
493 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
480 __asm__ __volatile__("" :: "m" (FpDest));
481 Fpscr = setVfpFpscr(Fpscr, state);
482 '''
483 vaddSIop = InstObjParams("vadds", "VaddS", "VfpRegRegRegOp",
484 { "code": vaddSCode,
485 "predicate_test": predicateTest }, [])
486 header_output += VfpRegRegRegOpDeclare.subst(vaddSIop);
487 decoder_output += VfpRegRegRegOpConstructor.subst(vaddSIop);
488 exec_output += PredOpExecute.subst(vaddSIop);
489
490 vaddDCode = '''
491 IntDoubleUnion cOp1, cOp2, cDest;
492 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
493 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
494 DPRINTFN("cOp1.bits = %#x, cOp1.fp = %f.\\n", cOp1.bits, cOp1.fp);
495 DPRINTFN("cOp2.bits = %#x, cOp2.fp = %f.\\n", cOp2.bits, cOp2.fp);
494 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
495 VfpSavedState state = prepVfpFpscr(Fpscr);
496 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
496 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
497 VfpSavedState state = prepVfpFpscr(Fpscr);
498 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
497 cDest.fp = fixNan(Fpscr, cOp1.fp + cOp2.fp, cOp1.fp, cOp2.fp);
499 cDest.fp = fixDest(Fpscr, cOp1.fp + cOp2.fp, cOp1.fp, cOp2.fp);
500 DPRINTFN("cDest.bits = %#x, cDest.fp = %f.\\n", cDest.bits, cDest.fp);
498 __asm__ __volatile__("" :: "m" (cDest.fp));
499 Fpscr = setVfpFpscr(Fpscr, state);
500 FpDestP0.uw = cDest.bits;
501 FpDestP1.uw = cDest.bits >> 32;
502 '''
503 vaddDIop = InstObjParams("vaddd", "VaddD", "VfpRegRegRegOp",
504 { "code": vaddDCode,
505 "predicate_test": predicateTest }, [])
506 header_output += VfpRegRegRegOpDeclare.subst(vaddDIop);
507 decoder_output += VfpRegRegRegOpConstructor.subst(vaddDIop);
508 exec_output += PredOpExecute.subst(vaddDIop);
509
510 vsubSCode = '''
511 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
512 VfpSavedState state = prepVfpFpscr(Fpscr);
513 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
501 __asm__ __volatile__("" :: "m" (cDest.fp));
502 Fpscr = setVfpFpscr(Fpscr, state);
503 FpDestP0.uw = cDest.bits;
504 FpDestP1.uw = cDest.bits >> 32;
505 '''
506 vaddDIop = InstObjParams("vaddd", "VaddD", "VfpRegRegRegOp",
507 { "code": vaddDCode,
508 "predicate_test": predicateTest }, [])
509 header_output += VfpRegRegRegOpDeclare.subst(vaddDIop);
510 decoder_output += VfpRegRegRegOpConstructor.subst(vaddDIop);
511 exec_output += PredOpExecute.subst(vaddDIop);
512
513 vsubSCode = '''
514 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
515 VfpSavedState state = prepVfpFpscr(Fpscr);
516 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
514 FpDest = fixNan(Fpscr, FpOp1 - FpOp2, FpOp1, FpOp2);
517 FpDest = fixDest(Fpscr, FpOp1 - FpOp2, FpOp1, FpOp2);
515 __asm__ __volatile__("" :: "m" (FpDest));
516 Fpscr = setVfpFpscr(Fpscr, state)
517 '''
518 vsubSIop = InstObjParams("vsubs", "VsubS", "VfpRegRegRegOp",
519 { "code": vsubSCode,
520 "predicate_test": predicateTest }, [])
521 header_output += VfpRegRegRegOpDeclare.subst(vsubSIop);
522 decoder_output += VfpRegRegRegOpConstructor.subst(vsubSIop);
523 exec_output += PredOpExecute.subst(vsubSIop);
524
525 vsubDCode = '''
526 IntDoubleUnion cOp1, cOp2, cDest;
527 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
528 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
529 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
530 VfpSavedState state = prepVfpFpscr(Fpscr);
531 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
518 __asm__ __volatile__("" :: "m" (FpDest));
519 Fpscr = setVfpFpscr(Fpscr, state)
520 '''
521 vsubSIop = InstObjParams("vsubs", "VsubS", "VfpRegRegRegOp",
522 { "code": vsubSCode,
523 "predicate_test": predicateTest }, [])
524 header_output += VfpRegRegRegOpDeclare.subst(vsubSIop);
525 decoder_output += VfpRegRegRegOpConstructor.subst(vsubSIop);
526 exec_output += PredOpExecute.subst(vsubSIop);
527
528 vsubDCode = '''
529 IntDoubleUnion cOp1, cOp2, cDest;
530 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
531 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
532 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
533 VfpSavedState state = prepVfpFpscr(Fpscr);
534 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
532 cDest.fp = fixNan(Fpscr, cOp1.fp - cOp2.fp, cOp1.fp, cOp2.fp);
535 cDest.fp = fixDest(Fpscr, cOp1.fp - cOp2.fp, cOp1.fp, cOp2.fp);
533 __asm__ __volatile__("" :: "m" (cDest.fp));
534 Fpscr = setVfpFpscr(Fpscr, state);
535 FpDestP0.uw = cDest.bits;
536 FpDestP1.uw = cDest.bits >> 32;
537 '''
538 vsubDIop = InstObjParams("vsubd", "VsubD", "VfpRegRegRegOp",
539 { "code": vsubDCode,
540 "predicate_test": predicateTest }, [])
541 header_output += VfpRegRegRegOpDeclare.subst(vsubDIop);
542 decoder_output += VfpRegRegRegOpConstructor.subst(vsubDIop);
543 exec_output += PredOpExecute.subst(vsubDIop);
544
545 vdivSCode = '''
546 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
547 VfpSavedState state = prepVfpFpscr(Fpscr);
548 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
536 __asm__ __volatile__("" :: "m" (cDest.fp));
537 Fpscr = setVfpFpscr(Fpscr, state);
538 FpDestP0.uw = cDest.bits;
539 FpDestP1.uw = cDest.bits >> 32;
540 '''
541 vsubDIop = InstObjParams("vsubd", "VsubD", "VfpRegRegRegOp",
542 { "code": vsubDCode,
543 "predicate_test": predicateTest }, [])
544 header_output += VfpRegRegRegOpDeclare.subst(vsubDIop);
545 decoder_output += VfpRegRegRegOpConstructor.subst(vsubDIop);
546 exec_output += PredOpExecute.subst(vsubDIop);
547
548 vdivSCode = '''
549 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
550 VfpSavedState state = prepVfpFpscr(Fpscr);
551 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
549 FpDest = fixNan(Fpscr, FpOp1 / FpOp2, FpOp1, FpOp2);
552 FpDest = fixDest(Fpscr, FpOp1 / FpOp2, FpOp1, FpOp2);
550 __asm__ __volatile__("" :: "m" (FpDest));
551 Fpscr = setVfpFpscr(Fpscr, state);
552 '''
553 vdivSIop = InstObjParams("vdivs", "VdivS", "VfpRegRegRegOp",
554 { "code": vdivSCode,
555 "predicate_test": predicateTest }, [])
556 header_output += VfpRegRegRegOpDeclare.subst(vdivSIop);
557 decoder_output += VfpRegRegRegOpConstructor.subst(vdivSIop);
558 exec_output += PredOpExecute.subst(vdivSIop);
559
560 vdivDCode = '''
561 IntDoubleUnion cOp1, cOp2, cDest;
562 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
563 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
564 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
565 VfpSavedState state = prepVfpFpscr(Fpscr);
566 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cDest.fp));
553 __asm__ __volatile__("" :: "m" (FpDest));
554 Fpscr = setVfpFpscr(Fpscr, state);
555 '''
556 vdivSIop = InstObjParams("vdivs", "VdivS", "VfpRegRegRegOp",
557 { "code": vdivSCode,
558 "predicate_test": predicateTest }, [])
559 header_output += VfpRegRegRegOpDeclare.subst(vdivSIop);
560 decoder_output += VfpRegRegRegOpConstructor.subst(vdivSIop);
561 exec_output += PredOpExecute.subst(vdivSIop);
562
563 vdivDCode = '''
564 IntDoubleUnion cOp1, cOp2, cDest;
565 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
566 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
567 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
568 VfpSavedState state = prepVfpFpscr(Fpscr);
569 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cDest.fp));
567 cDest.fp = fixNan(Fpscr, cOp1.fp / cOp2.fp, cOp1.fp, cOp2.fp);
570 cDest.fp = fixDest(Fpscr, cOp1.fp / cOp2.fp, cOp1.fp, cOp2.fp);
568 __asm__ __volatile__("" :: "m" (cDest.fp));
569 Fpscr = setVfpFpscr(Fpscr, state);
570 FpDestP0.uw = cDest.bits;
571 FpDestP1.uw = cDest.bits >> 32;
572 '''
573 vdivDIop = InstObjParams("vdivd", "VdivD", "VfpRegRegRegOp",
574 { "code": vdivDCode,
575 "predicate_test": predicateTest }, [])

--- 47 unchanged lines hidden (view full) ---

623 header_output = ""
624 decoder_output = ""
625 exec_output = ""
626
627 vmlaSCode = '''
628 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
629 VfpSavedState state = prepVfpFpscr(Fpscr);
630 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
571 __asm__ __volatile__("" :: "m" (cDest.fp));
572 Fpscr = setVfpFpscr(Fpscr, state);
573 FpDestP0.uw = cDest.bits;
574 FpDestP1.uw = cDest.bits >> 32;
575 '''
576 vdivDIop = InstObjParams("vdivd", "VdivD", "VfpRegRegRegOp",
577 { "code": vdivDCode,
578 "predicate_test": predicateTest }, [])

--- 47 unchanged lines hidden (view full) ---

626 header_output = ""
627 decoder_output = ""
628 exec_output = ""
629
630 vmlaSCode = '''
631 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
632 VfpSavedState state = prepVfpFpscr(Fpscr);
633 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
631 float mid = fixNan(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
634 float mid = fixDest(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
632 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
633 mid = NAN;
634 }
635 vfpFlushToZero(Fpscr, FpDest, mid);
635 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
636 mid = NAN;
637 }
638 vfpFlushToZero(Fpscr, FpDest, mid);
636 FpDest = fixNan(Fpscr, FpDest + mid, FpDest, mid);
639 FpDest = fixDest(Fpscr, FpDest + mid, FpDest, mid);
637 __asm__ __volatile__("" :: "m" (FpDest));
638 Fpscr = setVfpFpscr(Fpscr, state);
639 '''
640 vmlaSIop = InstObjParams("vmlas", "VmlaS", "VfpRegRegRegOp",
641 { "code": vmlaSCode,
642 "predicate_test": predicateTest }, [])
643 header_output += VfpRegRegRegOpDeclare.subst(vmlaSIop);
644 decoder_output += VfpRegRegRegOpConstructor.subst(vmlaSIop);
645 exec_output += PredOpExecute.subst(vmlaSIop);
646
647 vmlaDCode = '''
648 IntDoubleUnion cOp1, cOp2, cDest;
649 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
650 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
651 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
652 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
653 VfpSavedState state = prepVfpFpscr(Fpscr);
654 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
640 __asm__ __volatile__("" :: "m" (FpDest));
641 Fpscr = setVfpFpscr(Fpscr, state);
642 '''
643 vmlaSIop = InstObjParams("vmlas", "VmlaS", "VfpRegRegRegOp",
644 { "code": vmlaSCode,
645 "predicate_test": predicateTest }, [])
646 header_output += VfpRegRegRegOpDeclare.subst(vmlaSIop);
647 decoder_output += VfpRegRegRegOpConstructor.subst(vmlaSIop);
648 exec_output += PredOpExecute.subst(vmlaSIop);
649
650 vmlaDCode = '''
651 IntDoubleUnion cOp1, cOp2, cDest;
652 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
653 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
654 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
655 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
656 VfpSavedState state = prepVfpFpscr(Fpscr);
657 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
655 double mid = fixNan(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
658 double mid = fixDest(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
656 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
657 (isinf(cOp2.fp) && cOp1.fp == 0)) {
658 mid = NAN;
659 }
660 vfpFlushToZero(Fpscr, cDest.fp, mid);
659 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
660 (isinf(cOp2.fp) && cOp1.fp == 0)) {
661 mid = NAN;
662 }
663 vfpFlushToZero(Fpscr, cDest.fp, mid);
661 cDest.fp = fixNan(Fpscr, cDest.fp + mid, cDest.fp, mid);
664 cDest.fp = fixDest(Fpscr, cDest.fp + mid, cDest.fp, mid);
662 __asm__ __volatile__("" :: "m" (cDest.fp));
663 Fpscr = setVfpFpscr(Fpscr, state);
664 FpDestP0.uw = cDest.bits;
665 FpDestP1.uw = cDest.bits >> 32;
666 '''
667 vmlaDIop = InstObjParams("vmlad", "VmlaD", "VfpRegRegRegOp",
668 { "code": vmlaDCode,
669 "predicate_test": predicateTest }, [])
670 header_output += VfpRegRegRegOpDeclare.subst(vmlaDIop);
671 decoder_output += VfpRegRegRegOpConstructor.subst(vmlaDIop);
672 exec_output += PredOpExecute.subst(vmlaDIop);
673
674 vmlsSCode = '''
675 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
676 VfpSavedState state = prepVfpFpscr(Fpscr);
677 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
665 __asm__ __volatile__("" :: "m" (cDest.fp));
666 Fpscr = setVfpFpscr(Fpscr, state);
667 FpDestP0.uw = cDest.bits;
668 FpDestP1.uw = cDest.bits >> 32;
669 '''
670 vmlaDIop = InstObjParams("vmlad", "VmlaD", "VfpRegRegRegOp",
671 { "code": vmlaDCode,
672 "predicate_test": predicateTest }, [])
673 header_output += VfpRegRegRegOpDeclare.subst(vmlaDIop);
674 decoder_output += VfpRegRegRegOpConstructor.subst(vmlaDIop);
675 exec_output += PredOpExecute.subst(vmlaDIop);
676
677 vmlsSCode = '''
678 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
679 VfpSavedState state = prepVfpFpscr(Fpscr);
680 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
678 float mid = fixNan(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
681 float mid = fixDest(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
679 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
680 mid = NAN;
681 }
682 vfpFlushToZero(Fpscr, FpDest, mid);
682 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
683 mid = NAN;
684 }
685 vfpFlushToZero(Fpscr, FpDest, mid);
683 FpDest = fixNan(Fpscr, FpDest - mid, FpDest, mid);
686 FpDest = fixDest(Fpscr, FpDest - mid, FpDest, mid);
684 __asm__ __volatile__("" :: "m" (FpDest));
685 Fpscr = setVfpFpscr(Fpscr, state);
686 '''
687 vmlsSIop = InstObjParams("vmlss", "VmlsS", "VfpRegRegRegOp",
688 { "code": vmlsSCode,
689 "predicate_test": predicateTest }, [])
690 header_output += VfpRegRegRegOpDeclare.subst(vmlsSIop);
691 decoder_output += VfpRegRegRegOpConstructor.subst(vmlsSIop);
692 exec_output += PredOpExecute.subst(vmlsSIop);
693
694 vmlsDCode = '''
695 IntDoubleUnion cOp1, cOp2, cDest;
696 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
697 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
698 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
699 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
700 VfpSavedState state = prepVfpFpscr(Fpscr);
701 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
687 __asm__ __volatile__("" :: "m" (FpDest));
688 Fpscr = setVfpFpscr(Fpscr, state);
689 '''
690 vmlsSIop = InstObjParams("vmlss", "VmlsS", "VfpRegRegRegOp",
691 { "code": vmlsSCode,
692 "predicate_test": predicateTest }, [])
693 header_output += VfpRegRegRegOpDeclare.subst(vmlsSIop);
694 decoder_output += VfpRegRegRegOpConstructor.subst(vmlsSIop);
695 exec_output += PredOpExecute.subst(vmlsSIop);
696
697 vmlsDCode = '''
698 IntDoubleUnion cOp1, cOp2, cDest;
699 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
700 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
701 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
702 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
703 VfpSavedState state = prepVfpFpscr(Fpscr);
704 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
702 double mid = fixNan(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
705 double mid = fixDest(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
703 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
704 (isinf(cOp2.fp) && cOp1.fp == 0)) {
705 mid = NAN;
706 }
706 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
707 (isinf(cOp2.fp) && cOp1.fp == 0)) {
708 mid = NAN;
709 }
707 cDest.fp = fixNan(Fpscr, cDest.fp - mid, cDest.fp, mid);
710 cDest.fp = fixDest(Fpscr, cDest.fp - mid, cDest.fp, mid);
708 vfpFlushToZero(Fpscr, cDest.fp, mid);
709 __asm__ __volatile__("" :: "m" (cDest.fp));
710 Fpscr = setVfpFpscr(Fpscr, state);
711 FpDestP0.uw = cDest.bits;
712 FpDestP1.uw = cDest.bits >> 32;
713 '''
714 vmlsDIop = InstObjParams("vmlsd", "VmlsD", "VfpRegRegRegOp",
715 { "code": vmlsDCode,
716 "predicate_test": predicateTest }, [])
717 header_output += VfpRegRegRegOpDeclare.subst(vmlsDIop);
718 decoder_output += VfpRegRegRegOpConstructor.subst(vmlsDIop);
719 exec_output += PredOpExecute.subst(vmlsDIop);
720
721 vnmlaSCode = '''
722 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
723 VfpSavedState state = prepVfpFpscr(Fpscr);
724 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
711 vfpFlushToZero(Fpscr, cDest.fp, mid);
712 __asm__ __volatile__("" :: "m" (cDest.fp));
713 Fpscr = setVfpFpscr(Fpscr, state);
714 FpDestP0.uw = cDest.bits;
715 FpDestP1.uw = cDest.bits >> 32;
716 '''
717 vmlsDIop = InstObjParams("vmlsd", "VmlsD", "VfpRegRegRegOp",
718 { "code": vmlsDCode,
719 "predicate_test": predicateTest }, [])
720 header_output += VfpRegRegRegOpDeclare.subst(vmlsDIop);
721 decoder_output += VfpRegRegRegOpConstructor.subst(vmlsDIop);
722 exec_output += PredOpExecute.subst(vmlsDIop);
723
724 vnmlaSCode = '''
725 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
726 VfpSavedState state = prepVfpFpscr(Fpscr);
727 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
725 float mid = fixNan(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
728 float mid = fixDest(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
726 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
727 mid = NAN;
728 }
729 vfpFlushToZero(Fpscr, FpDest, mid);
729 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
730 mid = NAN;
731 }
732 vfpFlushToZero(Fpscr, FpDest, mid);
730 FpDest = fixNan(Fpscr, -FpDest - mid, FpDest, mid);
733 FpDest = fixDest(Fpscr, -FpDest - mid, FpDest, mid);
731 __asm__ __volatile__("" :: "m" (FpDest));
732 Fpscr = setVfpFpscr(Fpscr, state);
733 '''
734 vnmlaSIop = InstObjParams("vnmlas", "VnmlaS", "VfpRegRegRegOp",
735 { "code": vnmlaSCode,
736 "predicate_test": predicateTest }, [])
737 header_output += VfpRegRegRegOpDeclare.subst(vnmlaSIop);
738 decoder_output += VfpRegRegRegOpConstructor.subst(vnmlaSIop);
739 exec_output += PredOpExecute.subst(vnmlaSIop);
740
741 vnmlaDCode = '''
742 IntDoubleUnion cOp1, cOp2, cDest;
743 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
744 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
745 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
746 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
747 VfpSavedState state = prepVfpFpscr(Fpscr);
748 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
734 __asm__ __volatile__("" :: "m" (FpDest));
735 Fpscr = setVfpFpscr(Fpscr, state);
736 '''
737 vnmlaSIop = InstObjParams("vnmlas", "VnmlaS", "VfpRegRegRegOp",
738 { "code": vnmlaSCode,
739 "predicate_test": predicateTest }, [])
740 header_output += VfpRegRegRegOpDeclare.subst(vnmlaSIop);
741 decoder_output += VfpRegRegRegOpConstructor.subst(vnmlaSIop);
742 exec_output += PredOpExecute.subst(vnmlaSIop);
743
744 vnmlaDCode = '''
745 IntDoubleUnion cOp1, cOp2, cDest;
746 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
747 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
748 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
749 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
750 VfpSavedState state = prepVfpFpscr(Fpscr);
751 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
749 double mid = fixNan(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
752 double mid = fixDest(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
750 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
751 (isinf(cOp2.fp) && cOp1.fp == 0)) {
752 mid = NAN;
753 }
754 vfpFlushToZero(Fpscr, cDest.fp, mid);
753 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
754 (isinf(cOp2.fp) && cOp1.fp == 0)) {
755 mid = NAN;
756 }
757 vfpFlushToZero(Fpscr, cDest.fp, mid);
755 cDest.fp = fixNan(Fpscr, -cDest.fp - mid, cDest.fp, mid);
758 cDest.fp = fixDest(Fpscr, -cDest.fp - mid, cDest.fp, mid);
756 __asm__ __volatile__("" :: "m" (cDest.fp));
757 Fpscr = setVfpFpscr(Fpscr, state);
758 FpDestP0.uw = cDest.bits;
759 FpDestP1.uw = cDest.bits >> 32;
760 '''
761 vnmlaDIop = InstObjParams("vnmlad", "VnmlaD", "VfpRegRegRegOp",
762 { "code": vnmlaDCode,
763 "predicate_test": predicateTest }, [])
764 header_output += VfpRegRegRegOpDeclare.subst(vnmlaDIop);
765 decoder_output += VfpRegRegRegOpConstructor.subst(vnmlaDIop);
766 exec_output += PredOpExecute.subst(vnmlaDIop);
767
768 vnmlsSCode = '''
769 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
770 VfpSavedState state = prepVfpFpscr(Fpscr);
771 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
759 __asm__ __volatile__("" :: "m" (cDest.fp));
760 Fpscr = setVfpFpscr(Fpscr, state);
761 FpDestP0.uw = cDest.bits;
762 FpDestP1.uw = cDest.bits >> 32;
763 '''
764 vnmlaDIop = InstObjParams("vnmlad", "VnmlaD", "VfpRegRegRegOp",
765 { "code": vnmlaDCode,
766 "predicate_test": predicateTest }, [])
767 header_output += VfpRegRegRegOpDeclare.subst(vnmlaDIop);
768 decoder_output += VfpRegRegRegOpConstructor.subst(vnmlaDIop);
769 exec_output += PredOpExecute.subst(vnmlaDIop);
770
771 vnmlsSCode = '''
772 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
773 VfpSavedState state = prepVfpFpscr(Fpscr);
774 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
772 float mid = fixNan(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
775 float mid = fixDest(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
773 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
774 mid = NAN;
775 }
776 vfpFlushToZero(Fpscr, FpDest, mid);
776 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
777 mid = NAN;
778 }
779 vfpFlushToZero(Fpscr, FpDest, mid);
777 FpDest = fixNan(Fpscr, -FpDest + mid, FpDest, mid);
780 FpDest = fixDest(Fpscr, -FpDest + mid, FpDest, mid);
778 __asm__ __volatile__("" :: "m" (FpDest));
779 Fpscr = setVfpFpscr(Fpscr, state);
780 '''
781 vnmlsSIop = InstObjParams("vnmlss", "VnmlsS", "VfpRegRegRegOp",
782 { "code": vnmlsSCode,
783 "predicate_test": predicateTest }, [])
784 header_output += VfpRegRegRegOpDeclare.subst(vnmlsSIop);
785 decoder_output += VfpRegRegRegOpConstructor.subst(vnmlsSIop);
786 exec_output += PredOpExecute.subst(vnmlsSIop);
787
788 vnmlsDCode = '''
789 IntDoubleUnion cOp1, cOp2, cDest;
790 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
791 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
792 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
793 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
794 VfpSavedState state = prepVfpFpscr(Fpscr);
795 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
781 __asm__ __volatile__("" :: "m" (FpDest));
782 Fpscr = setVfpFpscr(Fpscr, state);
783 '''
784 vnmlsSIop = InstObjParams("vnmlss", "VnmlsS", "VfpRegRegRegOp",
785 { "code": vnmlsSCode,
786 "predicate_test": predicateTest }, [])
787 header_output += VfpRegRegRegOpDeclare.subst(vnmlsSIop);
788 decoder_output += VfpRegRegRegOpConstructor.subst(vnmlsSIop);
789 exec_output += PredOpExecute.subst(vnmlsSIop);
790
791 vnmlsDCode = '''
792 IntDoubleUnion cOp1, cOp2, cDest;
793 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
794 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
795 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
796 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
797 VfpSavedState state = prepVfpFpscr(Fpscr);
798 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
796 double mid = fixNan(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
799 double mid = fixDest(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
797 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
798 (isinf(cOp2.fp) && cOp1.fp == 0)) {
799 mid = NAN;
800 }
801 vfpFlushToZero(Fpscr, cDest.fp, mid);
800 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
801 (isinf(cOp2.fp) && cOp1.fp == 0)) {
802 mid = NAN;
803 }
804 vfpFlushToZero(Fpscr, cDest.fp, mid);
802 cDest.fp = fixNan(Fpscr, -cDest.fp + mid, cDest.fp, mid);
805 cDest.fp = fixDest(Fpscr, -cDest.fp + mid, cDest.fp, mid);
803 __asm__ __volatile__("" :: "m" (cDest.fp));
804 Fpscr = setVfpFpscr(Fpscr, state);
805 FpDestP0.uw = cDest.bits;
806 FpDestP1.uw = cDest.bits >> 32;
807 '''
808 vnmlsDIop = InstObjParams("vnmlsd", "VnmlsD", "VfpRegRegRegOp",
809 { "code": vnmlsDCode,
810 "predicate_test": predicateTest }, [])
811 header_output += VfpRegRegRegOpDeclare.subst(vnmlsDIop);
812 decoder_output += VfpRegRegRegOpConstructor.subst(vnmlsDIop);
813 exec_output += PredOpExecute.subst(vnmlsDIop);
814
815 vnmulSCode = '''
816 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
817 VfpSavedState state = prepVfpFpscr(Fpscr);
818 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
806 __asm__ __volatile__("" :: "m" (cDest.fp));
807 Fpscr = setVfpFpscr(Fpscr, state);
808 FpDestP0.uw = cDest.bits;
809 FpDestP1.uw = cDest.bits >> 32;
810 '''
811 vnmlsDIop = InstObjParams("vnmlsd", "VnmlsD", "VfpRegRegRegOp",
812 { "code": vnmlsDCode,
813 "predicate_test": predicateTest }, [])
814 header_output += VfpRegRegRegOpDeclare.subst(vnmlsDIop);
815 decoder_output += VfpRegRegRegOpConstructor.subst(vnmlsDIop);
816 exec_output += PredOpExecute.subst(vnmlsDIop);
817
818 vnmulSCode = '''
819 vfpFlushToZero(Fpscr, FpOp1, FpOp2);
820 VfpSavedState state = prepVfpFpscr(Fpscr);
821 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
819 float mid = fixNan(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
822 float mid = fixDest(Fpscr, FpOp1 * FpOp2, FpOp1, FpOp2);
820 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
821 mid = NAN;
822 }
823 FpDest = -mid;
824 __asm__ __volatile__("" :: "m" (FpDest));
825 Fpscr = setVfpFpscr(Fpscr, state);
826 '''
827 vnmulSIop = InstObjParams("vnmuls", "VnmulS", "VfpRegRegRegOp",

--- 6 unchanged lines hidden (view full) ---

834 vnmulDCode = '''
835 IntDoubleUnion cOp1, cOp2, cDest;
836 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
837 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
838 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
839 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
840 VfpSavedState state = prepVfpFpscr(Fpscr);
841 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
823 if ((isinf(FpOp1) && FpOp2 == 0) || (isinf(FpOp2) && FpOp1 == 0)) {
824 mid = NAN;
825 }
826 FpDest = -mid;
827 __asm__ __volatile__("" :: "m" (FpDest));
828 Fpscr = setVfpFpscr(Fpscr, state);
829 '''
830 vnmulSIop = InstObjParams("vnmuls", "VnmulS", "VfpRegRegRegOp",

--- 6 unchanged lines hidden (view full) ---

837 vnmulDCode = '''
838 IntDoubleUnion cOp1, cOp2, cDest;
839 cOp1.bits = ((uint64_t)FpOp1P0.uw | ((uint64_t)FpOp1P1.uw << 32));
840 cOp2.bits = ((uint64_t)FpOp2P0.uw | ((uint64_t)FpOp2P1.uw << 32));
841 cDest.bits = ((uint64_t)FpDestP0.uw | ((uint64_t)FpDestP1.uw << 32));
842 vfpFlushToZero(Fpscr, cOp1.fp, cOp2.fp);
843 VfpSavedState state = prepVfpFpscr(Fpscr);
844 __asm__ __volatile__("" : "=m" (cOp1.fp) : "m" (cOp1.fp));
842 double mid = fixNan(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
845 double mid = fixDest(Fpscr, cOp1.fp * cOp2.fp, cOp1.fp, cOp2.fp);
843 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
844 (isinf(cOp2.fp) && cOp1.fp == 0)) {
845 mid = NAN;
846 }
847 cDest.fp = -mid;
848 __asm__ __volatile__("" :: "m" (cDest.fp));
849 Fpscr = setVfpFpscr(Fpscr, state);
850 FpDestP0.uw = cDest.bits;

--- 617 unchanged lines hidden ---
846 if ((isinf(cOp1.fp) && cOp2.fp == 0) ||
847 (isinf(cOp2.fp) && cOp1.fp == 0)) {
848 mid = NAN;
849 }
850 cDest.fp = -mid;
851 __asm__ __volatile__("" :: "m" (cDest.fp));
852 Fpscr = setVfpFpscr(Fpscr, state);
853 FpDestP0.uw = cDest.bits;

--- 617 unchanged lines hidden ---