MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / FADDF64

Method FADDF64

FEXCore/Source/Interface/Core/OpcodeDispatcher/X87F64.cpp:122–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void OpDispatchBuilder::FADDF64(OpcodeArgs, IR::OpSize Width, bool Integer, OpDispatchBuilder::OpResult ResInST0) {
123 if (Op->Src[0].IsNone()) { // Implicit argument case
124 auto Offset = Op->OP & 7;
125 auto St0 = 0;
126 if (ResInST0 == OpResult::RES_STI) {
127 _F80AddStack(Offset, St0);
128 } else {
129 _F80AddStack(St0, Offset);
130 }
131 if (Op->TableInfo->Flags & X86Tables::InstFlags::FLAGS_POP) {
132 _PopStackDestroy();
133 }
134 return;
135 }
136
137 // We have one memory argument
138 Ref arg {};
139
140 if (Integer) {
141 arg = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags);
142 if (Width == OpSize::i16Bit) {
143 arg = _Sbfe(OpSize::i64Bit, 16, 0, arg);
144 }
145 arg = _Float_FromGPR_S(OpSize::i64Bit, Width == OpSize::i64Bit ? OpSize::i64Bit : OpSize::i32Bit, arg);
146 } else if (Width == OpSize::i32Bit) {
147 arg = LoadSource(FPRClass, Op, Op->Src[0], Op->Flags);
148 arg = _Float_FToF(OpSize::i64Bit, OpSize::i32Bit, arg);
149 } else if (Width == OpSize::i64Bit) {
150 arg = LoadSource(FPRClass, Op, Op->Src[0], Op->Flags);
151 } else {
152 FEX_UNREACHABLE;
153 }
154
155 // top of stack is at offset zero
156 _F80AddValue(0, arg);
157}
158
159// FIXME: following is very similar to FADDF64
160void OpDispatchBuilder::FMULF64(OpcodeArgs, IR::OpSize Width, bool Integer, OpDispatchBuilder::OpResult ResInST0) {

Callers

nothing calls this directly

Calls 1

IsNoneMethod · 0.80

Tested by

no test coverage detected