From f441e06d19cab24cb49fec49883c2d61eee2e4bf Mon Sep 17 00:00:00 2001 From: hatal175 Date: Mon, 14 Aug 2023 19:04:01 +0300 Subject: Work on JPABaseShape (#1884) --- include/dolphin/mtx/vec.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/dolphin') diff --git a/include/dolphin/mtx/vec.h b/include/dolphin/mtx/vec.h index 89fa986b82..1d06e5ec12 100644 --- a/include/dolphin/mtx/vec.h +++ b/include/dolphin/mtx/vec.h @@ -51,6 +51,24 @@ inline void C_VECAdd(register const Vec* a, register const Vec* b, register Vec* } } +inline void C_VECSubtract(register const Vec* a, register const Vec* b, register Vec* ab) { + register f32 axy; + register f32 bxy; + register f32 az; + register f32 subz; + register f32 bz; + asm { + psq_l axy, 0(a), 0, 0 + psq_l bxy, 0(b), 0, 0 + ps_sub bxy, axy, bxy + psq_st bxy, 0(ab), 0, 0 + psq_l az, 8(a), 1, 0 + psq_l bz, 8(b), 1, 0 + ps_sub subz, az, bz + psq_st subz, 8(ab), 1, 0 + } +} + inline f32 C_VECSquareMag(const Vec* v) { register f32 x_y; register f32 z; -- cgit v1.2.3