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) { ...@@ -260,28 +260,28 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
// unsigned number never less than 0 // unsigned number never less than 0
if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64) if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
return CC_NOP; return CC_NOP;
// fall through V8_FALLTHROUGH;
case kSignedLessThan: case kSignedLessThan:
return lt; return lt;
case kUnsignedGreaterThanOrEqual: case kUnsignedGreaterThanOrEqual:
// unsigned number always greater than or equal 0 // unsigned number always greater than or equal 0
if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64) if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
return CC_ALWAYS; return CC_ALWAYS;
// fall through V8_FALLTHROUGH;
case kSignedGreaterThanOrEqual: case kSignedGreaterThanOrEqual:
return ge; return ge;
case kUnsignedLessThanOrEqual: case kUnsignedLessThanOrEqual:
// unsigned number never less than 0 // unsigned number never less than 0
if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64) if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
return CC_EQ; return CC_EQ;
// fall through V8_FALLTHROUGH;
case kSignedLessThanOrEqual: case kSignedLessThanOrEqual:
return le; return le;
case kUnsignedGreaterThan: case kUnsignedGreaterThan:
// unsigned number always greater than or equal 0 // unsigned number always greater than or equal 0
if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64) if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
return ne; return ne;
// fall through V8_FALLTHROUGH;
case kSignedGreaterThan: case kSignedGreaterThan:
return gt; return gt;
case kOverflow: case kOverflow:
......
...@@ -269,6 +269,7 @@ int Decoder::FormatOption(Instruction* instr, const char* format) { ...@@ -269,6 +269,7 @@ int Decoder::FormatOption(Instruction* instr, const char* format) {
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off)); converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
return 8; return 8;
} }
break;
case 's': { case 's': {
DCHECK_EQ(format[1], 'h'); DCHECK_EQ(format[1], 'h');
int32_t value = 0; int32_t value = 0;
......
...@@ -2155,50 +2155,50 @@ void Simulator::ExecuteGeneric(Instruction* instr) { ...@@ -2155,50 +2155,50 @@ void Simulator::ExecuteGeneric(Instruction* instr) {
} }
break; break;
} }
case STFSUX: { case STFSUX: V8_FALLTHROUGH;
case STFSX: case STFSX: {
int frs = instr->RSValue(); int frs = instr->RSValue();
int ra = instr->RAValue(); int ra = instr->RAValue();
int rb = instr->RBValue(); int rb = instr->RBValue();
intptr_t ra_val = ra == 0 ? 0 : get_register(ra); intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
intptr_t rb_val = get_register(rb); intptr_t rb_val = get_register(rb);
float frs_val = static_cast<float>(get_double_from_d_register(frs)); float frs_val = static_cast<float>(get_double_from_d_register(frs));
int32_t* p = reinterpret_cast<int32_t*>(&frs_val); int32_t* p = reinterpret_cast<int32_t*>(&frs_val);
#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
// Conversion using double changes sNan to qNan on ia32/x64 // Conversion using double changes sNan to qNan on ia32/x64
int32_t sval = 0; int32_t sval = 0;
int64_t dval = get_d_register(frs); int64_t dval = get_d_register(frs);
if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) { if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) {
sval = ((dval & 0xC000000000000000) >> 32) | sval = ((dval & 0xC000000000000000) >> 32) |
((dval & 0x07FFFFFFE0000000) >> 29); ((dval & 0x07FFFFFFE0000000) >> 29);
p = &sval; p = &sval;
} else { } else {
p = reinterpret_cast<int32_t*>(&frs_val);
}
#else
p = reinterpret_cast<int32_t*>(&frs_val); p = reinterpret_cast<int32_t*>(&frs_val);
}
#else
p = reinterpret_cast<int32_t*>(&frs_val);
#endif #endif
WriteW(ra_val + rb_val, *p, instr); WriteW(ra_val + rb_val, *p, instr);
if (opcode == STFSUX) { if (opcode == STFSUX) {
DCHECK_NE(ra, 0); DCHECK_NE(ra, 0);
set_register(ra, ra_val + rb_val); set_register(ra, ra_val + rb_val);
} }
break; break;
} }
case STFDUX: { case STFDUX: V8_FALLTHROUGH;
case STFDX: case STFDX: {
int frs = instr->RSValue(); int frs = instr->RSValue();
int ra = instr->RAValue(); int ra = instr->RAValue();
int rb = instr->RBValue(); int rb = instr->RBValue();
intptr_t ra_val = ra == 0 ? 0 : get_register(ra); intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
intptr_t rb_val = get_register(rb); intptr_t rb_val = get_register(rb);
int64_t frs_val = get_d_register(frs); int64_t frs_val = get_d_register(frs);
WriteDW(ra_val + rb_val, frs_val); WriteDW(ra_val + rb_val, frs_val);
if (opcode == STFDUX) { if (opcode == STFDUX) {
DCHECK_NE(ra, 0); DCHECK_NE(ra, 0);
set_register(ra, ra_val + rb_val); set_register(ra, ra_val + rb_val);
} }
break; break;
} }
case POPCNTW: { case POPCNTW: {
int rs = instr->RSValue(); int rs = instr->RSValue();
...@@ -3214,36 +3214,35 @@ void Simulator::ExecuteGeneric(Instruction* instr) { ...@@ -3214,36 +3214,35 @@ void Simulator::ExecuteGeneric(Instruction* instr) {
break; break;
} }
case STFSU: { case STFSU: V8_FALLTHROUGH;
case STFS: case STFS: {
int frs = instr->RSValue(); int frs = instr->RSValue();
int ra = instr->RAValue(); int ra = instr->RAValue();
int32_t offset = SIGN_EXT_IMM16(instr->Bits(15, 0)); int32_t offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
intptr_t ra_val = ra == 0 ? 0 : get_register(ra); intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
float frs_val = static_cast<float>(get_double_from_d_register(frs)); float frs_val = static_cast<float>(get_double_from_d_register(frs));
int32_t* p; int32_t* p;
#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
// Conversion using double changes sNan to qNan on ia32/x64 // Conversion using double changes sNan to qNan on ia32/x64
int32_t sval = 0; int32_t sval = 0;
int64_t dval = get_d_register(frs); int64_t dval = get_d_register(frs);
if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) { if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) {
sval = ((dval & 0xC000000000000000) >> 32) | sval = ((dval & 0xC000000000000000) >> 32) |
((dval & 0x07FFFFFFE0000000) >> 29); ((dval & 0x07FFFFFFE0000000) >> 29);
p = &sval; p = &sval;
} else { } else {
p = reinterpret_cast<int32_t*>(&frs_val);
}
#else
p = reinterpret_cast<int32_t*>(&frs_val); p = reinterpret_cast<int32_t*>(&frs_val);
}
#else
p = reinterpret_cast<int32_t*>(&frs_val);
#endif #endif
WriteW(ra_val + offset, *p, instr); WriteW(ra_val + offset, *p, instr);
if (opcode == STFSU) { if (opcode == STFSU) {
DCHECK_NE(ra, 0); DCHECK_NE(ra, 0);
set_register(ra, ra_val + offset); set_register(ra, ra_val + offset);
} }
break; break;
} }
case STFDU: case STFDU:
case STFD: { case STFD: {
int frs = instr->RSValue(); int frs = instr->RSValue();
......
...@@ -288,6 +288,7 @@ int Decoder::FormatOption(Instruction* instr, const char* format) { ...@@ -288,6 +288,7 @@ int Decoder::FormatOption(Instruction* instr, const char* format) {
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off)); converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
return 8; return 8;
} }
break;
case 'm': { case 'm': {
return FormatMask(instr, format); 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