uasm.c 13 KB

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