Skip to content

Commit 2eee8b8

Browse files
PatriceJianghuangwei1024
authored andcommitted
[android/cpp test]Unit Test/9 neon32 release mode crash (cocos2d#19224)
make neon inline functions non-optimized
1 parent 0eddf61 commit 2eee8b8

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

cocos/math/MathUtilNeon.inl

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public:
4343
inline static void crossVec3(const float* v1, const float* v2, float* dst);
4444
};
4545

46-
inline void MathUtilNeon::addMatrix(const float* m, float scalar, float* dst)
46+
inline void MathUtilNeon::addMatrix(const float* m, float scalar, float* dst) __attribute__((optnone))
4747
{
4848
asm volatile(
4949
"vld1.32 {q0, q1}, [%1]! \n\t" // M[m0-m7]
@@ -66,7 +66,7 @@ inline void MathUtilNeon::addMatrix(const float* m, float scalar, float* dst)
6666
);
6767
}
6868

69-
inline void MathUtilNeon::addMatrix(const float* m1, const float* m2, float* dst)
69+
inline void MathUtilNeon::addMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone))
7070
{
7171
asm volatile(
7272
"vld1.32 {q0, q1}, [%1]! \n\t" // M1[m0-m7]
@@ -87,7 +87,7 @@ inline void MathUtilNeon::addMatrix(const float* m1, const float* m2, float* dst
8787
);
8888
}
8989

90-
inline void MathUtilNeon::subtractMatrix(const float* m1, const float* m2, float* dst)
90+
inline void MathUtilNeon::subtractMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone))
9191
{
9292
asm volatile(
9393
"vld1.32 {q0, q1}, [%1]! \n\t" // M1[m0-m7]
@@ -108,7 +108,7 @@ inline void MathUtilNeon::subtractMatrix(const float* m1, const float* m2, float
108108
);
109109
}
110110

111-
inline void MathUtilNeon::multiplyMatrix(const float* m, float scalar, float* dst)
111+
inline void MathUtilNeon::multiplyMatrix(const float* m, float scalar, float* dst) __attribute__((optnone))
112112
{
113113
asm volatile(
114114
"vld1.32 {d0[0]}, [%2] \n\t" // M[m0-m7]
@@ -128,7 +128,7 @@ inline void MathUtilNeon::multiplyMatrix(const float* m, float scalar, float* ds
128128
);
129129
}
130130

131-
inline void MathUtilNeon::multiplyMatrix(const float* m1, const float* m2, float* dst)
131+
inline void MathUtilNeon::multiplyMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone))
132132
{
133133
asm volatile(
134134
"vld1.32 {d16 - d19}, [%1]! \n\t" // M1[m0-m7]
@@ -165,7 +165,7 @@ inline void MathUtilNeon::multiplyMatrix(const float* m1, const float* m2, float
165165
);
166166
}
167167

168-
inline void MathUtilNeon::negateMatrix(const float* m, float* dst)
168+
inline void MathUtilNeon::negateMatrix(const float* m, float* dst) __attribute__((optnone))
169169
{
170170
asm volatile(
171171
"vld1.32 {q0-q1}, [%1]! \n\t" // load m0-m7
@@ -184,7 +184,7 @@ inline void MathUtilNeon::negateMatrix(const float* m, float* dst)
184184
);
185185
}
186186

187-
inline void MathUtilNeon::transposeMatrix(const float* m, float* dst)
187+
inline void MathUtilNeon::transposeMatrix(const float* m, float* dst) __attribute__((optnone))
188188
{
189189
asm volatile(
190190
"vld4.32 {d0[0], d2[0], d4[0], d6[0]}, [%1]! \n\t" // DST->M[m0, m4, m8, m12] = M[m0-m3]
@@ -200,7 +200,7 @@ inline void MathUtilNeon::transposeMatrix(const float* m, float* dst)
200200
);
201201
}
202202

203-
inline void MathUtilNeon::transformVec4(const float* m, float x, float y, float z, float w, float* dst)
203+
inline void MathUtilNeon::transformVec4(const float* m, float x, float y, float z, float w, float* dst) __attribute__((optnone))
204204
{
205205
asm volatile(
206206
"vld1.32 {d0[0]}, [%1] \n\t" // V[x]
@@ -223,7 +223,7 @@ inline void MathUtilNeon::transformVec4(const float* m, float x, float y, float
223223
);
224224
}
225225

226-
inline void MathUtilNeon::transformVec4(const float* m, const float* v, float* dst)
226+
inline void MathUtilNeon::transformVec4(const float* m, const float* v, float* dst) __attribute__((optnone))
227227
{
228228
asm volatile
229229
(
@@ -243,7 +243,7 @@ inline void MathUtilNeon::transformVec4(const float* m, const float* v, float* d
243243
);
244244
}
245245

246-
inline void MathUtilNeon::crossVec3(const float* v1, const float* v2, float* dst)
246+
inline void MathUtilNeon::crossVec3(const float* v1, const float* v2, float* dst) __attribute__((optnone))
247247
{
248248
asm volatile(
249249
"vld1.32 {d1[1]}, [%1] \n\t" //

cocos/math/MathUtilNeon64.inl

+10-10
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public:
4444
inline static void crossVec3(const float* v1, const float* v2, float* dst);
4545
};
4646

47-
inline void MathUtilNeon64::addMatrix(const float* m, float scalar, float* dst)
47+
inline void MathUtilNeon64::addMatrix(const float* m, float scalar, float* dst) __attribute__((optnone))
4848
{
4949
asm volatile(
5050
"ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // M[m0-m7] M[m8-m15]
@@ -62,7 +62,7 @@ inline void MathUtilNeon64::addMatrix(const float* m, float scalar, float* dst)
6262
);
6363
}
6464

65-
inline void MathUtilNeon64::addMatrix(const float* m1, const float* m2, float* dst)
65+
inline void MathUtilNeon64::addMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone))
6666
{
6767
asm volatile(
6868
"ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // M1[m0-m7] M1[m8-m15]
@@ -80,7 +80,7 @@ inline void MathUtilNeon64::addMatrix(const float* m1, const float* m2, float* d
8080
);
8181
}
8282

83-
inline void MathUtilNeon64::subtractMatrix(const float* m1, const float* m2, float* dst)
83+
inline void MathUtilNeon64::subtractMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone))
8484
{
8585
asm volatile(
8686
"ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // M1[m0-m7] M1[m8-m15]
@@ -98,7 +98,7 @@ inline void MathUtilNeon64::subtractMatrix(const float* m1, const float* m2, flo
9898
);
9999
}
100100

101-
inline void MathUtilNeon64::multiplyMatrix(const float* m, float scalar, float* dst)
101+
inline void MathUtilNeon64::multiplyMatrix(const float* m, float scalar, float* dst) __attribute__((optnone))
102102
{
103103
asm volatile(
104104
"ld1 {v0.s}[0], [%2] \n\t" //s
@@ -116,7 +116,7 @@ inline void MathUtilNeon64::multiplyMatrix(const float* m, float scalar, float*
116116
);
117117
}
118118

119-
inline void MathUtilNeon64::multiplyMatrix(const float* m1, const float* m2, float* dst)
119+
inline void MathUtilNeon64::multiplyMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone))
120120
{
121121
asm volatile(
122122
"ld1 {v8.4s, v9.4s, v10.4s, v11.4s}, [%1] \n\t" // M1[m0-m7] M1[m8-m15] M2[m0-m7] M2[m8-m15]
@@ -151,7 +151,7 @@ inline void MathUtilNeon64::multiplyMatrix(const float* m1, const float* m2, flo
151151
);
152152
}
153153

154-
inline void MathUtilNeon64::negateMatrix(const float* m, float* dst)
154+
inline void MathUtilNeon64::negateMatrix(const float* m, float* dst) __attribute__((optnone))
155155
{
156156
asm volatile(
157157
"ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // load m0-m7 load m8-m15
@@ -168,7 +168,7 @@ inline void MathUtilNeon64::negateMatrix(const float* m, float* dst)
168168
);
169169
}
170170

171-
inline void MathUtilNeon64::transposeMatrix(const float* m, float* dst)
171+
inline void MathUtilNeon64::transposeMatrix(const float* m, float* dst) __attribute__((optnone))
172172
{
173173
asm volatile(
174174
"ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // DST->M[m0, m4, m8, m12] = M[m0-m3]
@@ -180,7 +180,7 @@ inline void MathUtilNeon64::transposeMatrix(const float* m, float* dst)
180180
);
181181
}
182182

183-
inline void MathUtilNeon64::transformVec4(const float* m, float x, float y, float z, float w, float* dst)
183+
inline void MathUtilNeon64::transformVec4(const float* m, float x, float y, float z, float w, float* dst) __attribute__((optnone))
184184
{
185185
asm volatile(
186186
"ld1 {v0.s}[0], [%1] \n\t" // V[x]
@@ -204,7 +204,7 @@ inline void MathUtilNeon64::transformVec4(const float* m, float x, float y, floa
204204
);
205205
}
206206

207-
inline void MathUtilNeon64::transformVec4(const float* m, const float* v, float* dst)
207+
inline void MathUtilNeon64::transformVec4(const float* m, const float* v, float* dst) __attribute__((optnone))
208208
{
209209
asm volatile
210210
(
@@ -223,7 +223,7 @@ inline void MathUtilNeon64::transformVec4(const float* m, const float* v, float*
223223
);
224224
}
225225

226-
inline void MathUtilNeon64::crossVec3(const float* v1, const float* v2, float* dst)
226+
inline void MathUtilNeon64::crossVec3(const float* v1, const float* v2, float* dst) __attribute__((optnone))
227227
{
228228
asm volatile(
229229
"ld1 {v0.2s}, [%2] \n\t"

0 commit comments

Comments
 (0)