diff --git a/src/x86.cpp b/src/x86.cpp index 104a9d06c3..15ad45af06 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -2391,14 +2391,14 @@ float2IntRR(Context* c, unsigned aSize, Assembler::Register* a, unsigned bSize, Assembler::Register* b) { assert(c, not floatReg(b)); - floatRegOp(c, aSize, a, bSize, b, 0x2d); + floatRegOp(c, aSize, a, bSize, b, 0x2c); } void float2IntMR(Context* c, unsigned aSize, Assembler::Memory* a, unsigned bSize, Assembler::Register* b) { - floatMemOp(c, aSize, a, bSize, b, 0x2d); + floatMemOp(c, aSize, a, bSize, b, 0x2c); } void diff --git a/test/Floats.java b/test/Floats.java index 1620e6a499..33c30145fd 100644 --- a/test/Floats.java +++ b/test/Floats.java @@ -61,5 +61,9 @@ public class Floats { expect(Math.round(0.5d) == 1); expect(Math.round(1.0d) == 1); expect(Math.round(1.9d) == 2); + + float b = 1.0f; + int blue = (int)(b * 255 + 0.5); + expect(blue == 255); } }