Changeset 8e7c9fe in mainline for uspace/lib/math/arch/ia32/src/cos.S


Ignore:
Timestamp:
2014-09-12T03:45:25Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c53b58e
Parents:
3eb0c85 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes

most usb changes were reverted. blink and usbmass were fixed
known problems:
ehci won't initialize
usbmast asserts on unmount (happens on mainline too)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/math/arch/ia32/src/cos.S

    r3eb0c85 r8e7c9fe  
    11#
    2 # Copyright (c) 2003-2004 Jakub Jermar
     2# Copyright (c) 2014 Martin Decky
    33# All rights reserved.
    44#
     
    2727#
    2828
     29#include <libarch/x87.h>
     30
    2931.text
    3032
    31 .set noat
    32 .set noreorder
     33.global cos
    3334
    34 #include <libarch/context_offset.h>
    35 
    36 .global context_save
    37 .global context_restore
    38 
    39 context_save:
    40         CONTEXT_SAVE_ARCH_CORE $a0
     35cos:
     36        # compute cosine (no stack frame)
    4137       
    42         # context_save returns 1
    43         j $ra
    44         li $v0, 1
    45 
    46 context_restore:
    47         CONTEXT_RESTORE_ARCH_CORE $a0
     38        fldl 4(%esp)
     39        fcos
    4840       
    49         # Just for the jump into first function,
    50         # but one instruction should not bother us
    51         move $t9, $ra
     41        # detect if source operand is out of range
    5242       
    53         # context_restore returns 0
    54         j $ra
    55         xor $v0, $v0
     43        fnstsw %ax
     44        andw $X87_STATUS_WORD_C2_MASK, %ax
     45        jnz fix_range
     46       
     47                ret
     48       
     49        # argument reduction
     50       
     51        fix_range:
     52                fldpi
     53                fadd %st(0)
     54                fxch %st(1)
     55       
     56        reduce:
     57                fprem1
     58                fnstsw %ax
     59                andw $X87_STATUS_WORD_C2_MASK, %ax
     60                jnz reduce
     61       
     62        fstpl %st(1)
     63        fcos
     64       
     65        ret
Note: See TracChangeset for help on using the changeset viewer.