diff options
author | Derek Schuff <dschuff@chromium.org> | 2013-01-31 10:07:41 -0800 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2013-01-31 10:07:41 -0800 |
commit | 3d5de9e56f3e5af59772bdf2cbedb0903d938bb8 (patch) | |
tree | 300b7a72c61b009f0122ec1d8a155672c74459fd /utils | |
parent | 659ebb8c18832df528effd5c970bfde7662ea368 (diff) | |
parent | 9ccb76998f741a7d3f0f217392a783dfb99c6e87 (diff) |
Cherry-pick r174067
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 12 | ||||
-rw-r--r-- | utils/testgen/mc-bundling-x86-gen.py | 19 |
2 files changed, 20 insertions, 11 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index a4b0694bc0..6d62d6b1ff 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -1727,7 +1727,7 @@ static void emitConvertFuncs(CodeGenTarget &Target, StringRef ClassName, << " default: llvm_unreachable(\"invalid conversion entry!\");\n" << " case CVT_Reg:\n" << " Operands[*(p + 1)]->setMCOperandNum(NumMCOperands);\n" - << " Operands[*(p + 1)]->setConstraint(\"m\");\n" + << " Operands[*(p + 1)]->setConstraint(\"r\");\n" << " ++NumMCOperands;\n" << " break;\n" << " case CVT_Tied:\n" @@ -1830,9 +1830,13 @@ static void emitConvertFuncs(CodeGenTarget &Target, StringRef ClassName, // Add a handler for the operand number lookup. OpOS << " case " << Name << ":\n" - << " Operands[*(p + 1)]->setMCOperandNum(NumMCOperands);\n" - << " Operands[*(p + 1)]->setConstraint(\"m\");\n" - << " NumMCOperands += " << OpInfo.MINumOperands << ";\n" + << " Operands[*(p + 1)]->setMCOperandNum(NumMCOperands);\n"; + + if (Op.Class->isRegisterClass()) + OpOS << " Operands[*(p + 1)]->setConstraint(\"r\");\n"; + else + OpOS << " Operands[*(p + 1)]->setConstraint(\"m\");\n"; + OpOS << " NumMCOperands += " << OpInfo.MINumOperands << ";\n" << " break;\n"; break; } diff --git a/utils/testgen/mc-bundling-x86-gen.py b/utils/testgen/mc-bundling-x86-gen.py index 832e841602..5c1c6c4562 100644 --- a/utils/testgen/mc-bundling-x86-gen.py +++ b/utils/testgen/mc-bundling-x86-gen.py @@ -1,3 +1,4 @@ + #!/usr/bin/python # Auto-generates an exhaustive and repetitive test for correct bundle-locked @@ -40,7 +41,7 @@ def print_bundle_locked_sequence(len, align_to_end=False): def generate(align_to_end=False): print(PREAMBLE) - + ntest = 0 for instlen in range(1, BUNDLE_SIZE + 1): for offset in range(0, BUNDLE_SIZE): @@ -56,13 +57,15 @@ def generate(align_to_end=False): base_offset = ntest * 2 * BUNDLE_SIZE inst_orig_offset = base_offset + offset # had it not been padded... - def print_check(adjusted_offset=None): + def print_check(adjusted_offset=None, nop_split_offset=None): if adjusted_offset is not None: print('# CHECK: {0:x}: nop'.format(inst_orig_offset)) + if nop_split_offset is not None: + print('# CHECK: {0:x}: nop'.format(nop_split_offset)) print('# CHECK: {0:x}: incl'.format(adjusted_offset)) else: print('# CHECK: {0:x}: incl'.format(inst_orig_offset)) - + if align_to_end: if offset + instlen == BUNDLE_SIZE: # No padding needed @@ -72,9 +75,13 @@ def generate(align_to_end=False): offset_to_end = base_offset + (BUNDLE_SIZE - instlen) print_check(offset_to_end) else: # offset + instlen > BUNDLE_SIZE - # Pad to end at next bundle boundary + # Pad to end at next bundle boundary, splitting the nop sequence + # at the nearest bundle boundary + offset_to_nearest_bundle = base_offset + BUNDLE_SIZE offset_to_end = base_offset + (BUNDLE_SIZE * 2 - instlen) - print_check(offset_to_end) + if offset_to_nearest_bundle == offset_to_end: + offset_to_nearest_bundle = None + print_check(offset_to_end, offset_to_nearest_bundle) else: if offset + instlen > BUNDLE_SIZE: # Padding needed @@ -94,5 +101,3 @@ if __name__ == '__main__': help='generate .bundle_lock with align_to_end option') args = argparser.parse_args() generate(align_to_end=args.align_to_end) - - |