aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Cpu/LightningJit/Arm32/Target/Arm64/InstEmitVfpArithmetic.cs
blob: efb2fc6b406671f8ed23d7bd94530e2a57712a83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
namespace Ryujinx.Cpu.LightningJit.Arm32.Target.Arm64
{
    static class InstEmitVfpArithmetic
    {
        public static void VabsF(CodeGenContext context, uint rd, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarUnaryF(context, rd, rm, size, context.Arm64Assembler.FabsFloat);
        }

        public static void VaddF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarBinaryF(context, rd, rn, rm, size, context.Arm64Assembler.FaddFloat);
        }

        public static void VdivF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarBinaryF(context, rd, rn, rm, size, context.Arm64Assembler.FdivFloat);
        }

        public static void VfmaF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarTernaryRdF(context, rd, rn, rm, size, context.Arm64Assembler.FmaddFloat);
        }

        public static void VfmsF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarTernaryRdF(context, rd, rn, rm, size, context.Arm64Assembler.FmsubFloat);
        }

        public static void VfnmaF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarTernaryRdF(context, rd, rn, rm, size, context.Arm64Assembler.FnmaddFloat);
        }

        public static void VfnmsF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarTernaryRdF(context, rd, rn, rm, size, context.Arm64Assembler.FnmsubFloat);
        }

        public static void Vmaxnm(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarBinaryF(context, rd, rn, rm, size, context.Arm64Assembler.FmaxnmFloat);
        }

        public static void Vminnm(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarBinaryF(context, rd, rn, rm, size, context.Arm64Assembler.FminnmFloat);
        }

        public static void VmlaF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarTernaryMulNegRdF(context, rd, rn, rm, size, negD: false, negProduct: false);
        }

        public static void VmlsF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarTernaryMulNegRdF(context, rd, rn, rm, size, negD: false, negProduct: true);
        }

        public static void VmulF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarBinaryF(context, rd, rn, rm, size, context.Arm64Assembler.FmulFloat);
        }

        public static void VnegF(CodeGenContext context, uint rd, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarUnaryF(context, rd, rm, size, context.Arm64Assembler.FnegFloat);
        }

        public static void VnmlaF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarTernaryMulNegRdF(context, rd, rn, rm, size, negD: true, negProduct: true);
        }

        public static void VnmlsF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarTernaryMulNegRdF(context, rd, rn, rm, size, negD: true, negProduct: false);
        }

        public static void VnmulF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarBinaryF(context, rd, rn, rm, size, context.Arm64Assembler.FnmulFloat);
        }

        public static void VsqrtF(CodeGenContext context, uint rd, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarUnaryF(context, rd, rm, size, context.Arm64Assembler.FsqrtFloat);
        }

        public static void VsubF(CodeGenContext context, uint rd, uint rn, uint rm, uint size)
        {
            InstEmitNeonCommon.EmitScalarBinaryF(context, rd, rn, rm, size, context.Arm64Assembler.FsubFloat);
        }
    }
}