Search in sources :

Example 31 with LLVM80BitFloat

use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.

the class LLVM80BitFromDoubleTest method testRandomNumber1.

@Test
public void testRandomNumber1() {
    LLVM80BitFloat val = LLVM80BitFloat.fromDouble(123.436789);
    LLVM80BitFloat expected = LLVM80BitFloat.fromRawValues(false, 0x4005, 0xf6dfa2cecc815000L);
    assertEquals(expected, val);
}
Also used : LLVM80BitFloat(com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat) Test(org.junit.Test)

Example 32 with LLVM80BitFloat

use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.

the class LLVM80BitFromDoubleTest method testMinusZero1.

@Test
public void testMinusZero1() {
    LLVM80BitFloat val = LLVM80BitFloat.fromDouble(-0.0);
    assertEquals(minusZero(), val);
}
Also used : LLVM80BitFloat(com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat) Test(org.junit.Test)

Example 33 with LLVM80BitFloat

use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.

the class LLVM80BitFromIntTest method testPositiveInfinity.

@Test
public void testPositiveInfinity() {
    LLVM80BitFloat test = LLVM80BitFloat.fromRawValues(false, 0b111111111111111, 1L << 63);
    assertTrue(test.isPositiveInfinity());
    assertTrue(test.isInfinity());
    assertFalse(test.isNegativeInfinity());
}
Also used : LLVM80BitFloat(com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat) Test(org.junit.Test)

Example 34 with LLVM80BitFloat

use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.

the class LLVM80BitFromIntTest method testMaxInt.

@Test
public void testMaxInt() {
    LLVM80BitFloat val = LLVM80BitFloat.fromInt(Integer.MAX_VALUE);
    LLVM80BitFloat expected = LLVM80BitFloat.fromRawValues(false, 0x401d, 0xfffffffe00000000L);
    assertEquals(expected, val);
}
Also used : LLVM80BitFloat(com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat) Test(org.junit.Test)

Example 35 with LLVM80BitFloat

use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.

the class LLVM80BitFromIntTest method testNegativeInfinity.

@Test
public void testNegativeInfinity() {
    LLVM80BitFloat test = LLVM80BitFloat.fromRawValues(true, 0b111111111111111, 1L << 63);
    assertTrue(test.isNegativeInfinity());
    assertTrue(test.isInfinity());
    assertFalse(test.isPositiveInfinity());
}
Also used : LLVM80BitFloat(com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat) Test(org.junit.Test)

Aggregations

LLVM80BitFloat (com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat)42 Test (org.junit.Test)38 LLVMTruffleObject (com.oracle.truffle.llvm.runtime.LLVMTruffleObject)3 Specialization (com.oracle.truffle.api.dsl.Specialization)2 ExplodeLoop (com.oracle.truffle.api.nodes.ExplodeLoop)2 UnexpectedResultException (com.oracle.truffle.api.nodes.UnexpectedResultException)2 LLVMVarArgCompoundValue (com.oracle.truffle.llvm.runtime.LLVMVarArgCompoundValue)2 LLVMAddress (com.oracle.truffle.llvm.runtime.LLVMAddress)1 LLVMGlobal (com.oracle.truffle.llvm.runtime.global.LLVMGlobal)1 LLVMFloatVector (com.oracle.truffle.llvm.runtime.vector.LLVMFloatVector)1