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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [m68k/] [__setfpucw.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* Copyright (C) 1993  Olaf Flebbe
2
This file is part of the Linux C Library.
3
 
4
The Linux C Library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public License as
6
published by the Free Software Foundation; either version 2 of the
7
License, or (at your option) any later version.
8
 
9
The Linux C Library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
Library General Public License for more details.  */
13
 
14
#include <fpu_control.h>
15
 
16
void
17
__setfpucw(unsigned long fpu_control)
18
{
19
  unsigned long fpcr;
20
 
21
  /* If user supplied _fpu_control, use it ! */
22
  if (!fpu_control)
23
  {
24
    /* use linux defaults */
25
    fpu_control = _FPU_DEFAULT;
26
  }
27
  /* Get Floating Point Control Register */
28
  __asm__ volatile ("fmovel %!,%0" : "=g" (fpcr) : );
29
 
30
  /* mask in */
31
  fpcr &= _FPU_RESERVED;
32
  fpcr = fpcr | (fpu_control & ~_FPU_RESERVED);
33
 
34
  /* set Control Register */
35
  __asm__ volatile ("fmovel %0,%!" : : "g" (fpcr));
36
}

powered by: WebSVN 2.1.0

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