181: stdux({{ Mem = Rs; }});
}
+ format IntArithOp {
+ 779: modsw({{
+ int64_t src1 = Ra_sw;
+ int64_t src2 = Rb_sw;
+ if ((src1 != INT32_MIN || src2 != -1) && src2 != 0) {
+ Rt = src1 % src2;
+ } else {
+ Rt = 0;
+ }
+ }});
+
+ 267: moduw({{
+ uint64_t src1 = Ra_uw;
+ uint64_t src2 = Rb_uw;
+ if (src2 != 0) {
+ Rt = src1 % src2;
+ } else {
+ Rt = 0;
+ }
+ }});
+ }
+
format IntOp {
0: cmp({{
Xer xer = XER;
// Arithmetic instructions all use source registers Ra and Rb,
// with destination register Rt.
- format IntArithOp {
+ format IntArithCheckRcOp {
75: mulhw({{
uint64_t res = (int64_t)Ra_sw * Rb_sw;
res = res >> 32;
}};
+// Instructions that use source registers Ra and Rb, with the result
+// placed into Rt but do not check for carry, overflow or the Rc bit.
+def format IntArithOp(code, inst_flags = []) {{
+
+ # Generate the class
+ (header_output, decoder_output, decode_block, exec_output) = \
+ GenAluOp(name, Name, 'IntArithOp', code, inst_flags, BasicDecode,
+ BasicConstructor)
+}};
+
+
// Instructions that use source registers Ra and Rb, with the result
// placed into Rt. Basically multiply and divide instructions. The
// carry bit is never set, but overflow can be calculated. In certain
// each instruction to deal with different combinations of having the
// OE bit set or unset and the Rc bit set or unset too. Otherwise, we
// generate two versions of each instruction to deal with the Rc bit.
-def format IntArithOp(code, computeOV = 0, inst_flags = []) {{
+def format IntArithCheckRcOp(code, computeOV = 0, inst_flags = []) {{
# The result is always in Rt, but the source values vary
dict = {'result':'Rt', 'inputa':'src1', 'inputb':'src2'}