decoder.isa (13633:985e9c018cbf) decoder.isa (13653:079472978bca)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2015 RISC-V Foundation
4// Copyright (c) 2017 The University of Virginia
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are

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

507 0x2: LoadReserved::lr_w({{
508 Rd_sd = Mem_sw;
509 }}, mem_flags=LLSC);
510 0x3: StoreCond::sc_w({{
511 Mem_uw = Rs2_uw;
512 }}, {{
513 Rd = result;
514 }}, inst_flags=IsStoreConditional, mem_flags=LLSC);
1// -*- mode:c++ -*-
2
3// Copyright (c) 2015 RISC-V Foundation
4// Copyright (c) 2017 The University of Virginia
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are

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

507 0x2: LoadReserved::lr_w({{
508 Rd_sd = Mem_sw;
509 }}, mem_flags=LLSC);
510 0x3: StoreCond::sc_w({{
511 Mem_uw = Rs2_uw;
512 }}, {{
513 Rd = result;
514 }}, inst_flags=IsStoreConditional, mem_flags=LLSC);
515 format AtomicMemOp {
516 0x0: amoadd_w({{Rt_sd = Mem_sw;}}, {{
517 Mem_sw = Rs2_sw + Rt_sd;
518 Rd_sd = Rt_sd;
519 }}, {{EA = Rs1;}});
520 0x1: amoswap_w({{Rt_sd = Mem_sw;}}, {{
521 Mem_sw = Rs2_uw;
522 Rd_sd = Rt_sd;
523 }}, {{EA = Rs1;}});
524 0x4: amoxor_w({{Rt_sd = Mem_sw;}}, {{
525 Mem_sw = Rs2_uw^Rt_sd;
526 Rd_sd = Rt_sd;
527 }}, {{EA = Rs1;}});
528 0x8: amoor_w({{Rt_sd = Mem_sw;}}, {{
529 Mem_sw = Rs2_uw | Rt_sd;
530 Rd_sd = Rt_sd;
531 }}, {{EA = Rs1;}});
532 0xc: amoand_w({{Rt_sd = Mem_sw;}}, {{
533 Mem_sw = Rs2_uw&Rt_sd;
534 Rd_sd = Rt_sd;
535 }}, {{EA = Rs1;}});
536 0x10: amomin_w({{Rt_sd = Mem_sw;}}, {{
537 Mem_sw = min<int32_t>(Rs2_sw, Rt_sd);
538 Rd_sd = Rt_sd;
539 }}, {{EA = Rs1;}});
540 0x14: amomax_w({{Rt_sd = Mem_sw;}}, {{
541 Mem_sw = max<int32_t>(Rs2_sw, Rt_sd);
542 Rd_sd = Rt_sd;
543 }}, {{EA = Rs1;}});
544 0x18: amominu_w({{Rt_sd = Mem_sw;}}, {{
545 Mem_sw = min<uint32_t>(Rs2_uw, Rt_sd);
546 Rd_sd = Rt_sd;
547 }}, {{EA = Rs1;}});
548 0x1c: amomaxu_w({{Rt_sd = Mem_sw;}}, {{
549 Mem_sw = max<uint32_t>(Rs2_uw, Rt_sd);
550 Rd_sd = Rt_sd;
551 }}, {{EA = Rs1;}});
552 }
515 0x0: AtomicMemOp::amoadd_w({{
516 Rd_sd = Mem_sw;
517 }}, {{
518 TypedAtomicOpFunctor<int32_t> *amo_op =
519 new AtomicGenericOp<int32_t>(Rs2_sw,
520 [](int32_t* b, int32_t a){ *b += a; });
521 }}, mem_flags=ATOMIC_RETURN_OP);
522 0x1: AtomicMemOp::amoswap_w({{
523 Rd_sd = Mem_sw;
524 }}, {{
525 TypedAtomicOpFunctor<uint32_t> *amo_op =
526 new AtomicGenericOp<uint32_t>(Rs2_uw,
527 [](uint32_t* b, uint32_t a){ *b = a; });
528 }}, mem_flags=ATOMIC_RETURN_OP);
529 0x4: AtomicMemOp::amoxor_w({{
530 Rd_sd = Mem_sw;
531 }}, {{
532 TypedAtomicOpFunctor<uint32_t> *amo_op =
533 new AtomicGenericOp<uint32_t>(Rs2_uw,
534 [](uint32_t* b, uint32_t a){ *b ^= a; });
535 }}, mem_flags=ATOMIC_RETURN_OP);
536 0x8: AtomicMemOp::amoor_w({{
537 Rd_sd = Mem_sw;
538 }}, {{
539 TypedAtomicOpFunctor<uint32_t> *amo_op =
540 new AtomicGenericOp<uint32_t>(Rs2_uw,
541 [](uint32_t* b, uint32_t a){ *b |= a; });
542 }}, mem_flags=ATOMIC_RETURN_OP);
543 0xc: AtomicMemOp::amoand_w({{
544 Rd_sd = Mem_sw;
545 }}, {{
546 TypedAtomicOpFunctor<uint32_t> *amo_op =
547 new AtomicGenericOp<uint32_t>(Rs2_uw,
548 [](uint32_t* b, uint32_t a){ *b &= a; });
549 }}, mem_flags=ATOMIC_RETURN_OP);
550 0x10: AtomicMemOp::amomin_w({{
551 Rd_sd = Mem_sw;
552 }}, {{
553 TypedAtomicOpFunctor<int32_t> *amo_op =
554 new AtomicGenericOp<int32_t>(Rs2_sw,
555 [](int32_t* b, int32_t a){ if (a < *b) *b = a; });
556 }}, mem_flags=ATOMIC_RETURN_OP);
557 0x14: AtomicMemOp::amomax_w({{
558 Rd_sd = Mem_sw;
559 }}, {{
560 TypedAtomicOpFunctor<int32_t> *amo_op =
561 new AtomicGenericOp<int32_t>(Rs2_sw,
562 [](int32_t* b, int32_t a){ if (a > *b) *b = a; });
563 }}, mem_flags=ATOMIC_RETURN_OP);
564 0x18: AtomicMemOp::amominu_w({{
565 Rd_sd = Mem_sw;
566 }}, {{
567 TypedAtomicOpFunctor<uint32_t> *amo_op =
568 new AtomicGenericOp<uint32_t>(Rs2_uw,
569 [](uint32_t* b, uint32_t a){ if (a < *b) *b = a; });
570 }}, mem_flags=ATOMIC_RETURN_OP);
571 0x1c: AtomicMemOp::amomaxu_w({{
572 Rd_sd = Mem_sw;
573 }}, {{
574 TypedAtomicOpFunctor<uint32_t> *amo_op =
575 new AtomicGenericOp<uint32_t>(Rs2_uw,
576 [](uint32_t* b, uint32_t a){ if (a > *b) *b = a; });
577 }}, mem_flags=ATOMIC_RETURN_OP);
553 }
554 0x3: decode AMOFUNCT {
555 0x2: LoadReserved::lr_d({{
556 Rd_sd = Mem_sd;
557 }}, mem_flags=LLSC);
558 0x3: StoreCond::sc_d({{
559 Mem = Rs2;
560 }}, {{
561 Rd = result;
562 }}, mem_flags=LLSC, inst_flags=IsStoreConditional);
578 }
579 0x3: decode AMOFUNCT {
580 0x2: LoadReserved::lr_d({{
581 Rd_sd = Mem_sd;
582 }}, mem_flags=LLSC);
583 0x3: StoreCond::sc_d({{
584 Mem = Rs2;
585 }}, {{
586 Rd = result;
587 }}, mem_flags=LLSC, inst_flags=IsStoreConditional);
563 format AtomicMemOp {
564 0x0: amoadd_d({{Rt_sd = Mem_sd;}}, {{
565 Mem_sd = Rs2_sd + Rt_sd;
566 Rd_sd = Rt_sd;
567 }}, {{EA = Rs1;}});
568 0x1: amoswap_d({{Rt = Mem;}}, {{
569 Mem = Rs2;
570 Rd = Rt;
571 }}, {{EA = Rs1;}});
572 0x4: amoxor_d({{Rt = Mem;}}, {{
573 Mem = Rs2^Rt;
574 Rd = Rt;
575 }}, {{EA = Rs1;}});
576 0x8: amoor_d({{Rt = Mem;}}, {{
577 Mem = Rs2 | Rt;
578 Rd = Rt;
579 }}, {{EA = Rs1;}});
580 0xc: amoand_d({{Rt = Mem;}}, {{
581 Mem = Rs2&Rt;
582 Rd = Rt;
583 }}, {{EA = Rs1;}});
584 0x10: amomin_d({{Rt_sd = Mem_sd;}}, {{
585 Mem_sd = min(Rs2_sd, Rt_sd);
586 Rd_sd = Rt_sd;
587 }}, {{EA = Rs1;}});
588 0x14: amomax_d({{Rt_sd = Mem_sd;}}, {{
589 Mem_sd = max(Rs2_sd, Rt_sd);
590 Rd_sd = Rt_sd;
591 }}, {{EA = Rs1;}});
592 0x18: amominu_d({{Rt = Mem;}}, {{
593 Mem = min(Rs2, Rt);
594 Rd = Rt;
595 }}, {{EA = Rs1;}});
596 0x1c: amomaxu_d({{Rt = Mem;}}, {{
597 Mem = max(Rs2, Rt);
598 Rd = Rt;
599 }}, {{EA = Rs1;}});
600 }
588 0x0: AtomicMemOp::amoadd_d({{
589 Rd_sd = Mem_sd;
590 }}, {{
591 TypedAtomicOpFunctor<int64_t> *amo_op =
592 new AtomicGenericOp<int64_t>(Rs2_sd,
593 [](int64_t* b, int64_t a){ *b += a; });
594 }}, mem_flags=ATOMIC_RETURN_OP);
595 0x1: AtomicMemOp::amoswap_d({{
596 Rd_sd = Mem_sd;
597 }}, {{
598 TypedAtomicOpFunctor<uint64_t> *amo_op =
599 new AtomicGenericOp<uint64_t>(Rs2_ud,
600 [](uint64_t* b, uint64_t a){ *b = a; });
601 }}, mem_flags=ATOMIC_RETURN_OP);
602 0x4: AtomicMemOp::amoxor_d({{
603 Rd_sd = Mem_sd;
604 }}, {{
605 TypedAtomicOpFunctor<uint64_t> *amo_op =
606 new AtomicGenericOp<uint64_t>(Rs2_ud,
607 [](uint64_t* b, uint64_t a){ *b ^= a; });
608 }}, mem_flags=ATOMIC_RETURN_OP);
609 0x8: AtomicMemOp::amoor_d({{
610 Rd_sd = Mem_sd;
611 }}, {{
612 TypedAtomicOpFunctor<uint64_t> *amo_op =
613 new AtomicGenericOp<uint64_t>(Rs2_ud,
614 [](uint64_t* b, uint64_t a){ *b |= a; });
615 }}, mem_flags=ATOMIC_RETURN_OP);
616 0xc: AtomicMemOp::amoand_d({{
617 Rd_sd = Mem_sd;
618 }}, {{
619 TypedAtomicOpFunctor<uint64_t> *amo_op =
620 new AtomicGenericOp<uint64_t>(Rs2_ud,
621 [](uint64_t* b, uint64_t a){ *b &= a; });
622 }}, mem_flags=ATOMIC_RETURN_OP);
623 0x10: AtomicMemOp::amomin_d({{
624 Rd_sd = Mem_sd;
625 }}, {{
626 TypedAtomicOpFunctor<int64_t> *amo_op =
627 new AtomicGenericOp<int64_t>(Rs2_sd,
628 [](int64_t* b, int64_t a){ if (a < *b) *b = a; });
629 }}, mem_flags=ATOMIC_RETURN_OP);
630 0x14: AtomicMemOp::amomax_d({{
631 Rd_sd = Mem_sd;
632 }}, {{
633 TypedAtomicOpFunctor<int64_t> *amo_op =
634 new AtomicGenericOp<int64_t>(Rs2_sd,
635 [](int64_t* b, int64_t a){ if (a > *b) *b = a; });
636 }}, mem_flags=ATOMIC_RETURN_OP);
637 0x18: AtomicMemOp::amominu_d({{
638 Rd_sd = Mem_sd;
639 }}, {{
640 TypedAtomicOpFunctor<uint64_t> *amo_op =
641 new AtomicGenericOp<uint64_t>(Rs2_ud,
642 [](uint64_t* b, uint64_t a){ if (a < *b) *b = a; });
643 }}, mem_flags=ATOMIC_RETURN_OP);
644 0x1c: AtomicMemOp::amomaxu_d({{
645 Rd_sd = Mem_sd;
646 }}, {{
647 TypedAtomicOpFunctor<uint64_t> *amo_op =
648 new AtomicGenericOp<uint64_t>(Rs2_ud,
649 [](uint64_t* b, uint64_t a){ if (a > *b) *b = a; });
650 }}, mem_flags=ATOMIC_RETURN_OP);
601 }
602 }
603 0x0c: decode FUNCT3 {
604 format ROp {
605 0x0: decode FUNCT7 {
606 0x0: add({{
607 Rd = Rs1_sd + Rs2_sd;
608 }});

--- 1177 unchanged lines hidden ---
651 }
652 }
653 0x0c: decode FUNCT3 {
654 format ROp {
655 0x0: decode FUNCT7 {
656 0x0: add({{
657 Rd = Rs1_sd + Rs2_sd;
658 }});

--- 1177 unchanged lines hidden ---