uasm.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  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. * A small micro-assembler. It is intentionally kept simple, does only
  7. * support a subset of instructions, and does not try to hide pipeline
  8. * effects like branch delay slots.
  9. *
  10. * Copyright (C) 2004, 2005, 2006, 2008 Thiemo Seufer
  11. * Copyright (C) 2005, 2007 Maciej W. Rozycki
  12. * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
  13. * Copyright (C) 2012, 2013 MIPS Technologies, Inc. All rights reserved.
  14. */
  15. enum fields {
  16. RS = 0x001,
  17. RT = 0x002,
  18. RD = 0x004,
  19. RE = 0x008,
  20. SIMM = 0x010,
  21. UIMM = 0x020,
  22. BIMM = 0x040,
  23. JIMM = 0x080,
  24. FUNC = 0x100,
  25. SET = 0x200,
  26. SCIMM = 0x400,
  27. SIMM9 = 0x800,
  28. };
  29. #define OP_MASK 0x3f
  30. #define OP_SH 26
  31. #define RD_MASK 0x1f
  32. #define RD_SH 11
  33. #define RE_MASK 0x1f
  34. #define RE_SH 6
  35. #define IMM_MASK 0xffff
  36. #define IMM_SH 0
  37. #define JIMM_MASK 0x3ffffff
  38. #define JIMM_SH 0
  39. #define FUNC_MASK 0x3f
  40. #define FUNC_SH 0
  41. #define SET_MASK 0x7
  42. #define SET_SH 0
  43. #define SIMM9_SH 7
  44. #define SIMM9_MASK 0x1ff
  45. enum opcode {
  46. insn_invalid,
  47. insn_addiu, insn_addu, insn_and, insn_andi, insn_bbit0, insn_bbit1,
  48. insn_beq, insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl,
  49. insn_bne, insn_cache, insn_cfc1, insn_cfcmsa, insn_ctc1, insn_ctcmsa,
  50. insn_daddiu, insn_daddu, insn_di, insn_dins, insn_dinsm, insn_divu,
  51. insn_dmfc0, insn_dmtc0, insn_drotr, insn_drotr32, insn_dsll,
  52. insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, insn_dsubu, insn_eret,
  53. insn_ext, insn_ins, insn_j, insn_jal, insn_jalr, insn_jr, insn_lb,
  54. insn_ld, insn_ldx, insn_lh, insn_ll, insn_lld, insn_lui, insn_lw,
  55. insn_lwx, insn_mfc0, insn_mfhc0, insn_mfhi, insn_mflo, insn_mtc0,
  56. insn_mthc0, insn_mthi, insn_mtlo, insn_mul, insn_or, insn_ori,
  57. insn_pref, insn_rfe, insn_rotr, insn_sc, insn_scd, insn_sd, insn_sll,
  58. insn_sllv, insn_slt, insn_sltiu, insn_sltu, insn_sra, insn_srl,
  59. insn_srlv, insn_subu, insn_sw, insn_sync, insn_syscall, insn_tlbp,
  60. insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, insn_wsbh, insn_xor,
  61. insn_xori, insn_yield, insn_lddir, insn_ldpte,
  62. };
  63. struct insn {
  64. enum opcode opcode;
  65. u32 match;
  66. enum fields fields;
  67. };
  68. static inline u32 build_rs(u32 arg)
  69. {
  70. WARN(arg & ~RS_MASK, KERN_WARNING "Micro-assembler field overflow\n");
  71. return (arg & RS_MASK) << RS_SH;
  72. }
  73. static inline u32 build_rt(u32 arg)
  74. {
  75. WARN(arg & ~RT_MASK, KERN_WARNING "Micro-assembler field overflow\n");
  76. return (arg & RT_MASK) << RT_SH;
  77. }
  78. static inline u32 build_rd(u32 arg)
  79. {
  80. WARN(arg & ~RD_MASK, KERN_WARNING "Micro-assembler field overflow\n");
  81. return (arg & RD_MASK) << RD_SH;
  82. }
  83. static inline u32 build_re(u32 arg)
  84. {
  85. WARN(arg & ~RE_MASK, KERN_WARNING "Micro-assembler field overflow\n");
  86. return (arg & RE_MASK) << RE_SH;
  87. }
  88. static inline u32 build_simm(s32 arg)
  89. {
  90. WARN(arg > 0x7fff || arg < -0x8000,
  91. KERN_WARNING "Micro-assembler field overflow\n");
  92. return arg & 0xffff;
  93. }
  94. static inline u32 build_uimm(u32 arg)
  95. {
  96. WARN(arg & ~IMM_MASK, KERN_WARNING "Micro-assembler field overflow\n");
  97. return arg & IMM_MASK;
  98. }
  99. static inline u32 build_scimm(u32 arg)
  100. {
  101. WARN(arg & ~SCIMM_MASK,
  102. KERN_WARNING "Micro-assembler field overflow\n");
  103. return (arg & SCIMM_MASK) << SCIMM_SH;
  104. }
  105. static inline u32 build_scimm9(s32 arg)
  106. {
  107. WARN((arg > 0xff || arg < -0x100),
  108. KERN_WARNING "Micro-assembler field overflow\n");
  109. return (arg & SIMM9_MASK) << SIMM9_SH;
  110. }
  111. static inline u32 build_func(u32 arg)
  112. {
  113. WARN(arg & ~FUNC_MASK, KERN_WARNING "Micro-assembler field overflow\n");
  114. return arg & FUNC_MASK;
  115. }
  116. static inline u32 build_set(u32 arg)
  117. {
  118. WARN(arg & ~SET_MASK, KERN_WARNING "Micro-assembler field overflow\n");
  119. return arg & SET_MASK;
  120. }
  121. static void build_insn(u32 **buf, enum opcode opc, ...);
  122. #define I_u1u2u3(op) \
  123. Ip_u1u2u3(op) \
  124. { \
  125. build_insn(buf, insn##op, a, b, c); \
  126. } \
  127. UASM_EXPORT_SYMBOL(uasm_i##op);
  128. #define I_s3s1s2(op) \
  129. Ip_s3s1s2(op) \
  130. { \
  131. build_insn(buf, insn##op, b, c, a); \
  132. } \
  133. UASM_EXPORT_SYMBOL(uasm_i##op);
  134. #define I_u2u1u3(op) \
  135. Ip_u2u1u3(op) \
  136. { \
  137. build_insn(buf, insn##op, b, a, c); \
  138. } \
  139. UASM_EXPORT_SYMBOL(uasm_i##op);
  140. #define I_u3u2u1(op) \
  141. Ip_u3u2u1(op) \
  142. { \
  143. build_insn(buf, insn##op, c, b, a); \
  144. } \
  145. UASM_EXPORT_SYMBOL(uasm_i##op);
  146. #define I_u3u1u2(op) \
  147. Ip_u3u1u2(op) \
  148. { \
  149. build_insn(buf, insn##op, b, c, a); \
  150. } \
  151. UASM_EXPORT_SYMBOL(uasm_i##op);
  152. #define I_u1u2s3(op) \
  153. Ip_u1u2s3(op) \
  154. { \
  155. build_insn(buf, insn##op, a, b, c); \
  156. } \
  157. UASM_EXPORT_SYMBOL(uasm_i##op);
  158. #define I_u2s3u1(op) \
  159. Ip_u2s3u1(op) \
  160. { \
  161. build_insn(buf, insn##op, c, a, b); \
  162. } \
  163. UASM_EXPORT_SYMBOL(uasm_i##op);
  164. #define I_u2u1s3(op) \
  165. Ip_u2u1s3(op) \
  166. { \
  167. build_insn(buf, insn##op, b, a, c); \
  168. } \
  169. UASM_EXPORT_SYMBOL(uasm_i##op);
  170. #define I_u2u1msbu3(op) \
  171. Ip_u2u1msbu3(op) \
  172. { \
  173. build_insn(buf, insn##op, b, a, c+d-1, c); \
  174. } \
  175. UASM_EXPORT_SYMBOL(uasm_i##op);
  176. #define I_u2u1msb32u3(op) \
  177. Ip_u2u1msbu3(op) \
  178. { \
  179. build_insn(buf, insn##op, b, a, c+d-33, c); \
  180. } \
  181. UASM_EXPORT_SYMBOL(uasm_i##op);
  182. #define I_u2u1msbdu3(op) \
  183. Ip_u2u1msbu3(op) \
  184. { \
  185. build_insn(buf, insn##op, b, a, d-1, c); \
  186. } \
  187. UASM_EXPORT_SYMBOL(uasm_i##op);
  188. #define I_u1u2(op) \
  189. Ip_u1u2(op) \
  190. { \
  191. build_insn(buf, insn##op, a, b); \
  192. } \
  193. UASM_EXPORT_SYMBOL(uasm_i##op);
  194. #define I_u2u1(op) \
  195. Ip_u1u2(op) \
  196. { \
  197. build_insn(buf, insn##op, b, a); \
  198. } \
  199. UASM_EXPORT_SYMBOL(uasm_i##op);
  200. #define I_u1s2(op) \
  201. Ip_u1s2(op) \
  202. { \
  203. build_insn(buf, insn##op, a, b); \
  204. } \
  205. UASM_EXPORT_SYMBOL(uasm_i##op);
  206. #define I_u1(op) \
  207. Ip_u1(op) \
  208. { \
  209. build_insn(buf, insn##op, a); \
  210. } \
  211. UASM_EXPORT_SYMBOL(uasm_i##op);
  212. #define I_0(op) \
  213. Ip_0(op) \
  214. { \
  215. build_insn(buf, insn##op); \
  216. } \
  217. UASM_EXPORT_SYMBOL(uasm_i##op);
  218. I_u2u1s3(_addiu)
  219. I_u3u1u2(_addu)
  220. I_u2u1u3(_andi)
  221. I_u3u1u2(_and)
  222. I_u1u2s3(_beq)
  223. I_u1u2s3(_beql)
  224. I_u1s2(_bgez)
  225. I_u1s2(_bgezl)
  226. I_u1s2(_bltz)
  227. I_u1s2(_bltzl)
  228. I_u1u2s3(_bne)
  229. I_u2s3u1(_cache)
  230. I_u1u2(_cfc1)
  231. I_u2u1(_cfcmsa)
  232. I_u1u2(_ctc1)
  233. I_u2u1(_ctcmsa)
  234. I_u1u2u3(_dmfc0)
  235. I_u1u2u3(_dmtc0)
  236. I_u2u1s3(_daddiu)
  237. I_u3u1u2(_daddu)
  238. I_u1(_di);
  239. I_u1u2(_divu)
  240. I_u2u1u3(_dsll)
  241. I_u2u1u3(_dsll32)
  242. I_u2u1u3(_dsra)
  243. I_u2u1u3(_dsrl)
  244. I_u2u1u3(_dsrl32)
  245. I_u2u1u3(_drotr)
  246. I_u2u1u3(_drotr32)
  247. I_u3u1u2(_dsubu)
  248. I_0(_eret)
  249. I_u2u1msbdu3(_ext)
  250. I_u2u1msbu3(_ins)
  251. I_u1(_j)
  252. I_u1(_jal)
  253. I_u2u1(_jalr)
  254. I_u1(_jr)
  255. I_u2s3u1(_lb)
  256. I_u2s3u1(_ld)
  257. I_u2s3u1(_lh)
  258. I_u2s3u1(_ll)
  259. I_u2s3u1(_lld)
  260. I_u1s2(_lui)
  261. I_u2s3u1(_lw)
  262. I_u1u2u3(_mfc0)
  263. I_u1u2u3(_mfhc0)
  264. I_u1(_mfhi)
  265. I_u1(_mflo)
  266. I_u1u2u3(_mtc0)
  267. I_u1u2u3(_mthc0)
  268. I_u1(_mthi)
  269. I_u1(_mtlo)
  270. I_u3u1u2(_mul)
  271. I_u2u1u3(_ori)
  272. I_u3u1u2(_or)
  273. I_0(_rfe)
  274. I_u2s3u1(_sc)
  275. I_u2s3u1(_scd)
  276. I_u2s3u1(_sd)
  277. I_u2u1u3(_sll)
  278. I_u3u2u1(_sllv)
  279. I_s3s1s2(_slt)
  280. I_u2u1s3(_sltiu)
  281. I_u3u1u2(_sltu)
  282. I_u2u1u3(_sra)
  283. I_u2u1u3(_srl)
  284. I_u3u2u1(_srlv)
  285. I_u2u1u3(_rotr)
  286. I_u3u1u2(_subu)
  287. I_u2s3u1(_sw)
  288. I_u1(_sync)
  289. I_0(_tlbp)
  290. I_0(_tlbr)
  291. I_0(_tlbwi)
  292. I_0(_tlbwr)
  293. I_u1(_wait);
  294. I_u2u1(_wsbh)
  295. I_u3u1u2(_xor)
  296. I_u2u1u3(_xori)
  297. I_u2u1(_yield)
  298. I_u2u1msbu3(_dins);
  299. I_u2u1msb32u3(_dinsm);
  300. I_u1(_syscall);
  301. I_u1u2s3(_bbit0);
  302. I_u1u2s3(_bbit1);
  303. I_u3u1u2(_lwx)
  304. I_u3u1u2(_ldx)
  305. I_u1u2(_ldpte)
  306. I_u2u1u3(_lddir)
  307. #ifdef CONFIG_CPU_CAVIUM_OCTEON
  308. #include <asm/octeon/octeon.h>
  309. void ISAFUNC(uasm_i_pref)(u32 **buf, unsigned int a, signed int b,
  310. unsigned int c)
  311. {
  312. if (CAVIUM_OCTEON_DCACHE_PREFETCH_WAR && a <= 24 && a != 5)
  313. /*
  314. * As per erratum Core-14449, replace prefetches 0-4,
  315. * 6-24 with 'pref 28'.
  316. */
  317. build_insn(buf, insn_pref, c, 28, b);
  318. else
  319. build_insn(buf, insn_pref, c, a, b);
  320. }
  321. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_i_pref));
  322. #else
  323. I_u2s3u1(_pref)
  324. #endif
  325. /* Handle labels. */
  326. void ISAFUNC(uasm_build_label)(struct uasm_label **lab, u32 *addr, int lid)
  327. {
  328. (*lab)->addr = addr;
  329. (*lab)->lab = lid;
  330. (*lab)++;
  331. }
  332. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_build_label));
  333. int ISAFUNC(uasm_in_compat_space_p)(long addr)
  334. {
  335. /* Is this address in 32bit compat space? */
  336. return addr == (int)addr;
  337. }
  338. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_in_compat_space_p));
  339. static int uasm_rel_highest(long val)
  340. {
  341. #ifdef CONFIG_64BIT
  342. return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000;
  343. #else
  344. return 0;
  345. #endif
  346. }
  347. static int uasm_rel_higher(long val)
  348. {
  349. #ifdef CONFIG_64BIT
  350. return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000;
  351. #else
  352. return 0;
  353. #endif
  354. }
  355. int ISAFUNC(uasm_rel_hi)(long val)
  356. {
  357. return ((((val + 0x8000L) >> 16) & 0xffff) ^ 0x8000) - 0x8000;
  358. }
  359. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_rel_hi));
  360. int ISAFUNC(uasm_rel_lo)(long val)
  361. {
  362. return ((val & 0xffff) ^ 0x8000) - 0x8000;
  363. }
  364. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_rel_lo));
  365. void ISAFUNC(UASM_i_LA_mostly)(u32 **buf, unsigned int rs, long addr)
  366. {
  367. if (!ISAFUNC(uasm_in_compat_space_p)(addr)) {
  368. ISAFUNC(uasm_i_lui)(buf, rs, uasm_rel_highest(addr));
  369. if (uasm_rel_higher(addr))
  370. ISAFUNC(uasm_i_daddiu)(buf, rs, rs, uasm_rel_higher(addr));
  371. if (ISAFUNC(uasm_rel_hi(addr))) {
  372. ISAFUNC(uasm_i_dsll)(buf, rs, rs, 16);
  373. ISAFUNC(uasm_i_daddiu)(buf, rs, rs,
  374. ISAFUNC(uasm_rel_hi)(addr));
  375. ISAFUNC(uasm_i_dsll)(buf, rs, rs, 16);
  376. } else
  377. ISAFUNC(uasm_i_dsll32)(buf, rs, rs, 0);
  378. } else
  379. ISAFUNC(uasm_i_lui)(buf, rs, ISAFUNC(uasm_rel_hi(addr)));
  380. }
  381. UASM_EXPORT_SYMBOL(ISAFUNC(UASM_i_LA_mostly));
  382. void ISAFUNC(UASM_i_LA)(u32 **buf, unsigned int rs, long addr)
  383. {
  384. ISAFUNC(UASM_i_LA_mostly)(buf, rs, addr);
  385. if (ISAFUNC(uasm_rel_lo(addr))) {
  386. if (!ISAFUNC(uasm_in_compat_space_p)(addr))
  387. ISAFUNC(uasm_i_daddiu)(buf, rs, rs,
  388. ISAFUNC(uasm_rel_lo(addr)));
  389. else
  390. ISAFUNC(uasm_i_addiu)(buf, rs, rs,
  391. ISAFUNC(uasm_rel_lo(addr)));
  392. }
  393. }
  394. UASM_EXPORT_SYMBOL(ISAFUNC(UASM_i_LA));
  395. /* Handle relocations. */
  396. void ISAFUNC(uasm_r_mips_pc16)(struct uasm_reloc **rel, u32 *addr, int lid)
  397. {
  398. (*rel)->addr = addr;
  399. (*rel)->type = R_MIPS_PC16;
  400. (*rel)->lab = lid;
  401. (*rel)++;
  402. }
  403. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_r_mips_pc16));
  404. static inline void __resolve_relocs(struct uasm_reloc *rel,
  405. struct uasm_label *lab);
  406. void ISAFUNC(uasm_resolve_relocs)(struct uasm_reloc *rel,
  407. struct uasm_label *lab)
  408. {
  409. struct uasm_label *l;
  410. for (; rel->lab != UASM_LABEL_INVALID; rel++)
  411. for (l = lab; l->lab != UASM_LABEL_INVALID; l++)
  412. if (rel->lab == l->lab)
  413. __resolve_relocs(rel, l);
  414. }
  415. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_resolve_relocs));
  416. void ISAFUNC(uasm_move_relocs)(struct uasm_reloc *rel, u32 *first, u32 *end,
  417. long off)
  418. {
  419. for (; rel->lab != UASM_LABEL_INVALID; rel++)
  420. if (rel->addr >= first && rel->addr < end)
  421. rel->addr += off;
  422. }
  423. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_move_relocs));
  424. void ISAFUNC(uasm_move_labels)(struct uasm_label *lab, u32 *first, u32 *end,
  425. long off)
  426. {
  427. for (; lab->lab != UASM_LABEL_INVALID; lab++)
  428. if (lab->addr >= first && lab->addr < end)
  429. lab->addr += off;
  430. }
  431. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_move_labels));
  432. void ISAFUNC(uasm_copy_handler)(struct uasm_reloc *rel, struct uasm_label *lab,
  433. u32 *first, u32 *end, u32 *target)
  434. {
  435. long off = (long)(target - first);
  436. memcpy(target, first, (end - first) * sizeof(u32));
  437. ISAFUNC(uasm_move_relocs(rel, first, end, off));
  438. ISAFUNC(uasm_move_labels(lab, first, end, off));
  439. }
  440. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_copy_handler));
  441. int ISAFUNC(uasm_insn_has_bdelay)(struct uasm_reloc *rel, u32 *addr)
  442. {
  443. for (; rel->lab != UASM_LABEL_INVALID; rel++) {
  444. if (rel->addr == addr
  445. && (rel->type == R_MIPS_PC16
  446. || rel->type == R_MIPS_26))
  447. return 1;
  448. }
  449. return 0;
  450. }
  451. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_insn_has_bdelay));
  452. /* Convenience functions for labeled branches. */
  453. void ISAFUNC(uasm_il_bltz)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  454. int lid)
  455. {
  456. uasm_r_mips_pc16(r, *p, lid);
  457. ISAFUNC(uasm_i_bltz)(p, reg, 0);
  458. }
  459. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bltz));
  460. void ISAFUNC(uasm_il_b)(u32 **p, struct uasm_reloc **r, int lid)
  461. {
  462. uasm_r_mips_pc16(r, *p, lid);
  463. ISAFUNC(uasm_i_b)(p, 0);
  464. }
  465. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_b));
  466. void ISAFUNC(uasm_il_beq)(u32 **p, struct uasm_reloc **r, unsigned int r1,
  467. unsigned int r2, int lid)
  468. {
  469. uasm_r_mips_pc16(r, *p, lid);
  470. ISAFUNC(uasm_i_beq)(p, r1, r2, 0);
  471. }
  472. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beq));
  473. void ISAFUNC(uasm_il_beqz)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  474. int lid)
  475. {
  476. uasm_r_mips_pc16(r, *p, lid);
  477. ISAFUNC(uasm_i_beqz)(p, reg, 0);
  478. }
  479. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beqz));
  480. void ISAFUNC(uasm_il_beqzl)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  481. int lid)
  482. {
  483. uasm_r_mips_pc16(r, *p, lid);
  484. ISAFUNC(uasm_i_beqzl)(p, reg, 0);
  485. }
  486. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beqzl));
  487. void ISAFUNC(uasm_il_bne)(u32 **p, struct uasm_reloc **r, unsigned int reg1,
  488. unsigned int reg2, int lid)
  489. {
  490. uasm_r_mips_pc16(r, *p, lid);
  491. ISAFUNC(uasm_i_bne)(p, reg1, reg2, 0);
  492. }
  493. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bne));
  494. void ISAFUNC(uasm_il_bnez)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  495. int lid)
  496. {
  497. uasm_r_mips_pc16(r, *p, lid);
  498. ISAFUNC(uasm_i_bnez)(p, reg, 0);
  499. }
  500. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bnez));
  501. void ISAFUNC(uasm_il_bgezl)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  502. int lid)
  503. {
  504. uasm_r_mips_pc16(r, *p, lid);
  505. ISAFUNC(uasm_i_bgezl)(p, reg, 0);
  506. }
  507. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bgezl));
  508. void ISAFUNC(uasm_il_bgez)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  509. int lid)
  510. {
  511. uasm_r_mips_pc16(r, *p, lid);
  512. ISAFUNC(uasm_i_bgez)(p, reg, 0);
  513. }
  514. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bgez));
  515. void ISAFUNC(uasm_il_bbit0)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  516. unsigned int bit, int lid)
  517. {
  518. uasm_r_mips_pc16(r, *p, lid);
  519. ISAFUNC(uasm_i_bbit0)(p, reg, bit, 0);
  520. }
  521. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bbit0));
  522. void ISAFUNC(uasm_il_bbit1)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  523. unsigned int bit, int lid)
  524. {
  525. uasm_r_mips_pc16(r, *p, lid);
  526. ISAFUNC(uasm_i_bbit1)(p, reg, bit, 0);
  527. }
  528. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bbit1));