@@ -23,7 +23,6 @@
#include "exec/helper-proto.h"
#include "fpu/softfloat.h"
-#define SIGNBIT32 0x80000000
#define FP_STATUS (fpu->fp_status)
static void fdouble_ana(FPUTLGState *fpu,
@@ -129,8 +128,7 @@ uint64_t helper_fdouble_pack1(CPUTLGState *env,
case 0x21b00:
return float64_val(uint32_to_float64(rsrc>> 4, &FP_STATUS));
case 0x121b00:
- return float64_val(int32_to_float64((rsrc>> 4) | SIGNBIT32,
- &FP_STATUS));
+ return float64_val(int32_to_float64(0 - (rsrc>> 4), &FP_STATUS));
default:
qemu_log_mask(LOG_UNIMP, "\nUIMP: in %s.\n", __FUNCTION__);
helper_exception(env, TILEGX_EXCP_OPCODE_UNIMPLEMENTED);
@@ -217,7 +215,7 @@ uint64_t helper_fsingle_pack2(CPUTLGState *env, uint64_t rsrc)
case 0x9e:
return float32_val(uint32_to_float32(ctx.data, &FP_STATUS));
case 0x49e:
- return float32_val(int32_to_float32(ctx.data | SIGNBIT32, &FP_STATUS));
+ return float32_val(int32_to_float32(0 - ctx.data, &FP_STATUS));
default:
qemu_log_mask(LOG_UNIMP, "\nUIMP: in %s.\n", __FUNCTION__);
helper_exception(env, TILEGX_EXCP_OPCODE_UNIMPLEMENTED);