Ningsheng Jian | d3ef4d9 | 2016-09-27 09:25:26 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015, 2016. All rights reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 12 | * version 2 for more details (a copy is included in the LICENSE file that |
| 13 | * accompanied this code). |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License version |
| 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
| 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 20 | * or visit www.oracle.com if you need additional information or have any |
| 21 | * questions. |
| 22 | */ |
| 23 | |
| 24 | #include <jni.h> |
| 25 | |
| 26 | #ifdef __cplusplus |
| 27 | extern "C" { |
| 28 | #endif |
| 29 | |
| 30 | JNIEXPORT jfloat JNICALL Java_compiler_floatingpoint_TestFloatJNIArgs_add15floats |
| 31 | (JNIEnv *env, jclass cls, |
| 32 | jfloat f1, jfloat f2, jfloat f3, jfloat f4, |
| 33 | jfloat f5, jfloat f6, jfloat f7, jfloat f8, |
| 34 | jfloat f9, jfloat f10, jfloat f11, jfloat f12, |
| 35 | jfloat f13, jfloat f14, jfloat f15) { |
| 36 | return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15; |
| 37 | } |
| 38 | |
| 39 | JNIEXPORT jfloat JNICALL Java_compiler_floatingpoint_TestFloatJNIArgs_add10floats |
| 40 | (JNIEnv *env, jclass cls, |
| 41 | jfloat f1, jfloat f2, jfloat f3, jfloat f4, |
| 42 | jfloat f5, jfloat f6, jfloat f7, jfloat f8, |
| 43 | jfloat f9, jfloat f10) { |
| 44 | return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10; |
| 45 | } |
| 46 | |
| 47 | JNIEXPORT jfloat JNICALL Java_compiler_floatingpoint_TestFloatJNIArgs_addFloatsInts |
| 48 | (JNIEnv *env, jclass cls, |
| 49 | jfloat f1, jfloat f2, jfloat f3, jfloat f4, |
| 50 | jfloat f5, jfloat f6, jfloat f7, jfloat f8, |
| 51 | jfloat f9, jfloat f10, jfloat f11, jfloat f12, |
| 52 | jfloat f13, jfloat f14, jfloat f15, jint a16, jint a17) { |
| 53 | return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15 + a16 + a17; |
| 54 | } |
| 55 | |
| 56 | JNIEXPORT jdouble JNICALL Java_compiler_floatingpoint_TestFloatJNIArgs_add15doubles |
| 57 | (JNIEnv *env, jclass cls, |
| 58 | jdouble f1, jdouble f2, jdouble f3, jdouble f4, |
| 59 | jdouble f5, jdouble f6, jdouble f7, jdouble f8, |
| 60 | jdouble f9, jdouble f10, jdouble f11, jdouble f12, |
| 61 | jdouble f13, jdouble f14, jdouble f15) { |
| 62 | return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15; |
| 63 | } |
| 64 | |
| 65 | |
| 66 | #ifdef __cplusplus |
| 67 | } |
| 68 | #endif |