fp.isa (13738:84439021dcf6) fp.isa (13979:1e0c4607ac12)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010-2013,2016,2018-2019 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

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

573 "fpAddD")
574 buildBinFpOp("vsub", "Vsub", "FpRegRegRegOp", "SimdFloatAddOp", "fpSubS",
575 "fpSubD")
576 buildBinFpOp("vdiv", "Vdiv", "FpRegRegRegOp", "SimdFloatDivOp", "fpDivS",
577 "fpDivD")
578 buildBinFpOp("vmul", "Vmul", "FpRegRegRegOp", "SimdFloatMultOp", "fpMulS",
579 "fpMulD")
580
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010-2013,2016,2018-2019 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

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

573 "fpAddD")
574 buildBinFpOp("vsub", "Vsub", "FpRegRegRegOp", "SimdFloatAddOp", "fpSubS",
575 "fpSubD")
576 buildBinFpOp("vdiv", "Vdiv", "FpRegRegRegOp", "SimdFloatDivOp", "fpDivS",
577 "fpDivD")
578 buildBinFpOp("vmul", "Vmul", "FpRegRegRegOp", "SimdFloatMultOp", "fpMulS",
579 "fpMulD")
580
581 def buildBinOp(name, base, opClass, op):
582 '''
583 Create backported aarch64 instructions that use fplib.
584
585 Because they are backported, these instructions are unconditional.
586 '''
587 global header_output, decoder_output, exec_output
588 inst_datas = [
589 (
590 "s",
591 '''
592 FpDest_uw = fplib%(op)s<>(FpOp1_uw, FpOp2_uw, fpscr);
593 '''
594 ),
595 (
596 "d",
597 '''
598 uint64_t op1 = ((uint64_t)FpOp1P0_uw |
599 ((uint64_t)FpOp1P1_uw << 32));
600 uint64_t op2 = ((uint64_t)FpOp2P0_uw |
601 ((uint64_t)FpOp2P1_uw << 32));
602 uint64_t dest = fplib%(op)s<>(op1, op2, fpscr);
603 FpDestP0_uw = dest;
604 FpDestP1_uw = dest >> 32;
605 '''
606 )
607 ]
608 Name = name[0].upper() + name[1:]
609 declareTempl = eval(base + "Declare");
610 constructorTempl = eval(base + "Constructor");
611 for size_suffix, code in inst_datas:
612 code = (
613 '''
614 FPSCR fpscr = (FPSCR)FpscrExc;
615 ''' +
616 code +
617 '''
618 FpscrExc = fpscr;
619 '''
620 )
621 iop = InstObjParams(
622 name + size_suffix,
623 Name + size_suffix.upper(),
624 base,
625 {
626 "code": code % {"op": op},
627 "op_class": opClass
628 },
629 []
630 )
631 header_output += declareTempl.subst(iop)
632 decoder_output += constructorTempl.subst(iop)
633 exec_output += BasicExecute.subst(iop)
634 ops = [
635 ("vminnm", "FpRegRegRegOp", "SimdFloatCmpOp", "MinNum"),
636 ("vmaxnm", "FpRegRegRegOp", "SimdFloatCmpOp", "MaxNum"),
637 ]
638 for op in ops:
639 buildBinOp(*op)
640
581 def buildUnaryFpOp(name, Name, base, opClass, singleOp, doubleOp = None):
582 if doubleOp is None:
583 doubleOp = singleOp
584 global header_output, decoder_output, exec_output
585
586 code = singleCode % { "op": singleUnaryOp }
587 code = code % { "func": singleOp }
588 sIop = InstObjParams(name + "s", Name + "S", base,

--- 1197 unchanged lines hidden ---
641 def buildUnaryFpOp(name, Name, base, opClass, singleOp, doubleOp = None):
642 if doubleOp is None:
643 doubleOp = singleOp
644 global header_output, decoder_output, exec_output
645
646 code = singleCode % { "op": singleUnaryOp }
647 code = code % { "func": singleOp }
648 sIop = InstObjParams(name + "s", Name + "S", base,

--- 1197 unchanged lines hidden ---