|
|
@ -228,13 +228,12 @@ void RunInterpreter(UnitState<Debug>& state) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Record<DebugDataRecord::SRC1>(state.debug, iteration, src1);
|
|
|
|
Record<DebugDataRecord::SRC1>(state.debug, iteration, src1);
|
|
|
|
Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest);
|
|
|
|
Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest);
|
|
|
|
|
|
|
|
float24 rcp_res = float24::FromFloat32(1.0f / src1[0].ToFloat32());
|
|
|
|
for (int i = 0; i < 4; ++i) {
|
|
|
|
for (int i = 0; i < 4; ++i) {
|
|
|
|
if (!swizzle.DestComponentEnabled(i))
|
|
|
|
if (!swizzle.DestComponentEnabled(i))
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Be stable against division by zero!
|
|
|
|
dest[i] = rcp_res;
|
|
|
|
// TODO: I think this might be wrong... we should only use one component here
|
|
|
|
|
|
|
|
dest[i] = float24::FromFloat32(1.0f / src1[i].ToFloat32());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Record<DebugDataRecord::DEST_OUT>(state.debug, iteration, dest);
|
|
|
|
Record<DebugDataRecord::DEST_OUT>(state.debug, iteration, dest);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -245,13 +244,12 @@ void RunInterpreter(UnitState<Debug>& state) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Record<DebugDataRecord::SRC1>(state.debug, iteration, src1);
|
|
|
|
Record<DebugDataRecord::SRC1>(state.debug, iteration, src1);
|
|
|
|
Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest);
|
|
|
|
Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest);
|
|
|
|
|
|
|
|
float24 rsq_res = float24::FromFloat32(1.0f / std::sqrt(src1[0].ToFloat32()));
|
|
|
|
for (int i = 0; i < 4; ++i) {
|
|
|
|
for (int i = 0; i < 4; ++i) {
|
|
|
|
if (!swizzle.DestComponentEnabled(i))
|
|
|
|
if (!swizzle.DestComponentEnabled(i))
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Be stable against division by zero!
|
|
|
|
dest[i] = rsq_res;
|
|
|
|
// TODO: I think this might be wrong... we should only use one component here
|
|
|
|
|
|
|
|
dest[i] = float24::FromFloat32(1.0f / sqrt(src1[i].ToFloat32()));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Record<DebugDataRecord::DEST_OUT>(state.debug, iteration, dest);
|
|
|
|
Record<DebugDataRecord::DEST_OUT>(state.debug, iteration, dest);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|