Search in sources :

Example 11 with LLVM80BitFloat

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

the class LLVM80BitFromIntTest method testTen.

@Test
public void testTen() {
    LLVM80BitFloat val = LLVM80BitFloat.fromInt(10);
    LLVM80BitFloat expected = LLVM80BitFloat.fromRawValues(false, 0x4002, Long.reverse(5));
    assertEquals(expected, val);
}
Also used : LLVM80BitFloat(com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat) Test(org.junit.Test)

Example 12 with LLVM80BitFloat

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

the class LLVM80BitFromIntTest method testZero.

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

Example 13 with LLVM80BitFloat

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

the class LLVM80BitFromLongTest method testMaxValue.

@Test
public void testMaxValue() {
    LLVM80BitFloat val = LLVM80BitFloat.fromLong(Long.MAX_VALUE);
    LLVM80BitFloat expected = LLVM80BitFloat.fromRawValues(false, 0x403d, 0xfffffffffffffffeL);
    assertEquals(expected, val);
}
Also used : LLVM80BitFloat(com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat) Test(org.junit.Test)

Example 14 with LLVM80BitFloat

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

the class LLVM80BitFromLongTest method testHighNegativeValue.

@Test
public void testHighNegativeValue() {
    LLVM80BitFloat val = LLVM80BitFloat.fromLong(1L << 63);
    LLVM80BitFloat expected = LLVM80BitFloat.fromRawValues(true, 0x403e, 0x8000000000000000L);
    assertEquals(expected, val);
}
Also used : LLVM80BitFloat(com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat) Test(org.junit.Test)

Example 15 with LLVM80BitFloat

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

the class LLVM80BitFromLongTest method testOne.

@Test
public void testOne() {
    LLVM80BitFloat val = LLVM80BitFloat.fromLong(1);
    LLVM80BitFloat expected = LLVM80BitFloat.fromRawValues(false, 0x3fff, Long.reverse(1));
    assertEquals(expected, val);
}
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