1// -*- mode:c++ -*-
2
3// Copyright (c) 2006 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

149 0x1: mthi({{ HI = Rs; }});
150 0x2: mflo({{ Rd = LO; }});
151 0x3: mtlo({{ LO = Rs; }});
152 }
153 }
154
155 0x3: decode FUNCTION_LO {
156 format HiLoOp {
157 0x0: mult({{ val = Rs.sd * Rt.sd; }});
158 0x1: multu({{ val = Rs.ud * Rt.ud; }});
159 }
160
161 format HiLoMiscOp {
162 0x2: div({{ if (Rt.sd != 0) {
163 HI = Rs.sd % Rt.sd;
164 LO = Rs.sd / Rt.sd;
157 0x0: mult({{ int64_t val = Rs.sd * Rt.sd; }});
158 0x1: multu({{ uint64_t val = Rs.ud * Rt.ud; }});
159 0x2: div({{ int64_t val;
160 if (Rt.sd != 0) {
161 int64_t hi = Rs.sd % Rt.sd;
162 int64_t lo = Rs.sd / Rt.sd;
163 val = (hi << 32) | lo;
164 }
165 }});
167 0x3: divu({{ if (Rt.ud != 0) {
168 HI = Rs.ud % Rt.ud;
169 LO = Rs.ud / Rt.ud;
166 0x3: divu({{ uint64_t val;
167 if (Rt.ud != 0) {
168 uint64_t hi = Rs.ud % Rt.ud;
169 uint64_t lo = Rs.ud / Rt.ud;
170 val = (hi << 32) | lo;
171 }
172 }});
173 }
174 }
175
176 0x4: decode HINT {
177 0x0: decode FUNCTION_LO {
178 format IntOp {

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

946 //Table A-5 MIPS32 SPECIAL2 Encoding of Function Field
947 0x4: decode FUNCTION_HI {
948 0x0: decode FUNCTION_LO {
949 0x2: IntOp::mul({{ int64_t temp1 = Rs.sd * Rt.sd;
950 Rd.sw = temp1<31:0>
951 }});
952
953 format HiLoOp {
953 0x0: madd({{ val = ((int64_t) HI << 32 | LO) +
954 (Rs.sd * Rt.sd);
954 0x0: madd({{ int64_t val = ((int64_t) HI << 32 | LO) +
955 (Rs.sd * Rt.sd);
956 }});
956 0x1: maddu({{ val = ((uint64_t) HI << 32 | LO) +
957 (Rs.ud * Rt.ud);
957 0x1: maddu({{ uint64_t val = ((uint64_t) HI << 32 | LO) +
958 (Rs.ud * Rt.ud);
959 }});
959 0x4: msub({{ val = ((int64_t) HI << 32 | LO) -
960 (Rs.sd * Rt.sd);
960 0x4: msub({{ int64_t val = ((int64_t) HI << 32 | LO) -
961 (Rs.sd * Rt.sd);
962 }});
962 0x5: msubu({{ val = ((uint64_t) HI << 32 | LO) -
963 (Rs.ud * Rt.ud);
963 0x5: msubu({{ uint64_t val = ((uint64_t) HI << 32 | LO) -
964 (Rs.ud * Rt.ud);
965 }});
966 }
967 }
968
969 0x4: decode FUNCTION_LO {
970 format BasicOp {
971 0x0: clz({{ int cnt = 32;
972 for (int idx = 31; idx >= 0; idx--) {

--- 131 unchanged lines hidden ---