OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [java/] [lang/] [natVMFloat.cc] - Blame information for rev 766

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 758 jeremybenn
// natVMFloat.cc - Implementation of java.lang.VMFloat native methods.
2
 
3
/* Copyright (C) 1998, 1999, 2001, 2006, 2007  Free Software Foundation
4
 
5
   This file is part of libgcj.
6
 
7
This software is copyrighted work licensed under the terms of the
8
Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9
details.  */
10
 
11
#include <config.h>
12
 
13
#include <java/lang/Float.h>
14
#include <java/lang/VMFloat.h>
15
#include <jvm.h>
16
 
17
union u
18
{
19
  jint l;
20
  jfloat d;
21
};
22
 
23
jint
24
java::lang::VMFloat::floatToIntBits(jfloat value)
25
{
26
  union u u;
27
  u.d = value;
28
  jint e = u.l & 0x7f800000;
29
  jint f = u.l & 0x007fffff;
30
 
31
  if (e == 0x7f800000 && f != 0)
32
    u.l = 0x7fc00000;
33
 
34
  return u.l;
35
}
36
 
37
jint
38
java::lang::VMFloat::floatToRawIntBits(jfloat value)
39
{
40
  union u u;
41
  u.d = value;
42
  return u.l;
43
}
44
 
45
jfloat
46
java::lang::VMFloat::intBitsToFloat(jint bits)
47
{
48
  union u u;
49
  u.l = bits;
50
  return u.d;
51
}
52
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.