uasm.c 14 KB

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