Skip to content

Commit a624ce1

Browse files
committed
fix: remove deprecated
1 parent 9c676d5 commit a624ce1

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/callback.cpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
127127
ArgRegSlot argSlot(argIdx);
128128

129129
if (TypeUtils::isInt(argType)) {
130-
argSlot.low = cc.newUIntPtr();
130+
argSlot.low = cc.newGpz();
131131

132132
if (hasHiArgSlot(cc, argType)) {
133-
argSlot.high = cc.newUIntPtr();
133+
argSlot.high = cc.newGpz();
134134
argSlot.useHighReg = true;
135135
}
136136
} else if (TypeUtils::isFloat(argType)) {
@@ -160,7 +160,7 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
160160
x86::Mem argsStackIdx(argsStack);
161161

162162
// assigns some register as index reg
163-
x86::Gp i = cc.newUIntPtr();
163+
x86::Gp i = cc.newGpz();
164164

165165
// stackIdx <- stack[i].
166166
argsStackIdx.setIndex(i);
@@ -185,7 +185,7 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
185185
cc.mov(argsStackIdx, argSlot.high.as<x86::Gp>());
186186
}
187187
} else if(TypeUtils::isFloat(argType)) {
188-
cc.movq(argsStackIdx, argSlot.low.as<x86::Xmm>());
188+
cc.movq(argsStackIdx, argSlot.low.as<x86::Vec>());
189189
} else {
190190
m_errorCode = "Parameters wider than 64bits not supported";
191191
return 0;
@@ -199,25 +199,25 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
199199
auto callbackSig = FuncSignature::build<void, Callback*, Parameters*, size_t, Return*, ReturnFlag*>();
200200

201201
// get pointer to callback and pass it to the user callback
202-
x86::Gp argCallback = cc.newUIntPtr("argCallback");
202+
x86::Gp argCallback = cc.newGpz("argCallback");
203203
cc.mov(argCallback, this);
204204

205205
// get pointer to stack structure and pass it to the user callback
206-
x86::Gp argStruct = cc.newUIntPtr("argStruct");
206+
x86::Gp argStruct = cc.newGpz("argStruct");
207207
cc.lea(argStruct, argsStack);
208208

209209
// fill reg to pass struct arg count to callback
210-
x86::Gp argCountParam = cc.newUIntPtr("argCountParam");
210+
x86::Gp argCountParam = cc.newGpz("argCountParam");
211211
cc.mov(argCountParam, sig.argCount());
212212

213213
// create buffer for return struct
214214
x86::Mem retStack = cc.newStack(sizeof(uint64_t), alignment);
215-
x86::Gp retStruct = cc.newUIntPtr("retStruct");
215+
x86::Gp retStruct = cc.newGpz("retStruct");
216216
cc.lea(retStruct, retStack);
217217

218218
// create buffer for flag value
219219
x86::Mem flagStack = cc.newStack(sizeof(ReturnFlag), alignment);
220-
x86::Gp flagStruct = cc.newUIntPtr("flagStruct");
220+
x86::Gp flagStruct = cc.newGpz("flagStruct");
221221
cc.lea(flagStruct, flagStack);
222222
x86::Mem flagStackIdx(flagStack);
223223
flagStackIdx.setSize(sizeof(ReturnFlag));
@@ -255,7 +255,7 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
255255
cc.mov(argSlot.high.as<x86::Gp>(), argsStackIdx);
256256
}
257257
} else if (TypeUtils::isFloat(argType)) {
258-
cc.movq(argSlot.low.as<x86::Xmm>(), argsStackIdx);
258+
cc.movq(argSlot.low.as<x86::Vec>(), argsStackIdx);
259259
} else {
260260
m_errorCode = "Parameters wider than 64bits not supported";
261261
return 0;
@@ -283,7 +283,7 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
283283
if (sig.hasRet()) {
284284
x86::Reg ret;
285285
if (TypeUtils::isInt(sig.ret())) {
286-
ret = cc.newUIntPtr();
286+
ret = cc.newGpz();
287287
} else {
288288
ret = cc.newXmm();
289289
}
@@ -294,7 +294,7 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
294294
if (TypeUtils::isInt(sig.ret())) {
295295
cc.mov(retStackIdx, ret.as<x86::Gp>());
296296
} else {
297-
cc.movq(retStackIdx, ret.as<x86::Xmm>());
297+
cc.movq(retStackIdx, ret.as<x86::Vec>());
298298
}
299299
}
300300

@@ -333,7 +333,7 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
333333
cc.mov(argSlot.high.as<x86::Gp>(), argsStackIdx);
334334
}
335335
} else if (TypeUtils::isFloat(argType)) {
336-
cc.movq(argSlot.low.as<x86::Xmm>(), argsStackIdx);
336+
cc.movq(argSlot.low.as<x86::Vec>(), argsStackIdx);
337337
} else {
338338
m_errorCode = "Parameters wider than 64bits not supported";
339339
return 0;
@@ -350,11 +350,11 @@ uint64_t Callback::getJitFunc(const FuncSignature& sig, const CallbackEntry pre,
350350
x86::Mem retStackIdx(retStack);
351351
retStackIdx.setSize(sizeof(uint64_t));
352352
if (TypeUtils::isInt(sig.ret())) {
353-
x86::Gp tmp = cc.newUIntPtr();
353+
x86::Gp tmp = cc.newGpz();
354354
cc.mov(tmp, retStackIdx);
355355
cc.ret(tmp);
356356
} else {
357-
x86::Xmm tmp = cc.newXmm();
357+
x86::Vec tmp = cc.newXmm();
358358
cc.movq(tmp, retStackIdx);
359359
cc.ret(tmp);
360360
}
@@ -475,9 +475,7 @@ std::string_view Callback::getError() const noexcept {
475475
}
476476

477477
plg::any& Callback::setStorage(size_t idx, const plg::any& any) const {
478-
auto& var = storage[this][++idx];
479-
var = any;
480-
return var;
478+
return storage[this][++idx] = any;
481479
}
482480

483481
plg::any& Callback::getStorage(size_t idx) const {

0 commit comments

Comments
 (0)