diff --git a/VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicDataElement.cs b/VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicDataElement.cs index b7f8bda..c56f6ce 100644 --- a/VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicDataElement.cs +++ b/VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicDataElement.cs @@ -219,14 +219,17 @@ private static IList makePerformance(string str) run.FontStyle = FontStyles.Italic; list.Add(run); - string str2 = str.Replace("<", "<").Replace(">", ">").Replace("","").Replace("","").Replace("","").Replace("",""); + string str2 = str.Replace("<", "<").Replace(">", ">").Replace("", "").Replace("", "").Replace("", "").Replace("", ""); string[] lines = str2.Split(new string[] { "" }, StringSplitOptions.RemoveEmptyEntries); - for (int i = 1; i" }, StringSplitOptions.RemoveEmptyEntries); - Run run1 = new Run(string.Format("{0,-20}{1,-10}{2,-10}\n", elements[0], elements[1], elements[2])); - run1.FontFamily = family; - list.Add(run1); + if (elements.Length == 3) + { + Run run1 = new Run(string.Format("{0,-20}{1,-10}{2,-10}\n", elements[0], elements[1], elements[2])); + run1.FontFamily = family; + list.Add(run1); + } } return list; } diff --git a/VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicStore.cs b/VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicStore.cs index 99b43ad..15bc5d1 100644 --- a/VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicStore.cs +++ b/VS/CSHARP/intrinsics-dude-vsix/Tools/IntrinsicStore.cs @@ -151,7 +151,10 @@ private void loadHtml(string filename) case "DESCRIPTION": dataElement.description = addAcronyms(removeHtml(element2.InnerText)); break; case "OPERATION": dataElement.operation = addAcronyms(removeHtml(element2.InnerHtml)); break; case "CPUID": dataElement.cpuID |= IntrinsicTools.parseCpuID(element2.InnerText); break; - case "PERFORMANCE": dataElement.performance = element2.InnerHtml; break; + case "PERFORMANCE": + dataElement.performance = element2.InnerHtml; + testPerformance(dataElement.performance); + break; case "INSTRUCTION_NOTE": dataElement.instructionNote = element2.InnerText; break; case "SIG": @@ -222,6 +225,22 @@ private void loadHtml(string filename) IntrinsicsDudeToolsStatic.Output("ERROR: IntrinsicStore: loadHtml: exception " + e.ToString()); } } + /// + /// Checks whether the performance string is ok + /// + private static void testPerformance(string str) + { + string str2 = str.Replace("<", "<").Replace(">", ">").Replace("", "").Replace("", "").Replace("", "").Replace("", ""); + string[] lines = str2.Split(new string[] { "" }, StringSplitOptions.RemoveEmptyEntries); + for (int i = 1; i < lines.Length; ++i) + { + string[] elements = lines[i].Split(new string[] { "" }, StringSplitOptions.RemoveEmptyEntries); + if (elements.Length != 3) + { + IntrinsicsDudeToolsStatic.Output("WARNING: IntrinsicStore: testPerformance"); + } + } + } private void saveXml(string filename) {