regop.isa (6646:d9c23fff4f13) regop.isa (6647:5a9fd91b66a3)
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 310 unchanged lines hidden (view full) ---

319 if match.group("typeQual"):
320 typeQual = match.group("typeQual")
321 src2_name = "%spsrc2%s" % (match.group("prefix"), typeQual)
322 self.buildCppClasses(name, Name, suffix,
323 matcher.sub(src2_name, code),
324 matcher.sub(src2_name, flag_code),
325 matcher.sub(src2_name, cond_check),
326 matcher.sub(src2_name, else_code))
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 310 unchanged lines hidden (view full) ---

319 if match.group("typeQual"):
320 typeQual = match.group("typeQual")
321 src2_name = "%spsrc2%s" % (match.group("prefix"), typeQual)
322 self.buildCppClasses(name, Name, suffix,
323 matcher.sub(src2_name, code),
324 matcher.sub(src2_name, flag_code),
325 matcher.sub(src2_name, cond_check),
326 matcher.sub(src2_name, else_code))
327 imm_name = "%simm8" % match.group("prefix")
327 self.buildCppClasses(name + "i", Name, suffix + "Imm",
328 self.buildCppClasses(name + "i", Name, suffix + "Imm",
328 matcher.sub("imm8", code),
329 matcher.sub("imm8", flag_code),
330 matcher.sub("imm8", cond_check),
331 matcher.sub("imm8", else_code))
329 matcher.sub(imm_name, code),
330 matcher.sub(imm_name, flag_code),
331 matcher.sub(imm_name, cond_check),
332 matcher.sub(imm_name, else_code))
332 return
333
334 # If there's something optional to do with flags, generate
335 # a version without it and fix up this version to use it.
336 if flag_code != "" or cond_check != "true":
337 self.buildCppClasses(name, Name, suffix,
338 code, "", "true", else_code)
339 suffix = "Flags" + suffix

--- 8 unchanged lines hidden (view full) ---

348 code = "uint64_t psrc2 = pick(SrcReg2, 1, dataSize);" + code
349 # Also make available versions which do sign extension
350 matcher = re.compile("(?<!\w)spsrc1(?!\w)")
351 if matcher.search(allCode):
352 code = "int64_t spsrc1 = signedPick(SrcReg1, 0, dataSize);" + code
353 matcher = re.compile("(?<!\w)spsrc2(?!\w)")
354 if matcher.search(allCode):
355 code = "int64_t spsrc2 = signedPick(SrcReg2, 1, dataSize);" + code
333 return
334
335 # If there's something optional to do with flags, generate
336 # a version without it and fix up this version to use it.
337 if flag_code != "" or cond_check != "true":
338 self.buildCppClasses(name, Name, suffix,
339 code, "", "true", else_code)
340 suffix = "Flags" + suffix

--- 8 unchanged lines hidden (view full) ---

349 code = "uint64_t psrc2 = pick(SrcReg2, 1, dataSize);" + code
350 # Also make available versions which do sign extension
351 matcher = re.compile("(?<!\w)spsrc1(?!\w)")
352 if matcher.search(allCode):
353 code = "int64_t spsrc1 = signedPick(SrcReg1, 0, dataSize);" + code
354 matcher = re.compile("(?<!\w)spsrc2(?!\w)")
355 if matcher.search(allCode):
356 code = "int64_t spsrc2 = signedPick(SrcReg2, 1, dataSize);" + code
357 matcher = re.compile("(?<!\w)simm8(?!\w)")
358 if matcher.search(allCode):
359 code = "int8_t simm8 = imm8;" + code
356
357 base = "X86ISA::RegOp"
358
359 # If imm8 shows up in the code, use the immediate templates, if
360 # not, hopefully the register ones will be correct.
361 templates = regTemplates
360
361 base = "X86ISA::RegOp"
362
363 # If imm8 shows up in the code, use the immediate templates, if
364 # not, hopefully the register ones will be correct.
365 templates = regTemplates
362 matcher = re.compile("(?366 matcher = re.compile("(?<!\w)s?imm8(?!\w)")
363 if matcher.search(allCode):
364 base += "Imm"
365 templates = immTemplates
366
367 # Get everything ready for the substitution
368 iop = InstObjParams(name, Name + suffix, base,
369 {"code" : code,
370 "flag_code" : flag_code,

--- 1059 unchanged lines hidden ---
367 if matcher.search(allCode):
368 base += "Imm"
369 templates = immTemplates
370
371 # Get everything ready for the substitution
372 iop = InstObjParams(name, Name + suffix, base,
373 {"code" : code,
374 "flag_code" : flag_code,

--- 1059 unchanged lines hidden ---