Update AInstEmitSimdArithmetic.cs

This commit is contained in:
LDj3SNuD 2018-04-29 17:08:23 +02:00 committed by GitHub
commit b7ab71f8fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -217,6 +217,9 @@ namespace ChocolArm64.Instruction
int Part = (!Scalar & (Op.RegisterSize == ARegisterSize.SIMD128) ? Elems : 0); int Part = (!Scalar & (Op.RegisterSize == ARegisterSize.SIMD128) ? Elems : 0);
Context.Emit(OpCodes.Ldc_I4_0);
Context.EmitSttmp();
for (int Index = 0; Index < Elems; Index++) for (int Index = 0; Index < Elems; Index++)
{ {
AILLabel LblLe = new AILLabel(); AILLabel LblLe = new AILLabel();
@ -234,7 +237,9 @@ namespace ChocolArm64.Instruction
Context.Emit(OpCodes.Pop); Context.Emit(OpCodes.Pop);
Context.EmitLdc_I4(TMaxValue); Context.EmitLdc_I4(TMaxValue);
SetQCFlag();
Context.EmitLdc_I4(0x8000000);
Context.EmitSttmp();
Context.Emit(OpCodes.Br_S, LblGeEnd); Context.Emit(OpCodes.Br_S, LblGeEnd);
@ -250,7 +255,9 @@ namespace ChocolArm64.Instruction
Context.Emit(OpCodes.Pop); Context.Emit(OpCodes.Pop);
Context.EmitLdc_I4(TMinValue); Context.EmitLdc_I4(TMinValue);
SetQCFlag();
Context.EmitLdc_I4(0x8000000);
Context.EmitSttmp();
Context.MarkLabel(LblGeEnd); Context.MarkLabel(LblGeEnd);
@ -267,16 +274,13 @@ namespace ChocolArm64.Instruction
EmitVectorZeroUpper(Context, Op.Rd); EmitVectorZeroUpper(Context, Op.Rd);
} }
void SetQCFlag()
{
Context.EmitLdarg(ATranslatedSub.StateArgIdx); Context.EmitLdarg(ATranslatedSub.StateArgIdx);
Context.EmitLdarg(ATranslatedSub.StateArgIdx); Context.EmitLdarg(ATranslatedSub.StateArgIdx);
Context.EmitCallPropGet(typeof(AThreadState), nameof(AThreadState.Fpsr)); Context.EmitCallPropGet(typeof(AThreadState), nameof(AThreadState.Fpsr));
Context.EmitLdc_I4(0x8000000); Context.EmitLdtmp();
Context.Emit(OpCodes.Or); Context.Emit(OpCodes.Or);
Context.EmitCallPropSet(typeof(AThreadState), nameof(AThreadState.Fpsr)); Context.EmitCallPropSet(typeof(AThreadState), nameof(AThreadState.Fpsr));
} }
}
public static void Fabd_S(AILEmitterCtx Context) public static void Fabd_S(AILEmitterCtx Context)
{ {