Commit 51958ed9 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

Make v8 build with -Wimplicit-fallthrough in ppc and s390 configs.

R=joransiu@ca.ibm.com

Change-Id: I1377d90de81eb5f0ecfe9318c3126f55fb36cac2
Reviewed-on: https://chromium-review.googlesource.com/929753Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#51451}
parent 2fa76332
......@@ -260,28 +260,28 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
// unsigned number never less than 0
if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
return CC_NOP;
// fall through
V8_FALLTHROUGH;
case kSignedLessThan:
return lt;
case kUnsignedGreaterThanOrEqual:
// unsigned number always greater than or equal 0
if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
return CC_ALWAYS;
// fall through
V8_FALLTHROUGH;
case kSignedGreaterThanOrEqual:
return ge;
case kUnsignedLessThanOrEqual:
// unsigned number never less than 0
if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
return CC_EQ;
// fall through
V8_FALLTHROUGH;
case kSignedLessThanOrEqual:
return le;
case kUnsignedGreaterThan:
// unsigned number always greater than or equal 0
if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
return ne;
// fall through
V8_FALLTHROUGH;
case kSignedGreaterThan:
return gt;
case kOverflow:
......
......@@ -269,6 +269,7 @@ int Decoder::FormatOption(Instruction* instr, const char* format) {
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
return 8;
}
break;
case 's': {
DCHECK_EQ(format[1], 'h');
int32_t value = 0;
......
......@@ -2155,50 +2155,50 @@ void Simulator::ExecuteGeneric(Instruction* instr) {
}
break;
}
case STFSUX: {
case STFSX:
int frs = instr->RSValue();
int ra = instr->RAValue();
int rb = instr->RBValue();
intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
intptr_t rb_val = get_register(rb);
float frs_val = static_cast<float>(get_double_from_d_register(frs));
int32_t* p = reinterpret_cast<int32_t*>(&frs_val);
case STFSUX: V8_FALLTHROUGH;
case STFSX: {
int frs = instr->RSValue();
int ra = instr->RAValue();
int rb = instr->RBValue();
intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
intptr_t rb_val = get_register(rb);
float frs_val = static_cast<float>(get_double_from_d_register(frs));
int32_t* p = reinterpret_cast<int32_t*>(&frs_val);
#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
// Conversion using double changes sNan to qNan on ia32/x64
int32_t sval = 0;
int64_t dval = get_d_register(frs);
if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) {
sval = ((dval & 0xC000000000000000) >> 32) |
((dval & 0x07FFFFFFE0000000) >> 29);
p = &sval;
} else {
p = reinterpret_cast<int32_t*>(&frs_val);
}
#else
// Conversion using double changes sNan to qNan on ia32/x64
int32_t sval = 0;
int64_t dval = get_d_register(frs);
if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) {
sval = ((dval & 0xC000000000000000) >> 32) |
((dval & 0x07FFFFFFE0000000) >> 29);
p = &sval;
} else {
p = reinterpret_cast<int32_t*>(&frs_val);
}
#else
p = reinterpret_cast<int32_t*>(&frs_val);
#endif
WriteW(ra_val + rb_val, *p, instr);
if (opcode == STFSUX) {
DCHECK_NE(ra, 0);
set_register(ra, ra_val + rb_val);
}
break;
WriteW(ra_val + rb_val, *p, instr);
if (opcode == STFSUX) {
DCHECK_NE(ra, 0);
set_register(ra, ra_val + rb_val);
}
break;
}
case STFDUX: {
case STFDX:
int frs = instr->RSValue();
int ra = instr->RAValue();
int rb = instr->RBValue();
intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
intptr_t rb_val = get_register(rb);
int64_t frs_val = get_d_register(frs);
WriteDW(ra_val + rb_val, frs_val);
if (opcode == STFDUX) {
DCHECK_NE(ra, 0);
set_register(ra, ra_val + rb_val);
}
break;
case STFDUX: V8_FALLTHROUGH;
case STFDX: {
int frs = instr->RSValue();
int ra = instr->RAValue();
int rb = instr->RBValue();
intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
intptr_t rb_val = get_register(rb);
int64_t frs_val = get_d_register(frs);
WriteDW(ra_val + rb_val, frs_val);
if (opcode == STFDUX) {
DCHECK_NE(ra, 0);
set_register(ra, ra_val + rb_val);
}
break;
}
case POPCNTW: {
int rs = instr->RSValue();
......@@ -3214,36 +3214,35 @@ void Simulator::ExecuteGeneric(Instruction* instr) {
break;
}
case STFSU: {
case STFS:
int frs = instr->RSValue();
int ra = instr->RAValue();
int32_t offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
float frs_val = static_cast<float>(get_double_from_d_register(frs));
int32_t* p;
case STFSU: V8_FALLTHROUGH;
case STFS: {
int frs = instr->RSValue();
int ra = instr->RAValue();
int32_t offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
float frs_val = static_cast<float>(get_double_from_d_register(frs));
int32_t* p;
#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
// Conversion using double changes sNan to qNan on ia32/x64
int32_t sval = 0;
int64_t dval = get_d_register(frs);
if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) {
sval = ((dval & 0xC000000000000000) >> 32) |
((dval & 0x07FFFFFFE0000000) >> 29);
p = &sval;
} else {
p = reinterpret_cast<int32_t*>(&frs_val);
}
#else
// Conversion using double changes sNan to qNan on ia32/x64
int32_t sval = 0;
int64_t dval = get_d_register(frs);
if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) {
sval = ((dval & 0xC000000000000000) >> 32) |
((dval & 0x07FFFFFFE0000000) >> 29);
p = &sval;
} else {
p = reinterpret_cast<int32_t*>(&frs_val);
}
#else
p = reinterpret_cast<int32_t*>(&frs_val);
#endif
WriteW(ra_val + offset, *p, instr);
if (opcode == STFSU) {
DCHECK_NE(ra, 0);
set_register(ra, ra_val + offset);
}
break;
WriteW(ra_val + offset, *p, instr);
if (opcode == STFSU) {
DCHECK_NE(ra, 0);
set_register(ra, ra_val + offset);
}
break;
}
case STFDU:
case STFD: {
int frs = instr->RSValue();
......
......@@ -288,6 +288,7 @@ int Decoder::FormatOption(Instruction* instr, const char* format) {
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
return 8;
}
break;
case 'm': {
return FormatMask(instr, format);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment