use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.
the class LLVMX86_64VAStart method computeOverflowArgAreaSize.
private int computeOverflowArgAreaSize(Object[] realArguments) {
assert numberOfExplicitArguments <= realArguments.length;
int overflowArea = 0;
int gpOffset = calculateUsedGpArea(realArguments);
int fpOffset = X86_64BitVarArgs.GP_LIMIT + calculateUsedFpArea(realArguments);
for (int i = numberOfExplicitArguments; i < realArguments.length; i++) {
final Object arg = realArguments[i];
final VarArgArea area = getVarArgArea(arg);
if (area == VarArgArea.GP_AREA && gpOffset < X86_64BitVarArgs.GP_LIMIT) {
gpOffset += X86_64BitVarArgs.GP_STEP;
} else if (area == VarArgArea.FP_AREA && fpOffset < X86_64BitVarArgs.FP_LIMIT) {
fpOffset += X86_64BitVarArgs.FP_STEP;
} else if (area != VarArgArea.OVERFLOW_AREA) {
overflowArea += X86_64BitVarArgs.STACK_STEP;
} else if (arg instanceof LLVM80BitFloat) {
overflowArea += 16;
} else if (arg instanceof LLVMVarArgCompoundValue) {
LLVMVarArgCompoundValue obj = (LLVMVarArgCompoundValue) arg;
overflowArea += obj.getSize();
} else {
throw new AssertionError(arg);
}
}
return overflowArea;
}
use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.
the class LLVM80BitFromDoubleTest method testOne.
@Test
public void testOne() {
LLVM80BitFloat val = LLVM80BitFloat.fromDouble(1);
assertEquals(one(), val);
}
use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.
the class LLVM80BitFromDoubleTest method testZero.
@Test
public void testZero() {
LLVM80BitFloat val = LLVM80BitFloat.fromDouble(0);
assertEquals(zero(), val);
}
use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.
the class LLVM80BitFromDoubleTest method testNegativeInfinity.
@Test
public void testNegativeInfinity() {
LLVM80BitFloat val = LLVM80BitFloat.fromDouble(Double.NEGATIVE_INFINITY);
LLVM80BitFloat expected = LLVM80BitFloat.fromRawValues(true, 0x7fff, 0x8000000000000000L);
assertEquals(expected, val);
}
use of com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat in project sulong by graalvm.
the class LLVM80BitFromDoubleTest method testMinusOne.
@Test
public void testMinusOne() {
LLVM80BitFloat val = LLVM80BitFloat.fromDouble(-1);
assertEquals(minusOne(), val);
}
Aggregations