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

Function DEF_OP

FEXCore/Source/Interface/Core/JIT/MemoryOps.cpp:20–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18namespace FEXCore::CPU {
19
20DEF_OP(LoadContext) {
21 const auto Op = IROp->C<IR::IROp_LoadContext>();
22 const auto OpSize = IROp->Size;
23
24 if (Op->Class == FEXCore::IR::GPRClass) {
25 auto Dst = GetReg(Node);
26
27 switch (OpSize) {
28 case IR::OpSize::i8Bit: ldrb(Dst, STATE, Op->Offset); break;
29 case IR::OpSize::i16Bit: ldrh(Dst, STATE, Op->Offset); break;
30 case IR::OpSize::i32Bit: ldr(Dst.W(), STATE, Op->Offset); break;
31 case IR::OpSize::i64Bit: ldr(Dst.X(), STATE, Op->Offset); break;
32 default: LOGMAN_MSG_A_FMT("Unhandled LoadContext size: {}", OpSize); break;
33 }
34 } else {
35 auto Dst = GetVReg(Node);
36
37 switch (OpSize) {
38 case IR::OpSize::i8Bit: ldrb(Dst, STATE, Op->Offset); break;
39 case IR::OpSize::i16Bit: ldrh(Dst, STATE, Op->Offset); break;
40 case IR::OpSize::i32Bit: ldr(Dst.S(), STATE, Op->Offset); break;
41 case IR::OpSize::i64Bit: ldr(Dst.D(), STATE, Op->Offset); break;
42 case IR::OpSize::i128Bit: ldr(Dst.Q(), STATE, Op->Offset); break;
43 case IR::OpSize::i256Bit:
44 mov(TMP1, Op->Offset);
45 ld1b<ARMEmitter::SubRegSize::i8Bit>(Dst.Z(), PRED_TMP_32B.Zeroing(), STATE, TMP1);
46 break;
47 default: LOGMAN_MSG_A_FMT("Unhandled LoadContext size: {}", OpSize); break;
48 }
49 }
50}
51
52DEF_OP(LoadContextPair) {
53 const auto Op = IROp->C<IR::IROp_LoadContextPair>();

Callers

nothing calls this directly

Calls 15

strFunction · 0.85
PhysicalRegisterFunction · 0.85
addFunction · 0.85
ilog2Function · 0.85
NumElementsFunction · 0.85
OpSizeAsBitsFunction · 0.85
OpSizeToSizeFunction · 0.85
SVEMemOperandClass · 0.85
WMethod · 0.80
XMethod · 0.80
SMethod · 0.80
DMethod · 0.80

Tested by

no test coverage detected