1 /*
2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2007, 2010 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 // Inline interpreter functions for zero
27
28 inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) {
29 return op1 + op2;
30 }
31
32 inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) {
33 return op1 - op2;
34 }
35
36 inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) {
37 return op1 * op2;
38 }
39
40 inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) {
41 return op1 / op2;
42 }
43
44 inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) {
45 return fmod(op1, op2);
282
283 inline jfloat BytecodeInterpreter::VMint2Float(jint val) {
284 return (jfloat) val;
285 }
286
287 inline jlong BytecodeInterpreter::VMint2Long(jint val) {
288 return (jlong) val;
289 }
290
291 inline jchar BytecodeInterpreter::VMint2Char(jint val) {
292 return (jchar) val;
293 }
294
295 inline jshort BytecodeInterpreter::VMint2Short(jint val) {
296 return (jshort) val;
297 }
298
299 inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
300 return (jbyte) val;
301 }
|
1 /*
2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2007, 2010 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
27 #define CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
28
29 // Inline interpreter functions for zero
30
31 inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) {
32 return op1 + op2;
33 }
34
35 inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) {
36 return op1 - op2;
37 }
38
39 inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) {
40 return op1 * op2;
41 }
42
43 inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) {
44 return op1 / op2;
45 }
46
47 inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) {
48 return fmod(op1, op2);
285
286 inline jfloat BytecodeInterpreter::VMint2Float(jint val) {
287 return (jfloat) val;
288 }
289
290 inline jlong BytecodeInterpreter::VMint2Long(jint val) {
291 return (jlong) val;
292 }
293
294 inline jchar BytecodeInterpreter::VMint2Char(jint val) {
295 return (jchar) val;
296 }
297
298 inline jshort BytecodeInterpreter::VMint2Short(jint val) {
299 return (jshort) val;
300 }
301
302 inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
303 return (jbyte) val;
304 }
305
306 #endif // CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
|