ild_codegen.py: remove bogus asserts that come up for #UD on disp/mode

* ild should not assert.

  * lengths of (unnamed) #UDs are not architectural and are subject to
    change by implementation, although they infrequently change.

  * the code was attempting to catch a case where information was
    missing (about the lengths of displacments) but if information is
    missing, the corresponding encodings are not defined.

Change-Id: Ieb30c380ae6117567fa1a72dd0adbd7f0e3b2791
(cherry picked from commit 80173f59809456b8406b573a435d1b00c56efef1)
This commit is contained in:
Mark Charney 2017-07-05 18:02:38 -04:00 committed by Mark Charney
parent d6284a455c
commit 68d7d10141

View File

@ -523,8 +523,6 @@ def gen_l1_byreg_resolution_function(agi,info_list, nt_dict, is_conflict_fun,
else: else:
_add_switch_dispatching(fo, fun_dict, reg_var, data_name) _add_switch_dispatching(fo, fun_dict, reg_var, data_name)
fo.add_code("/*We should not ever get here*/")
fo.add_code_eol('xed_assert(0)')
return fo return fo
def _add_int_dict_dispatching(fo, int_dict, dispatch_var, data_name): def _add_int_dict_dispatching(fo, int_dict, dispatch_var, data_name):
@ -553,12 +551,9 @@ def _add_switch_dispatching(fo, fun_dict, dispatch_var, data_name):
fo.add_code('case %s:' % key) fo.add_code('case %s:' % key)
call_stmt = '%s(%s)' % (fun_dict[key], data_name) call_stmt = '%s(%s)' % (fun_dict[key], data_name)
fo.add_code_eol(call_stmt) fo.add_code_eol(call_stmt)
fo.add_code_eol('return') fo.add_code_eol('break')
fo.add_code("/*We should not ever get here*/") fo.add_code("/*We should only get here for #UDs and those have no defined architectural length*/")
fo.add_code("/*If we got here, it means that we need" ) fo.add_code_eol('default: ')
fo.add_code("to fill ild_storage entries for those MODE")
fo.add_code(" values that led us here*/")
fo.add_code_eol('default: xed_assert(0)')
fo.add_code("}") fo.add_code("}")
def gen_l1_bymode_resolution_function(agi,info_list, nt_dict, is_conflict_fun, def gen_l1_bymode_resolution_function(agi,info_list, nt_dict, is_conflict_fun,
@ -620,8 +615,6 @@ def gen_l1_bymode_resolution_function(agi,info_list, nt_dict, is_conflict_fun,
else: else:
_add_switch_dispatching(fo, fun_dict, mode_var, data_name) _add_switch_dispatching(fo, fun_dict, mode_var, data_name)
fo.add_code("/*We should not ever get here*/")
fo.add_code_eol('xed_assert(0)')
return fo return fo
def print_defines(file, define_dict): def print_defines(file, define_dict):