本文整理汇总了C#中AstExpression.CmpFloatOrLong方法的典型用法代码示例。如果您正苦于以下问题:C# AstExpression.CmpFloatOrLong方法的具体用法?C# AstExpression.CmpFloatOrLong怎么用?C# AstExpression.CmpFloatOrLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AstExpression
的用法示例。
在下文中一共展示了AstExpression.CmpFloatOrLong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitExpression
//.........这里部分代码省略.........
var r = frame.AllocateTemp(PrimitiveType.Int);
var start = this.Add(node.SourceLocation, RCode.Const, 0, r);
Instruction test;
var narg0 = node.Arguments[0];
var narg1 = node.Arguments[1];
if (narg0.IsWide() || narg1.IsWide())
{
var r2 = frame.AllocateTemp(PrimitiveType.Int);
var code = narg0.IsDouble() ? RCode.Cmpg_double : RCode.Cmp_long;
this.Add(node.SourceLocation, code, r2, args[0].Result, args[1].Result);
test = this.Add(node.SourceLocation, node.Code.Reverse().ToIfTestZ(), r2);
}
else if (narg0.IsFloat() || narg1.IsFloat())
{
var r2 = frame.AllocateTemp(PrimitiveType.Int);
this.Add(node.SourceLocation, RCode.Cmpg_float, r2, args[0].Result, args[1].Result);
test = this.Add(node.SourceLocation, node.Code.Reverse().ToIfTestZ(), r2);
}
else
{
test = this.Add(node.SourceLocation, node.Code.Reverse().ToIfTest(), args[0].Result,
args[1].Result);
}
this.Add(node.SourceLocation, RCode.Const, 1, r);
var end = this.Add(node.SourceLocation, RCode.Nop, null);
test.Operand = end;
return new RLRange(args, start, end, r);
}
case AstCode.CmpLFloat:
case AstCode.CmpGFloat:
case AstCode.CmpLong:
{
var r = frame.AllocateTemp(PrimitiveType.Int);
var code = node.CmpFloatOrLong();
var test = this.Add(node.SourceLocation, code, r, args[0].Result, args[1].Result);
return new RLRange(args, test, r);
}
case AstCode.CIsNotNull:
case AstCode.CIsNull:
{
var r = frame.AllocateTemp(PrimitiveType.Int);
var start = this.Add(node.SourceLocation, RCode.Const, 0, r);
var test = this.Add(node.SourceLocation, node.Code.Reverse().ToIfTestZ(), args[0].Result);
this.Add(node.SourceLocation, RCode.Const, 1, r);
var end = this.Add(node.SourceLocation, RCode.Nop, null);
test.Operand = end;
return new RLRange(args, start, end, r);
}
case AstCode.Brtrue:
case AstCode.Brfalse:
case AstCode.BrIfEq:
case AstCode.BrIfNe:
case AstCode.BrIfGe:
case AstCode.BrIfGt:
case AstCode.BrIfLe:
case AstCode.BrIfLt:
{
var label = (AstLabel) node.Operand;
var opcode = node.Code.ToIfTestZ();
var branch = this.Add(node.SourceLocation, opcode, args[0].Result);
labelManager.AddResolveAction(label, x => branch.Operand = x);
return new RLRange(branch, null);
}
case AstCode.__Beq:
case AstCode.__Bne_Un:
case AstCode.__Ble: