--- /dev/null 2016-06-12 22:20:21.015299290 +0200 +++ new/test/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c 2016-06-16 18:41:22.425131480 +0200 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include +#include + +#include "jni.h" + +#ifdef __cplusplus +extern "C" { +#endif + +jfloat SS(jfloat f1, jfloat f2) { + return f1 + f2; +} + +JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getFF(JNIEnv *env, jclass clazz) { + return (jlong)(intptr_t)SS; +} + +JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1FF(JNIEnv *env, jclass clazz, jfloat a, jfloat b) { + return SS(a, b); +} + +jfloat SDILDS(jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) { + return (jfloat)(a + b + c + d + e + f); +} + +JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getSDILDS + (JNIEnv *env, jclass clazz) { + return (jlong)(intptr_t)SDILDS; +} + +JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1SDILDS + (JNIEnv *env, jclass clazz, jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) { + return SDILDS(a, b, c, d, e, f); +} + +jfloat S32SDILDS( + jfloat f00, jfloat f01, jfloat f02, jfloat f03, jfloat f04, jfloat f05, jfloat f06, jfloat f07, + jfloat f08, jfloat f09, jfloat f0a, jfloat f0b, jfloat f0c, jfloat f0d, jfloat f0e, jfloat f0f, + jfloat f10, jfloat f11, jfloat f12, jfloat f13, jfloat f14, jfloat f15, jfloat f16, jfloat f17, + jfloat f18, jfloat f19, jfloat f1a, jfloat f1b, jfloat f1c, jfloat f1d, jfloat f1e, jfloat f1f, + jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) { + return (jfloat)( + f00 + f01 + f02 + f03 + f04 + f05 + f06 + f07 + + f08 + f09 + f0a + f0b + f0c + f0d + f0e + f0f + + f10 + f11 + f12 + f13 + f14 + f15 + f16 + f17 + + f18 + f19 + f1a + f1b + f1c + f1d + f1e + f1f + + a + b + c + d + e + f); +} + +JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getS32SDILDS + (JNIEnv *env, jclass clazz) { + return (jlong)(intptr_t)S32SDILDS; +} + +JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1S32SDILDS + (JNIEnv *env, jclass clazz, + jfloat f00, jfloat f01, jfloat f02, jfloat f03, jfloat f04, jfloat f05, jfloat f06, jfloat f07, + jfloat f08, jfloat f09, jfloat f0a, jfloat f0b, jfloat f0c, jfloat f0d, jfloat f0e, jfloat f0f, + jfloat f10, jfloat f11, jfloat f12, jfloat f13, jfloat f14, jfloat f15, jfloat f16, jfloat f17, + jfloat f18, jfloat f19, jfloat f1a, jfloat f1b, jfloat f1c, jfloat f1d, jfloat f1e, jfloat f1f, + jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) { + return S32SDILDS( + f00, f01, f02, f03, f04, f05, f06, f07, + f08, f09, f0a, f0b, f0c, f0d, f0e, f0f, + f10, f11, f12, f13, f14, f15, f16, f17, + f18, f19, f1a, f1b, f1c, f1d, f1e, f1f, + a, b, c, d, e, f); +} + +#ifdef __cplusplus +} +#endif +