/*---------------------------------------------------------------------------* Project: Horizon File: math_Matrix33.cpp Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 24870 $ *---------------------------------------------------------------------------*/ #include #include #include #if !defined(NN_MATH_AS_INLINE) #include #endif namespace nn { namespace math { namespace ARMv6 { #include /*! @name 行列 @{ */ NN_FUNC_ATTR_PRIVATE_SECTION asm MTX33* MTX33CopyAsm(MTX33*, const MTX33*) { VLDMIA r1,{s0-s8} // レジスタ[S4-S15]に行列p2を全て入れる VSTMIA r0,{s0-s8} // 結果をストア BX lr // 戻る } NN_FUNC_ATTR_PRIVATE_SECTION asm MTX33* MTX33MAddAsm(MTX33* , f32, const MTX33*, const MTX33*) { VLDMIA r2,{s1-s9} // レジスタ[S4-S15]に行列p2を全て入れる VLDMIA r1!,{s10-s15} // レジスタ[S16-S23]に行列p1を入れる VMLA.F32 s1,s10,s0 VMLA.F32 s2,s11,s0 VMLA.F32 s3,s12,s0 VLDMIA r1,{s10-s12} // p1の続き VMLA.F32 s4,s13,s0 VMLA.F32 s5,s14,s0 VMLA.F32 s6,s15,s0 VMLA.F32 s7,s10,s0 VMLA.F32 s8,s11,s0 VMLA.F32 s9,s12,s0 VSTMIA r0,{s1-s9} // 結果をストア BX lr // 戻る } NN_FUNC_ATTR_PRIVATE_SECTION asm VEC3* VEC3TransformAsm(VEC3*, const MTX33*, const VEC3*) { VLDMIA r1,{s0-s8} // レジスタ[S0-S2]に行列pMの1行目 VLDMIA r2,{s9-s11} // レジスタ[S10-S12]にベクトルを全て入れる VMUL.F32 s12,s0,s9 VMUL.F32 s13,s3,s9 VMUL.F32 s14,s6,s9 VMLA.F32 s12,s1,s10 VMLA.F32 s13,s4,s10 VMLA.F32 s14,s7,s10 VMLA.F32 s12,s2,s11 VMLA.F32 s13,s5,s11 VMLA.F32 s14,s8,s11 VSTMIA r0,{s12-s14} // 結果をストア BX lr // 戻る } #include } // namespace ARMv6 } // namespace math } // namespace nn