Skip to content

Commit 6bee961

Browse files
author
Sagar Thakur
committedJul 13, 2015
[LLDB][MIPS] Add mips cores in cores_match () in ArchSpec
This patch: - Allows mips32 cores to match with any mips32/mips64 cores. - Allows mips32r2 cores to match with core only up-to mips32r2/mips64r2. - Allows mips32r3 cores to match with core only up-to mips32r3/mips64r3. - Allows mips32r5 cores to match with core only up-to mips32r3/mips64r5. - Allows mips32r6 core to match with only mips32r6/mips64r6 or mips32/mips64. Reviewers: emaste, jaydeep, clayborg Subscribers: mohit.bhakkad, nitesh.jain, bhushan, lldb-commits Differential Revision: http://reviews.llvm.org/D10921 llvm-svn: 242016
1 parent 3745e02 commit 6bee961

File tree

1 file changed

+93
-3
lines changed

1 file changed

+93
-3
lines changed
 

‎lldb/source/Core/ArchSpec.cpp

+93-3
Original file line numberDiff line numberDiff line change
@@ -1181,11 +1181,46 @@ cores_match (const ArchSpec::Core core1, const ArchSpec::Core core2, bool try_in
11811181
}
11821182
break;
11831183

1184+
case ArchSpec::eCore_mips32:
1185+
if (!enforce_exact_match)
1186+
{
1187+
if (core2 >= ArchSpec::kCore_mips32_first && core2 <= ArchSpec::kCore_mips32_last)
1188+
return true;
1189+
try_inverse = false;
1190+
}
1191+
break;
1192+
1193+
case ArchSpec::eCore_mips32el:
1194+
if (!enforce_exact_match)
1195+
{
1196+
if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= ArchSpec::kCore_mips32el_last)
1197+
return true;
1198+
try_inverse = false;
1199+
}
1200+
11841201
case ArchSpec::eCore_mips64:
1202+
if (!enforce_exact_match)
1203+
{
1204+
if (core2 >= ArchSpec::kCore_mips32_first && core2 <= ArchSpec::kCore_mips32_last)
1205+
return true;
1206+
if (core2 >= ArchSpec::kCore_mips64_first && core2 <= ArchSpec::kCore_mips64_last)
1207+
return true;
1208+
try_inverse = false;
1209+
}
1210+
1211+
case ArchSpec::eCore_mips64el:
1212+
if (!enforce_exact_match)
1213+
{
1214+
if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= ArchSpec::kCore_mips32el_last)
1215+
return true;
1216+
if (core2 >= ArchSpec::kCore_mips64el_first && core2 <= ArchSpec::kCore_mips64el_last)
1217+
return true;
1218+
try_inverse = false;
1219+
}
1220+
11851221
case ArchSpec::eCore_mips64r2:
11861222
case ArchSpec::eCore_mips64r3:
11871223
case ArchSpec::eCore_mips64r5:
1188-
case ArchSpec::eCore_mips64r6:
11891224
if (!enforce_exact_match)
11901225
{
11911226
if (core2 >= ArchSpec::kCore_mips32_first && core2 <= (core1 - 10))
@@ -1196,11 +1231,9 @@ cores_match (const ArchSpec::Core core1, const ArchSpec::Core core2, bool try_in
11961231
}
11971232
break;
11981233

1199-
case ArchSpec::eCore_mips64el:
12001234
case ArchSpec::eCore_mips64r2el:
12011235
case ArchSpec::eCore_mips64r3el:
12021236
case ArchSpec::eCore_mips64r5el:
1203-
case ArchSpec::eCore_mips64r6el:
12041237
if (!enforce_exact_match)
12051238
{
12061239
if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= (core1 - 10))
@@ -1211,6 +1244,63 @@ cores_match (const ArchSpec::Core core1, const ArchSpec::Core core2, bool try_in
12111244
}
12121245
break;
12131246

1247+
case ArchSpec::eCore_mips32r2:
1248+
case ArchSpec::eCore_mips32r3:
1249+
case ArchSpec::eCore_mips32r5:
1250+
if (!enforce_exact_match)
1251+
{
1252+
if (core2 >= ArchSpec::kCore_mips32_first && core2 <= core1)
1253+
return true;
1254+
}
1255+
break;
1256+
1257+
case ArchSpec::eCore_mips32r2el:
1258+
case ArchSpec::eCore_mips32r3el:
1259+
case ArchSpec::eCore_mips32r5el:
1260+
if (!enforce_exact_match)
1261+
{
1262+
if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= core1)
1263+
return true;
1264+
}
1265+
break;
1266+
1267+
case ArchSpec::eCore_mips32r6:
1268+
if (!enforce_exact_match)
1269+
{
1270+
if (core2 == ArchSpec::eCore_mips32 || core2 == ArchSpec::eCore_mips32r6)
1271+
return true;
1272+
}
1273+
break;
1274+
1275+
case ArchSpec::eCore_mips32r6el:
1276+
if (!enforce_exact_match)
1277+
{
1278+
if (core2 == ArchSpec::eCore_mips32el || core2 == ArchSpec::eCore_mips32r6el)
1279+
return true;
1280+
return true;
1281+
}
1282+
break;
1283+
1284+
case ArchSpec::eCore_mips64r6:
1285+
if (!enforce_exact_match)
1286+
{
1287+
if (core2 == ArchSpec::eCore_mips32 || core2 == ArchSpec::eCore_mips32r6)
1288+
return true;
1289+
if (core2 == ArchSpec::eCore_mips64 || core2 == ArchSpec::eCore_mips64r6)
1290+
return true;
1291+
}
1292+
break;
1293+
1294+
case ArchSpec::eCore_mips64r6el:
1295+
if (!enforce_exact_match)
1296+
{
1297+
if (core2 == ArchSpec::eCore_mips32el || core2 == ArchSpec::eCore_mips32r6el)
1298+
return true;
1299+
if (core2 == ArchSpec::eCore_mips64el || core2 == ArchSpec::eCore_mips64r6el)
1300+
return true;
1301+
}
1302+
break;
1303+
12141304
default:
12151305
break;
12161306
}

0 commit comments

Comments
 (0)