Changeset 8e7c9fe in mainline for uspace/lib/math/arch/amd64/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/amd64/src/cos.S

    r3eb0c85 r8e7c9fe  
    11#
    2 # Copyright (c) 2008 Jiri Svoboda
     2# Copyright (c) 2014 Martin Decky
    33# All rights reserved.
    44#
     
    2727#
    2828
    29 #include <libarch/stack.h>
     29#include <libarch/x87.h>
    3030
    3131.text
    32 .section .text
    33 .global entry_point_jmp
    34 .set noreorder
    3532
    36 ## void entry_point_jmp(void *entry_point, void *pcb);
    37 #
    38 # $a0 (=$4) contains entry_point
    39 # $a1 (=$5) contains pcb
    40 #
    41 # Jump to program entry point
    42 .ent entry_point_jmp
    43 entry_point_jmp:
    44         # tmp := entry_point
    45         move $t9, $a0
     33.global cos
     34
     35cos:
     36        pushq %rbp
     37        movq %rsp, %rbp
    4638       
    47         # Pass pcb to the entry point in $a0
    48         move $a0, $a1
     39        # compute cosine (using red zone)
    4940       
    50         jr $t9
    51         addiu $sp, -ABI_STACK_FRAME
    52         addiu $sp, ABI_STACK_FRAME
    53 .end entry_point_jmp
     41        movsd %xmm0, -8(%rbp)
     42        fldl -8(%rbp)
     43       
     44        fcos
     45       
     46        # detect if source operand is out of range
     47       
     48        fnstsw %ax
     49        andw $X87_STATUS_WORD_C2_MASK, %ax
     50        jnz fix_range
     51       
     52                fstpl -8(%rbp)
     53                movsd -8(%rbp), %xmm0
     54               
     55                leave
     56                retq
     57       
     58        # argument reduction
     59       
     60        fix_range:
     61                fldpi
     62                fadd %st(0)
     63                fxch %st(1)
     64       
     65        reduce:
     66                fprem1
     67                fnstsw %ax
     68                andw $X87_STATUS_WORD_C2_MASK, %ax
     69                jnz reduce
     70       
     71        fstpl %st(1)
     72        fcos
     73       
     74        fstpl -8(%rbp)
     75        movsd -8(%rbp), %xmm0
     76       
     77        leave
     78        retq
Note: See TracChangeset for help on using the changeset viewer.