cmp4 Operation Font Conventions
if
(PR[qp]) {
if (p1 == p2)
illegal_operation_fault();
tmp_nat = (register_form ? GR[r2].nat : 0) || GR[r3].nat;
if (register_form)
tmp_src = GR[r2];
else if (imm8_form)
tmp_src = (imm8, 8);
else // parallel_inequality_form
tmp_src = 0;
if (crel == ‘eq') tmp_rel = tmp_src{31:0}
== GR[r3]{31:0};
else if (crel == ‘ne') tmp_rel = tmp_src{31:0} != GR[r3]{31:0};
else if (crel == ‘lt')
tmp_rel = lesser_signed(sign_ext(tmp_src, 32), sign_ext(GR[r3],
32));
else if (crel == ‘le')
tmp_rel = lesser_equal_signed(sign_ext(tmp_src, 32), sign_ext(GR[r3],
32));
else if (crel == ‘gt')
tmp_rel = greater_signed(sign_ext(tmp_src, 32), sign_ext(GR[r3],
32));
else if (crel == ‘ge')
tmp_rel = greater_equal_signed(sign_ext(tmp_src, 32), sign_ext(GR[r3],
32));
else if (crel == ‘ltu')
tmp_rel = lesser(zero_ext(tmp_src, 32), zero_ext(GR[r3], 32));
else if (crel == ‘leu')
tmp_rel = lesser_equal(zero_ext(tmp_src, 32), zero_ext(GR[r3], 32));
else if (crel == ‘gtu')
tmp_rel = greater(zero_ext(tmp_src, 32), zero_ext(GR[r3], 32));
else // ‘geu'
tmp_rel = greater_equal(zero_ext(tmp_src, 32), zero_ext(GR[r3],
32));
switch (ctype) {
case ‘and': // and-type compare
if (tmp_nat || !tmp_rel) {
PR[p1] = 0;
PR[p2] = 0;
}
break;
case ‘or': // or-type compare
if (!tmp_nat && tmp_rel) {
PR[p1] = 1;
PR[p2] = 1;
}
break;
case ‘or.andcm': // or.andcm-type compare
if (!tmp_nat && tmp_rel) {
PR[p1] = 1;
PR[p2] = 0;
}
break;
case ‘unc': // unc-type compare
default: // normal compare
if (tmp_nat) {
PR[p1] = 0;
PR[p2] = 0;
} else {
PR[p1] = tmp_rel;
PR[p2] = !tmp_rel;
}
break;
}
} else {
if (ctype == ‘unc') {
if (p1 == p2)
illegal_operation_fault();
PR[p1] = 0;
PR[p2] = 0;
}
}