microcode = '''
def macroop LGDT_M
{
- .serializing
+ .serialize_after
.adjust_env maxOsz
# Get the limit
def macroop LGDT_P
{
- .serializing
+ .serialize_after
.adjust_env maxOsz
rdip t7
def macroop LGDT_16_M
{
- .serializing
+ .serialize_after
.adjust_env maxOsz
# Get the limit
def macroop LGDT_16_P
{
- .serializing
+ .serialize_after
.adjust_env maxOsz
rdip t7
def macroop LIDT_M
{
- .serializing
+ .serialize_after
.adjust_env maxOsz
# Get the limit
def macroop LIDT_P
{
- .serializing
+ .serialize_after
.adjust_env maxOsz
rdip t7
def macroop LIDT_16_M
{
- .serializing
+ .serialize_after
.adjust_env maxOsz
# Get the limit
def macroop LIDT_16_P
{
- .serializing
+ .serialize_after
.adjust_env maxOsz
rdip t7
def macroop LTR_R
{
- .serializing
+ .serialize_after
chks reg, t0, TRCheck
limm t4, 0, dataSize=8
srli t4, reg, 3, dataSize=2
def macroop LTR_M
{
- .serializing
+ .serialize_after
ld t5, seg, sib, disp, dataSize=2
chks t5, t0, TRCheck
limm t4, 0, dataSize=8
def macroop LTR_P
{
- .serializing
+ .serialize_after
rdip t7
ld t5, seg, riprel, disp, dataSize=2
chks t5, t0, TRCheck
def macroop LLDT_R
{
- .serializing
+ .serialize_after
chks reg, t0, InGDTCheck, flags=(EZF,)
br label("end"), flags=(CEZF,)
limm t4, 0, dataSize=8
def macroop LLDT_M
{
- .serializing
+ .serialize_after
ld t5, seg, sib, disp, dataSize=2
chks t5, t0, InGDTCheck, flags=(EZF,)
br label("end"), flags=(CEZF,)
def macroop LLDT_P
{
- .serializing
+ .serialize_after
rdip t7
ld t5, seg, riprel, disp, dataSize=2
chks t5, t0, InGDTCheck, flags=(EZF,)
self.adjust_imm += val
def adjustDisp(self, val):
self.adjust_disp += val
- def serializing(self):
- self.serializing = True
+ def serializeBefore(self):
+ self.serialize_before = True
+ def serializeAfter(self):
+ self.serialize_after = True
def function_call(self):
self.function_call = True
"adjust_env" : self.setAdjustEnv,
"adjust_imm" : self.adjustImm,
"adjust_disp" : self.adjustDisp,
- "serializing" : self.serializing,
+ "serialize_before" : self.serializeBefore,
+ "serialize_after" : self.serializeAfter,
"function_call" : self.function_call,
"function_return" : self.function_return
}
//This is to pacify gcc in case the displacement isn't used.
adjustedDisp = adjustedDisp;
'''
- self.serializing = False
+ self.serialize_before = False
+ self.serialize_after = False
self.function_call = False
self.function_return = False
micropc = 0
for op in self.microops:
flags = ["IsMicroop"]
+ if micropc == 0:
+ flags.append("IsFirstMicroop")
+
+ if self.serialize_before:
+ flags.append("IsSerializing")
+ flags.append("IsSerializeBefore")
+
if micropc == numMicroops - 1:
flags.append("IsLastMicroop")
- if self.serializing:
+ if self.serialize_after:
flags.append("IsSerializing")
flags.append("IsSerializeAfter")
flags.append("IsReturn")
else:
flags.append("IsDelayedCommit")
- if micropc == 0:
- flags.append("IsFirstMicroop")
+
allocMicroops += \
"microops[%d] = %s;\n" % \
(micropc, op.getAllocator(flags))