1 /*
2 * Copyright (c) 2002, 2009, Oracle and/or its affiliates. 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
25 // Inline interpreter functions for IA32
26
27 inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; }
28 inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; }
29 inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; }
30 inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; }
31 inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); }
32
33 inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; }
34
35 inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) {
36 return ( op1 < op2 ? -1 :
37 op1 > op2 ? 1 :
38 op1 == op2 ? 0 :
39 (direction == -1 || direction == 1) ? direction : 0);
40
41 }
42
43 inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) {
44 // x86 can do unaligned copies but not 64bits at a time
261
262 inline jfloat BytecodeInterpreter::VMint2Float(jint val) {
263 return (jfloat) val;
264 }
265
266 inline jlong BytecodeInterpreter::VMint2Long(jint val) {
267 return (jlong) val;
268 }
269
270 inline jchar BytecodeInterpreter::VMint2Char(jint val) {
271 return (jchar) val;
272 }
273
274 inline jshort BytecodeInterpreter::VMint2Short(jint val) {
275 return (jshort) val;
276 }
277
278 inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
279 return (jbyte) val;
280 }
|
1 /*
2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. 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
25 #ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP
26 #define CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP
27
28 // Inline interpreter functions for IA32
29
30 inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; }
31 inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; }
32 inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; }
33 inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; }
34 inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); }
35
36 inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; }
37
38 inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) {
39 return ( op1 < op2 ? -1 :
40 op1 > op2 ? 1 :
41 op1 == op2 ? 0 :
42 (direction == -1 || direction == 1) ? direction : 0);
43
44 }
45
46 inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) {
47 // x86 can do unaligned copies but not 64bits at a time
264
265 inline jfloat BytecodeInterpreter::VMint2Float(jint val) {
266 return (jfloat) val;
267 }
268
269 inline jlong BytecodeInterpreter::VMint2Long(jint val) {
270 return (jlong) val;
271 }
272
273 inline jchar BytecodeInterpreter::VMint2Char(jint val) {
274 return (jchar) val;
275 }
276
277 inline jshort BytecodeInterpreter::VMint2Short(jint val) {
278 return (jshort) val;
279 }
280
281 inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
282 return (jbyte) val;
283 }
284
285 #endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP
|