1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     math_Arithmetic.cpp
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 46347 $
14  *---------------------------------------------------------------------------*/
15 
16 #include <nn/math.h>
17 
18 #include <nn/math/ARMv6/math_Arithmetic.h>
19 #include <cstdlib>
20 
21 namespace nn {
22 namespace math {
23 namespace ARMv6 {
24 
25     #include <nn/hw/ARM/code32.h>
26 
27     NN_FUNC_ATTR_PRIVATE_SECTION
28     asm f32
HermiteAsm(f32,f32,f32,f32,f32,f32)29     HermiteAsm(f32 /* v0 */, f32 /* t0 */, f32 /* v1 */, f32 /* t1 */, f32 /* p */, f32 /* d */)
30     {
31         VDIV.F32    s6,s4,s5        //s = p/d
32         VLDR.F32    s7,%F1          //s7=1.0
33         VLDR.F32    s8,%F2          //s8=2.0
34         VLDR.F32    s9,%F3          //s9=3.0
35         VSUB.F32    s10,s0,s2       //v0-v1
36         VSUB.F32    s11,s6,s7       //s_1
37         VMUL.F32    s12,s6,s6       //s*s
38         VNMLS.F32   s9,s6,s8        //2*s-3
39         VMUL.F32    s13,s6,s3       //s*t1
40         VMUL.F32    s14,s4,s11      //p*s_1
41         VMUL.F32    s15,s10,s9
42         VMLA.F32    s13,s11,s1
43         VMLA.F32    s0,s15,s12
44         VMLA.F32    s0,s13,s14
45         BX          lr
46 
47 1
48         DCD         0x3F800000
49 2
50         DCD         0x40000000
51 3
52         DCD         0x40400000
53     }
54 
55     #include <nn/hw/ARM/codereset.h>
56 
57 
58 
59 
60 }}}  // nn::math::ARMv6
61