2020-09-05 16:37:37 -04:00
|
|
|
#include "Val.h"
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Fallback to_gpr if a more optimized one is not provided.
|
|
|
|
*/
|
2020-09-05 18:55:07 -04:00
|
|
|
const RegVal* Val::to_gpr(FunctionEnv* fe) const {
|
2020-09-05 16:37:37 -04:00
|
|
|
(void)fe;
|
2020-09-05 18:55:07 -04:00
|
|
|
throw std::runtime_error("Val::to_gpr NYI"); // todo
|
2020-09-05 16:37:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Fallback to_xmm if a more optimized one is not provided.
|
|
|
|
*/
|
2020-09-05 18:55:07 -04:00
|
|
|
const RegVal* Val::to_xmm(FunctionEnv* fe) const {
|
2020-09-05 16:37:37 -04:00
|
|
|
(void)fe;
|
2020-09-05 18:55:07 -04:00
|
|
|
throw std::runtime_error("Val::to_xmm NYI"); // todo
|
2020-09-05 16:37:37 -04:00
|
|
|
}
|
|
|
|
|
2020-09-05 18:55:07 -04:00
|
|
|
|
|
|
|
const RegVal* RegVal::to_reg(FunctionEnv* fe) const {
|
|
|
|
(void)fe;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
const RegVal * RegVal::to_gpr(FunctionEnv* fe) const {
|
2020-09-05 16:37:37 -04:00
|
|
|
(void)fe;
|
2020-09-05 18:55:07 -04:00
|
|
|
if(m_ireg.kind == emitter::RegKind::GPR) {
|
|
|
|
return this;
|
|
|
|
} else {
|
|
|
|
throw std::runtime_error("RegVal::to_gpr NYI"); // todo
|
|
|
|
}
|
2020-09-05 16:37:37 -04:00
|
|
|
}
|
2020-09-05 18:55:07 -04:00
|
|
|
|
|
|
|
const RegVal * RegVal::to_xmm(FunctionEnv* fe) const {
|
|
|
|
(void)fe;
|
|
|
|
if(m_ireg.kind == emitter::RegKind::XMM) {
|
|
|
|
return this;
|
|
|
|
} else {
|
|
|
|
throw std::runtime_error("RegVal::to_xmm NYI"); // todo
|
|
|
|
}
|
|
|
|
}
|