asmmacro.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2003 Ralf Baechle
  7. */
  8. #ifndef _ASM_ASMMACRO_H
  9. #define _ASM_ASMMACRO_H
  10. #include <asm/hazards.h>
  11. #include <asm/asm-offsets.h>
  12. #include <asm/msa.h>
  13. #ifdef CONFIG_32BIT
  14. #include <asm/asmmacro-32.h>
  15. #endif
  16. #ifdef CONFIG_64BIT
  17. #include <asm/asmmacro-64.h>
  18. #endif
  19. /* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */
  20. #undef fp
  21. /*
  22. * Helper macros for generating raw instruction encodings.
  23. */
  24. #ifdef CONFIG_CPU_MICROMIPS
  25. .macro insn32_if_mm enc
  26. .insn
  27. .hword ((\enc) >> 16)
  28. .hword ((\enc) & 0xffff)
  29. .endm
  30. .macro insn_if_mips enc
  31. .endm
  32. #else
  33. .macro insn32_if_mm enc
  34. .endm
  35. .macro insn_if_mips enc
  36. .insn
  37. .word (\enc)
  38. .endm
  39. #endif
  40. #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
  41. .macro local_irq_enable reg=t0
  42. ei
  43. irq_enable_hazard
  44. .endm
  45. .macro local_irq_disable reg=t0
  46. di
  47. irq_disable_hazard
  48. .endm
  49. #else
  50. .macro local_irq_enable reg=t0
  51. mfc0 \reg, CP0_STATUS
  52. ori \reg, \reg, 1
  53. mtc0 \reg, CP0_STATUS
  54. irq_enable_hazard
  55. .endm
  56. .macro local_irq_disable reg=t0
  57. #ifdef CONFIG_PREEMPT
  58. lw \reg, TI_PRE_COUNT($28)
  59. addi \reg, \reg, 1
  60. sw \reg, TI_PRE_COUNT($28)
  61. #endif
  62. mfc0 \reg, CP0_STATUS
  63. ori \reg, \reg, 1
  64. xori \reg, \reg, 1
  65. mtc0 \reg, CP0_STATUS
  66. irq_disable_hazard
  67. #ifdef CONFIG_PREEMPT
  68. lw \reg, TI_PRE_COUNT($28)
  69. addi \reg, \reg, -1
  70. sw \reg, TI_PRE_COUNT($28)
  71. #endif
  72. .endm
  73. #endif /* CONFIG_CPU_MIPSR2 */
  74. .macro fpu_save_16even thread tmp=t0
  75. .set push
  76. SET_HARDFLOAT
  77. cfc1 \tmp, fcr31
  78. sdc1 $f0, THREAD_FPR0(\thread)
  79. sdc1 $f2, THREAD_FPR2(\thread)
  80. sdc1 $f4, THREAD_FPR4(\thread)
  81. sdc1 $f6, THREAD_FPR6(\thread)
  82. sdc1 $f8, THREAD_FPR8(\thread)
  83. sdc1 $f10, THREAD_FPR10(\thread)
  84. sdc1 $f12, THREAD_FPR12(\thread)
  85. sdc1 $f14, THREAD_FPR14(\thread)
  86. sdc1 $f16, THREAD_FPR16(\thread)
  87. sdc1 $f18, THREAD_FPR18(\thread)
  88. sdc1 $f20, THREAD_FPR20(\thread)
  89. sdc1 $f22, THREAD_FPR22(\thread)
  90. sdc1 $f24, THREAD_FPR24(\thread)
  91. sdc1 $f26, THREAD_FPR26(\thread)
  92. sdc1 $f28, THREAD_FPR28(\thread)
  93. sdc1 $f30, THREAD_FPR30(\thread)
  94. sw \tmp, THREAD_FCR31(\thread)
  95. .set pop
  96. .endm
  97. .macro fpu_save_16odd thread
  98. .set push
  99. .set mips64r2
  100. .set fp=64
  101. SET_HARDFLOAT
  102. sdc1 $f1, THREAD_FPR1(\thread)
  103. sdc1 $f3, THREAD_FPR3(\thread)
  104. sdc1 $f5, THREAD_FPR5(\thread)
  105. sdc1 $f7, THREAD_FPR7(\thread)
  106. sdc1 $f9, THREAD_FPR9(\thread)
  107. sdc1 $f11, THREAD_FPR11(\thread)
  108. sdc1 $f13, THREAD_FPR13(\thread)
  109. sdc1 $f15, THREAD_FPR15(\thread)
  110. sdc1 $f17, THREAD_FPR17(\thread)
  111. sdc1 $f19, THREAD_FPR19(\thread)
  112. sdc1 $f21, THREAD_FPR21(\thread)
  113. sdc1 $f23, THREAD_FPR23(\thread)
  114. sdc1 $f25, THREAD_FPR25(\thread)
  115. sdc1 $f27, THREAD_FPR27(\thread)
  116. sdc1 $f29, THREAD_FPR29(\thread)
  117. sdc1 $f31, THREAD_FPR31(\thread)
  118. .set pop
  119. .endm
  120. .macro fpu_save_double thread status tmp
  121. #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \
  122. defined(CONFIG_CPU_MIPS32_R6)
  123. sll \tmp, \status, 5
  124. bgez \tmp, 10f
  125. fpu_save_16odd \thread
  126. 10:
  127. #endif
  128. fpu_save_16even \thread \tmp
  129. .endm
  130. .macro fpu_restore_16even thread tmp=t0
  131. .set push
  132. SET_HARDFLOAT
  133. lw \tmp, THREAD_FCR31(\thread)
  134. ldc1 $f0, THREAD_FPR0(\thread)
  135. ldc1 $f2, THREAD_FPR2(\thread)
  136. ldc1 $f4, THREAD_FPR4(\thread)
  137. ldc1 $f6, THREAD_FPR6(\thread)
  138. ldc1 $f8, THREAD_FPR8(\thread)
  139. ldc1 $f10, THREAD_FPR10(\thread)
  140. ldc1 $f12, THREAD_FPR12(\thread)
  141. ldc1 $f14, THREAD_FPR14(\thread)
  142. ldc1 $f16, THREAD_FPR16(\thread)
  143. ldc1 $f18, THREAD_FPR18(\thread)
  144. ldc1 $f20, THREAD_FPR20(\thread)
  145. ldc1 $f22, THREAD_FPR22(\thread)
  146. ldc1 $f24, THREAD_FPR24(\thread)
  147. ldc1 $f26, THREAD_FPR26(\thread)
  148. ldc1 $f28, THREAD_FPR28(\thread)
  149. ldc1 $f30, THREAD_FPR30(\thread)
  150. ctc1 \tmp, fcr31
  151. .set pop
  152. .endm
  153. .macro fpu_restore_16odd thread
  154. .set push
  155. .set mips64r2
  156. .set fp=64
  157. SET_HARDFLOAT
  158. ldc1 $f1, THREAD_FPR1(\thread)
  159. ldc1 $f3, THREAD_FPR3(\thread)
  160. ldc1 $f5, THREAD_FPR5(\thread)
  161. ldc1 $f7, THREAD_FPR7(\thread)
  162. ldc1 $f9, THREAD_FPR9(\thread)
  163. ldc1 $f11, THREAD_FPR11(\thread)
  164. ldc1 $f13, THREAD_FPR13(\thread)
  165. ldc1 $f15, THREAD_FPR15(\thread)
  166. ldc1 $f17, THREAD_FPR17(\thread)
  167. ldc1 $f19, THREAD_FPR19(\thread)
  168. ldc1 $f21, THREAD_FPR21(\thread)
  169. ldc1 $f23, THREAD_FPR23(\thread)
  170. ldc1 $f25, THREAD_FPR25(\thread)
  171. ldc1 $f27, THREAD_FPR27(\thread)
  172. ldc1 $f29, THREAD_FPR29(\thread)
  173. ldc1 $f31, THREAD_FPR31(\thread)
  174. .set pop
  175. .endm
  176. .macro fpu_restore_double thread status tmp
  177. #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) || \
  178. defined(CONFIG_CPU_MIPS32_R6)
  179. sll \tmp, \status, 5
  180. bgez \tmp, 10f # 16 register mode?
  181. fpu_restore_16odd \thread
  182. 10:
  183. #endif
  184. fpu_restore_16even \thread \tmp
  185. .endm
  186. #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
  187. .macro _EXT rd, rs, p, s
  188. ext \rd, \rs, \p, \s
  189. .endm
  190. #else /* !CONFIG_CPU_MIPSR2 || !CONFIG_CPU_MIPSR6 */
  191. .macro _EXT rd, rs, p, s
  192. srl \rd, \rs, \p
  193. andi \rd, \rd, (1 << \s) - 1
  194. .endm
  195. #endif /* !CONFIG_CPU_MIPSR2 || !CONFIG_CPU_MIPSR6 */
  196. /*
  197. * Temporary until all gas have MT ASE support
  198. */
  199. .macro DMT reg=0
  200. .word 0x41600bc1 | (\reg << 16)
  201. .endm
  202. .macro EMT reg=0
  203. .word 0x41600be1 | (\reg << 16)
  204. .endm
  205. .macro DVPE reg=0
  206. .word 0x41600001 | (\reg << 16)
  207. .endm
  208. .macro EVPE reg=0
  209. .word 0x41600021 | (\reg << 16)
  210. .endm
  211. .macro MFTR rt=0, rd=0, u=0, sel=0
  212. .word 0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
  213. .endm
  214. .macro MTTR rt=0, rd=0, u=0, sel=0
  215. .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
  216. .endm
  217. #ifdef TOOLCHAIN_SUPPORTS_MSA
  218. .macro _cfcmsa rd, cs
  219. .set push
  220. .set mips32r2
  221. .set fp=64
  222. .set msa
  223. cfcmsa \rd, $\cs
  224. .set pop
  225. .endm
  226. .macro _ctcmsa cd, rs
  227. .set push
  228. .set mips32r2
  229. .set fp=64
  230. .set msa
  231. ctcmsa $\cd, \rs
  232. .set pop
  233. .endm
  234. .macro ld_b wd, off, base
  235. .set push
  236. .set mips32r2
  237. .set fp=64
  238. .set msa
  239. ld.b $w\wd, \off(\base)
  240. .set pop
  241. .endm
  242. .macro ld_h wd, off, base
  243. .set push
  244. .set mips32r2
  245. .set fp=64
  246. .set msa
  247. ld.h $w\wd, \off(\base)
  248. .set pop
  249. .endm
  250. .macro ld_w wd, off, base
  251. .set push
  252. .set mips32r2
  253. .set fp=64
  254. .set msa
  255. ld.w $w\wd, \off(\base)
  256. .set pop
  257. .endm
  258. .macro ld_d wd, off, base
  259. .set push
  260. .set mips32r2
  261. .set fp=64
  262. .set msa
  263. ld.d $w\wd, \off(\base)
  264. .set pop
  265. .endm
  266. .macro st_b wd, off, base
  267. .set push
  268. .set mips32r2
  269. .set fp=64
  270. .set msa
  271. st.b $w\wd, \off(\base)
  272. .set pop
  273. .endm
  274. .macro st_h wd, off, base
  275. .set push
  276. .set mips32r2
  277. .set fp=64
  278. .set msa
  279. st.h $w\wd, \off(\base)
  280. .set pop
  281. .endm
  282. .macro st_w wd, off, base
  283. .set push
  284. .set mips32r2
  285. .set fp=64
  286. .set msa
  287. st.w $w\wd, \off(\base)
  288. .set pop
  289. .endm
  290. .macro st_d wd, off, base
  291. .set push
  292. .set mips32r2
  293. .set fp=64
  294. .set msa
  295. st.d $w\wd, \off(\base)
  296. .set pop
  297. .endm
  298. .macro copy_s_w ws, n
  299. .set push
  300. .set mips32r2
  301. .set fp=64
  302. .set msa
  303. copy_s.w $1, $w\ws[\n]
  304. .set pop
  305. .endm
  306. .macro copy_s_d ws, n
  307. .set push
  308. .set mips64r2
  309. .set fp=64
  310. .set msa
  311. copy_s.d $1, $w\ws[\n]
  312. .set pop
  313. .endm
  314. .macro insert_w wd, n
  315. .set push
  316. .set mips32r2
  317. .set fp=64
  318. .set msa
  319. insert.w $w\wd[\n], $1
  320. .set pop
  321. .endm
  322. .macro insert_d wd, n
  323. .set push
  324. .set mips64r2
  325. .set fp=64
  326. .set msa
  327. insert.d $w\wd[\n], $1
  328. .set pop
  329. .endm
  330. #else
  331. /*
  332. * Temporary until all toolchains in use include MSA support.
  333. */
  334. .macro _cfcmsa rd, cs
  335. .set push
  336. .set noat
  337. SET_HARDFLOAT
  338. insn_if_mips 0x787e0059 | (\cs << 11)
  339. insn32_if_mm 0x587e0056 | (\cs << 11)
  340. move \rd, $1
  341. .set pop
  342. .endm
  343. .macro _ctcmsa cd, rs
  344. .set push
  345. .set noat
  346. SET_HARDFLOAT
  347. move $1, \rs
  348. insn_if_mips 0x783e0819 | (\cd << 6)
  349. insn32_if_mm 0x583e0816 | (\cd << 6)
  350. .set pop
  351. .endm
  352. .macro ld_b wd, off, base
  353. .set push
  354. .set noat
  355. SET_HARDFLOAT
  356. PTR_ADDU $1, \base, \off
  357. insn_if_mips 0x78000820 | (\wd << 6)
  358. insn32_if_mm 0x58000807 | (\wd << 6)
  359. .set pop
  360. .endm
  361. .macro ld_h wd, off, base
  362. .set push
  363. .set noat
  364. SET_HARDFLOAT
  365. PTR_ADDU $1, \base, \off
  366. insn_if_mips 0x78000821 | (\wd << 6)
  367. insn32_if_mm 0x58000817 | (\wd << 6)
  368. .set pop
  369. .endm
  370. .macro ld_w wd, off, base
  371. .set push
  372. .set noat
  373. SET_HARDFLOAT
  374. PTR_ADDU $1, \base, \off
  375. insn_if_mips 0x78000822 | (\wd << 6)
  376. insn32_if_mm 0x58000827 | (\wd << 6)
  377. .set pop
  378. .endm
  379. .macro ld_d wd, off, base
  380. .set push
  381. .set noat
  382. SET_HARDFLOAT
  383. PTR_ADDU $1, \base, \off
  384. insn_if_mips 0x78000823 | (\wd << 6)
  385. insn32_if_mm 0x58000837 | (\wd << 6)
  386. .set pop
  387. .endm
  388. .macro st_b wd, off, base
  389. .set push
  390. .set noat
  391. SET_HARDFLOAT
  392. PTR_ADDU $1, \base, \off
  393. insn_if_mips 0x78000824 | (\wd << 6)
  394. insn32_if_mm 0x5800080f | (\wd << 6)
  395. .set pop
  396. .endm
  397. .macro st_h wd, off, base
  398. .set push
  399. .set noat
  400. SET_HARDFLOAT
  401. PTR_ADDU $1, \base, \off
  402. insn_if_mips 0x78000825 | (\wd << 6)
  403. insn32_if_mm 0x5800081f | (\wd << 6)
  404. .set pop
  405. .endm
  406. .macro st_w wd, off, base
  407. .set push
  408. .set noat
  409. SET_HARDFLOAT
  410. PTR_ADDU $1, \base, \off
  411. insn_if_mips 0x78000826 | (\wd << 6)
  412. insn32_if_mm 0x5800082f | (\wd << 6)
  413. .set pop
  414. .endm
  415. .macro st_d wd, off, base
  416. .set push
  417. .set noat
  418. SET_HARDFLOAT
  419. PTR_ADDU $1, \base, \off
  420. insn_if_mips 0x78000827 | (\wd << 6)
  421. insn32_if_mm 0x5800083f | (\wd << 6)
  422. .set pop
  423. .endm
  424. .macro copy_s_w ws, n
  425. .set push
  426. .set noat
  427. SET_HARDFLOAT
  428. insn_if_mips 0x78b00059 | (\n << 16) | (\ws << 11)
  429. insn32_if_mm 0x58b00056 | (\n << 16) | (\ws << 11)
  430. .set pop
  431. .endm
  432. .macro copy_s_d ws, n
  433. .set push
  434. .set noat
  435. SET_HARDFLOAT
  436. insn_if_mips 0x78b80059 | (\n << 16) | (\ws << 11)
  437. insn32_if_mm 0x58b80056 | (\n << 16) | (\ws << 11)
  438. .set pop
  439. .endm
  440. .macro insert_w wd, n
  441. .set push
  442. .set noat
  443. SET_HARDFLOAT
  444. insn_if_mips 0x79300819 | (\n << 16) | (\wd << 6)
  445. insn32_if_mm 0x59300816 | (\n << 16) | (\wd << 6)
  446. .set pop
  447. .endm
  448. .macro insert_d wd, n
  449. .set push
  450. .set noat
  451. SET_HARDFLOAT
  452. insn_if_mips 0x79380819 | (\n << 16) | (\wd << 6)
  453. insn32_if_mm 0x59380816 | (\n << 16) | (\wd << 6)
  454. .set pop
  455. .endm
  456. #endif
  457. #ifdef TOOLCHAIN_SUPPORTS_MSA
  458. #define FPR_BASE_OFFS THREAD_FPR0
  459. #define FPR_BASE $1
  460. #else
  461. #define FPR_BASE_OFFS 0
  462. #define FPR_BASE \thread
  463. #endif
  464. .macro msa_save_all thread
  465. .set push
  466. .set noat
  467. #ifdef TOOLCHAIN_SUPPORTS_MSA
  468. PTR_ADDU FPR_BASE, \thread, FPR_BASE_OFFS
  469. #endif
  470. st_d 0, THREAD_FPR0 - FPR_BASE_OFFS, FPR_BASE
  471. st_d 1, THREAD_FPR1 - FPR_BASE_OFFS, FPR_BASE
  472. st_d 2, THREAD_FPR2 - FPR_BASE_OFFS, FPR_BASE
  473. st_d 3, THREAD_FPR3 - FPR_BASE_OFFS, FPR_BASE
  474. st_d 4, THREAD_FPR4 - FPR_BASE_OFFS, FPR_BASE
  475. st_d 5, THREAD_FPR5 - FPR_BASE_OFFS, FPR_BASE
  476. st_d 6, THREAD_FPR6 - FPR_BASE_OFFS, FPR_BASE
  477. st_d 7, THREAD_FPR7 - FPR_BASE_OFFS, FPR_BASE
  478. st_d 8, THREAD_FPR8 - FPR_BASE_OFFS, FPR_BASE
  479. st_d 9, THREAD_FPR9 - FPR_BASE_OFFS, FPR_BASE
  480. st_d 10, THREAD_FPR10 - FPR_BASE_OFFS, FPR_BASE
  481. st_d 11, THREAD_FPR11 - FPR_BASE_OFFS, FPR_BASE
  482. st_d 12, THREAD_FPR12 - FPR_BASE_OFFS, FPR_BASE
  483. st_d 13, THREAD_FPR13 - FPR_BASE_OFFS, FPR_BASE
  484. st_d 14, THREAD_FPR14 - FPR_BASE_OFFS, FPR_BASE
  485. st_d 15, THREAD_FPR15 - FPR_BASE_OFFS, FPR_BASE
  486. st_d 16, THREAD_FPR16 - FPR_BASE_OFFS, FPR_BASE
  487. st_d 17, THREAD_FPR17 - FPR_BASE_OFFS, FPR_BASE
  488. st_d 18, THREAD_FPR18 - FPR_BASE_OFFS, FPR_BASE
  489. st_d 19, THREAD_FPR19 - FPR_BASE_OFFS, FPR_BASE
  490. st_d 20, THREAD_FPR20 - FPR_BASE_OFFS, FPR_BASE
  491. st_d 21, THREAD_FPR21 - FPR_BASE_OFFS, FPR_BASE
  492. st_d 22, THREAD_FPR22 - FPR_BASE_OFFS, FPR_BASE
  493. st_d 23, THREAD_FPR23 - FPR_BASE_OFFS, FPR_BASE
  494. st_d 24, THREAD_FPR24 - FPR_BASE_OFFS, FPR_BASE
  495. st_d 25, THREAD_FPR25 - FPR_BASE_OFFS, FPR_BASE
  496. st_d 26, THREAD_FPR26 - FPR_BASE_OFFS, FPR_BASE
  497. st_d 27, THREAD_FPR27 - FPR_BASE_OFFS, FPR_BASE
  498. st_d 28, THREAD_FPR28 - FPR_BASE_OFFS, FPR_BASE
  499. st_d 29, THREAD_FPR29 - FPR_BASE_OFFS, FPR_BASE
  500. st_d 30, THREAD_FPR30 - FPR_BASE_OFFS, FPR_BASE
  501. st_d 31, THREAD_FPR31 - FPR_BASE_OFFS, FPR_BASE
  502. SET_HARDFLOAT
  503. _cfcmsa $1, MSA_CSR
  504. sw $1, THREAD_MSA_CSR(\thread)
  505. .set pop
  506. .endm
  507. .macro msa_restore_all thread
  508. .set push
  509. .set noat
  510. SET_HARDFLOAT
  511. lw $1, THREAD_MSA_CSR(\thread)
  512. _ctcmsa MSA_CSR, $1
  513. #ifdef TOOLCHAIN_SUPPORTS_MSA
  514. PTR_ADDU FPR_BASE, \thread, FPR_BASE_OFFS
  515. #endif
  516. ld_d 0, THREAD_FPR0 - FPR_BASE_OFFS, FPR_BASE
  517. ld_d 1, THREAD_FPR1 - FPR_BASE_OFFS, FPR_BASE
  518. ld_d 2, THREAD_FPR2 - FPR_BASE_OFFS, FPR_BASE
  519. ld_d 3, THREAD_FPR3 - FPR_BASE_OFFS, FPR_BASE
  520. ld_d 4, THREAD_FPR4 - FPR_BASE_OFFS, FPR_BASE
  521. ld_d 5, THREAD_FPR5 - FPR_BASE_OFFS, FPR_BASE
  522. ld_d 6, THREAD_FPR6 - FPR_BASE_OFFS, FPR_BASE
  523. ld_d 7, THREAD_FPR7 - FPR_BASE_OFFS, FPR_BASE
  524. ld_d 8, THREAD_FPR8 - FPR_BASE_OFFS, FPR_BASE
  525. ld_d 9, THREAD_FPR9 - FPR_BASE_OFFS, FPR_BASE
  526. ld_d 10, THREAD_FPR10 - FPR_BASE_OFFS, FPR_BASE
  527. ld_d 11, THREAD_FPR11 - FPR_BASE_OFFS, FPR_BASE
  528. ld_d 12, THREAD_FPR12 - FPR_BASE_OFFS, FPR_BASE
  529. ld_d 13, THREAD_FPR13 - FPR_BASE_OFFS, FPR_BASE
  530. ld_d 14, THREAD_FPR14 - FPR_BASE_OFFS, FPR_BASE
  531. ld_d 15, THREAD_FPR15 - FPR_BASE_OFFS, FPR_BASE
  532. ld_d 16, THREAD_FPR16 - FPR_BASE_OFFS, FPR_BASE
  533. ld_d 17, THREAD_FPR17 - FPR_BASE_OFFS, FPR_BASE
  534. ld_d 18, THREAD_FPR18 - FPR_BASE_OFFS, FPR_BASE
  535. ld_d 19, THREAD_FPR19 - FPR_BASE_OFFS, FPR_BASE
  536. ld_d 20, THREAD_FPR20 - FPR_BASE_OFFS, FPR_BASE
  537. ld_d 21, THREAD_FPR21 - FPR_BASE_OFFS, FPR_BASE
  538. ld_d 22, THREAD_FPR22 - FPR_BASE_OFFS, FPR_BASE
  539. ld_d 23, THREAD_FPR23 - FPR_BASE_OFFS, FPR_BASE
  540. ld_d 24, THREAD_FPR24 - FPR_BASE_OFFS, FPR_BASE
  541. ld_d 25, THREAD_FPR25 - FPR_BASE_OFFS, FPR_BASE
  542. ld_d 26, THREAD_FPR26 - FPR_BASE_OFFS, FPR_BASE
  543. ld_d 27, THREAD_FPR27 - FPR_BASE_OFFS, FPR_BASE
  544. ld_d 28, THREAD_FPR28 - FPR_BASE_OFFS, FPR_BASE
  545. ld_d 29, THREAD_FPR29 - FPR_BASE_OFFS, FPR_BASE
  546. ld_d 30, THREAD_FPR30 - FPR_BASE_OFFS, FPR_BASE
  547. ld_d 31, THREAD_FPR31 - FPR_BASE_OFFS, FPR_BASE
  548. .set pop
  549. .endm
  550. #undef FPR_BASE_OFFS
  551. #undef FPR_BASE
  552. .macro msa_init_upper wd
  553. #ifdef CONFIG_64BIT
  554. insert_d \wd, 1
  555. #else
  556. insert_w \wd, 2
  557. insert_w \wd, 3
  558. #endif
  559. .endm
  560. .macro msa_init_all_upper
  561. .set push
  562. .set noat
  563. SET_HARDFLOAT
  564. not $1, zero
  565. msa_init_upper 0
  566. msa_init_upper 1
  567. msa_init_upper 2
  568. msa_init_upper 3
  569. msa_init_upper 4
  570. msa_init_upper 5
  571. msa_init_upper 6
  572. msa_init_upper 7
  573. msa_init_upper 8
  574. msa_init_upper 9
  575. msa_init_upper 10
  576. msa_init_upper 11
  577. msa_init_upper 12
  578. msa_init_upper 13
  579. msa_init_upper 14
  580. msa_init_upper 15
  581. msa_init_upper 16
  582. msa_init_upper 17
  583. msa_init_upper 18
  584. msa_init_upper 19
  585. msa_init_upper 20
  586. msa_init_upper 21
  587. msa_init_upper 22
  588. msa_init_upper 23
  589. msa_init_upper 24
  590. msa_init_upper 25
  591. msa_init_upper 26
  592. msa_init_upper 27
  593. msa_init_upper 28
  594. msa_init_upper 29
  595. msa_init_upper 30
  596. msa_init_upper 31
  597. .set pop
  598. .endm
  599. #endif /* _ASM_ASMMACRO_H */