Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: src/s390/simulator-s390.cc

Issue 2226103002: PPC/s390: Implement VisitFloat32Neg/VisitFloat64Neg and instr lcebr for s390 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/s390/disasm-s390.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/simulator-s390.cc
diff --git a/src/s390/simulator-s390.cc b/src/s390/simulator-s390.cc
index 1932d297de91bdaeeae04a3f50022040e4a65a7b..89aaa943b370fbe49f25d018a7db5c6687a0253c 100644
--- a/src/s390/simulator-s390.cc
+++ b/src/s390/simulator-s390.cc
@@ -4154,6 +4154,7 @@ bool Simulator::DecodeFourByteFloatingPoint(Instruction* instr) {
case CFEBR:
case CEFBR:
case LCDBR:
+ case LCEBR:
case LPDBR:
case LPEBR: {
RREInstruction* rreInstr = reinterpret_cast<RREInstruction*>(instr);
@@ -4260,6 +4261,18 @@ bool Simulator::DecodeFourByteFloatingPoint(Instruction* instr) {
} else if (r2_val > 0) {
condition_reg_ = CC_GT;
}
+ } else if (op == LCEBR) {
+ fr1_val = -fr2_val;
+ set_d_register_from_float32(r1, fr1_val);
+ if (fr2_val != fr2_val) { // input is NaN
+ condition_reg_ = CC_OF;
+ } else if (fr2_val == 0) {
+ condition_reg_ = CC_EQ;
+ } else if (fr2_val < 0) {
+ condition_reg_ = CC_LT;
+ } else if (fr2_val > 0) {
+ condition_reg_ = CC_GT;
+ }
} else if (op == LPDBR) {
r1_val = std::fabs(r2_val);
set_d_register_from_double(r1, r1_val);
@@ -8499,9 +8512,22 @@ EVALUATE(LTEBR) {
}
EVALUATE(LCEBR) {
- UNIMPLEMENTED();
- USE(instr);
- return 0;
+ DCHECK_OPCODE(LCEBR);
+ DECODE_RRE_INSTRUCTION(r1, r2);
+ float fr1_val = get_float32_from_d_register(r1);
+ float fr2_val = get_float32_from_d_register(r2);
+ fr1_val = -fr2_val;
+ set_d_register_from_float32(r1, fr1_val);
+ if (fr2_val != fr2_val) { // input is NaN
+ condition_reg_ = CC_OF;
+ } else if (fr2_val == 0) {
+ condition_reg_ = CC_EQ;
+ } else if (fr2_val < 0) {
+ condition_reg_ = CC_LT;
+ } else if (fr2_val > 0) {
+ condition_reg_ = CC_GT;
+ }
+ return length;
}
EVALUATE(LDEBR) {
« no previous file with comments | « src/s390/disasm-s390.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698