summaryrefslogtreecommitdiff
path: root/include/dolphin
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2023-08-14 19:04:01 +0300
committerGitHub <noreply@github.com>2023-08-14 10:04:01 -0600
commitf441e06d19cab24cb49fec49883c2d61eee2e4bf (patch)
treeefa28d90e482e87727ab5054ff1776a4c33f8eea /include/dolphin
parentda21df7ee7206a821ef15f7ae3f644b95e1cb7af (diff)
Work on JPABaseShape (#1884)
Diffstat (limited to 'include/dolphin')
-rw-r--r--include/dolphin/mtx/vec.h18
1 files changed, 18 insertions, 0 deletions
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;