Changeset 8e7c9fe in mainline for uspace/lib/math/arch/amd64/src/sin.S


Ignore:
Timestamp:
2014-09-12T03:45:25Z (10 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/sin.S

    r3eb0c85 r8e7c9fe  
    11#
    2 # Copyright (c) 2005 Martin Decky
     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 .init, "ax"
    3332
    34 .global __entry
     33.global sin
    3534
    36 .set noreorder
    37 .option pic2
    38 
    39 ## User-space task entry point
    40 #
    41 # $a0 ($4) contains the PCB pointer
    42 #
    43 .ent __entry
    44 __entry:
    45         .frame $sp, ABI_STACK_FRAME, $ra
    46         .cpload $t9
     35sin:
     36        pushq %rbp
     37        movq %rsp, %rbp
    4738       
    48         # Allocate the stack frame.
    49         addiu $sp, -ABI_STACK_FRAME
     39        # compute sine (using red zone)
    5040       
    51         # Allow PIC code
    52         .cprestore 16
     41        movsd %xmm0, -8(%rbp)
     42        fldl -8(%rbp)
    5343       
    54         # Pass pcb_ptr to __main() as the first argument. It is already
    55         # in $a0. As the first argument is passed in $a0, no operation
    56         # is needed.
     44        fsin
    5745       
    58         jal __main
    59         nop
     46        # detect if source operand is out of range
    6047       
    61         #
    62         # Not reached.
    63         #
    64         addiu $sp, ABI_STACK_FRAME
    65 .end __entry
     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        fsin
     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.