uasm.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  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_mfhi, insn_mflo, insn_mtc0, insn_mul,
  52. insn_or, insn_ori, insn_pref, insn_rfe, insn_rotr, insn_sc, insn_scd,
  53. insn_sd, insn_sll, insn_sllv, insn_slt, insn_sltiu, insn_sltu, insn_sra,
  54. insn_srl, insn_srlv, insn_subu, insn_sw, insn_sync, insn_syscall,
  55. insn_tlbp, insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, insn_wsbh,
  56. 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_u1(_mfhi)
  248. I_u1(_mflo)
  249. I_u1u2u3(_mtc0)
  250. I_u3u1u2(_mul)
  251. I_u2u1u3(_ori)
  252. I_u3u1u2(_or)
  253. I_0(_rfe)
  254. I_u2s3u1(_sc)
  255. I_u2s3u1(_scd)
  256. I_u2s3u1(_sd)
  257. I_u2u1u3(_sll)
  258. I_u3u2u1(_sllv)
  259. I_s3s1s2(_slt)
  260. I_u2u1s3(_sltiu)
  261. I_u3u1u2(_sltu)
  262. I_u2u1u3(_sra)
  263. I_u2u1u3(_srl)
  264. I_u3u2u1(_srlv)
  265. I_u2u1u3(_rotr)
  266. I_u3u1u2(_subu)
  267. I_u2s3u1(_sw)
  268. I_u1(_sync)
  269. I_0(_tlbp)
  270. I_0(_tlbr)
  271. I_0(_tlbwi)
  272. I_0(_tlbwr)
  273. I_u1(_wait);
  274. I_u2u1(_wsbh)
  275. I_u3u1u2(_xor)
  276. I_u2u1u3(_xori)
  277. I_u2u1(_yield)
  278. I_u2u1msbu3(_dins);
  279. I_u2u1msb32u3(_dinsm);
  280. I_u1(_syscall);
  281. I_u1u2s3(_bbit0);
  282. I_u1u2s3(_bbit1);
  283. I_u3u1u2(_lwx)
  284. I_u3u1u2(_ldx)
  285. #ifdef CONFIG_CPU_CAVIUM_OCTEON
  286. #include <asm/octeon/octeon.h>
  287. void ISAFUNC(uasm_i_pref)(u32 **buf, unsigned int a, signed int b,
  288. unsigned int c)
  289. {
  290. if (OCTEON_IS_MODEL(OCTEON_CN63XX_PASS1_X) && a <= 24 && a != 5)
  291. /*
  292. * As per erratum Core-14449, replace prefetches 0-4,
  293. * 6-24 with 'pref 28'.
  294. */
  295. build_insn(buf, insn_pref, c, 28, b);
  296. else
  297. build_insn(buf, insn_pref, c, a, b);
  298. }
  299. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_i_pref));
  300. #else
  301. I_u2s3u1(_pref)
  302. #endif
  303. /* Handle labels. */
  304. void ISAFUNC(uasm_build_label)(struct uasm_label **lab, u32 *addr, int lid)
  305. {
  306. (*lab)->addr = addr;
  307. (*lab)->lab = lid;
  308. (*lab)++;
  309. }
  310. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_build_label));
  311. int ISAFUNC(uasm_in_compat_space_p)(long addr)
  312. {
  313. /* Is this address in 32bit compat space? */
  314. #ifdef CONFIG_64BIT
  315. return (((addr) & 0xffffffff00000000L) == 0xffffffff00000000L);
  316. #else
  317. return 1;
  318. #endif
  319. }
  320. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_in_compat_space_p));
  321. static int uasm_rel_highest(long val)
  322. {
  323. #ifdef CONFIG_64BIT
  324. return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000;
  325. #else
  326. return 0;
  327. #endif
  328. }
  329. static int uasm_rel_higher(long val)
  330. {
  331. #ifdef CONFIG_64BIT
  332. return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000;
  333. #else
  334. return 0;
  335. #endif
  336. }
  337. int ISAFUNC(uasm_rel_hi)(long val)
  338. {
  339. return ((((val + 0x8000L) >> 16) & 0xffff) ^ 0x8000) - 0x8000;
  340. }
  341. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_rel_hi));
  342. int ISAFUNC(uasm_rel_lo)(long val)
  343. {
  344. return ((val & 0xffff) ^ 0x8000) - 0x8000;
  345. }
  346. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_rel_lo));
  347. void ISAFUNC(UASM_i_LA_mostly)(u32 **buf, unsigned int rs, long addr)
  348. {
  349. if (!ISAFUNC(uasm_in_compat_space_p)(addr)) {
  350. ISAFUNC(uasm_i_lui)(buf, rs, uasm_rel_highest(addr));
  351. if (uasm_rel_higher(addr))
  352. ISAFUNC(uasm_i_daddiu)(buf, rs, rs, uasm_rel_higher(addr));
  353. if (ISAFUNC(uasm_rel_hi(addr))) {
  354. ISAFUNC(uasm_i_dsll)(buf, rs, rs, 16);
  355. ISAFUNC(uasm_i_daddiu)(buf, rs, rs,
  356. ISAFUNC(uasm_rel_hi)(addr));
  357. ISAFUNC(uasm_i_dsll)(buf, rs, rs, 16);
  358. } else
  359. ISAFUNC(uasm_i_dsll32)(buf, rs, rs, 0);
  360. } else
  361. ISAFUNC(uasm_i_lui)(buf, rs, ISAFUNC(uasm_rel_hi(addr)));
  362. }
  363. UASM_EXPORT_SYMBOL(ISAFUNC(UASM_i_LA_mostly));
  364. void ISAFUNC(UASM_i_LA)(u32 **buf, unsigned int rs, long addr)
  365. {
  366. ISAFUNC(UASM_i_LA_mostly)(buf, rs, addr);
  367. if (ISAFUNC(uasm_rel_lo(addr))) {
  368. if (!ISAFUNC(uasm_in_compat_space_p)(addr))
  369. ISAFUNC(uasm_i_daddiu)(buf, rs, rs,
  370. ISAFUNC(uasm_rel_lo(addr)));
  371. else
  372. ISAFUNC(uasm_i_addiu)(buf, rs, rs,
  373. ISAFUNC(uasm_rel_lo(addr)));
  374. }
  375. }
  376. UASM_EXPORT_SYMBOL(ISAFUNC(UASM_i_LA));
  377. /* Handle relocations. */
  378. void ISAFUNC(uasm_r_mips_pc16)(struct uasm_reloc **rel, u32 *addr, int lid)
  379. {
  380. (*rel)->addr = addr;
  381. (*rel)->type = R_MIPS_PC16;
  382. (*rel)->lab = lid;
  383. (*rel)++;
  384. }
  385. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_r_mips_pc16));
  386. static inline void __resolve_relocs(struct uasm_reloc *rel,
  387. struct uasm_label *lab);
  388. void ISAFUNC(uasm_resolve_relocs)(struct uasm_reloc *rel,
  389. struct uasm_label *lab)
  390. {
  391. struct uasm_label *l;
  392. for (; rel->lab != UASM_LABEL_INVALID; rel++)
  393. for (l = lab; l->lab != UASM_LABEL_INVALID; l++)
  394. if (rel->lab == l->lab)
  395. __resolve_relocs(rel, l);
  396. }
  397. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_resolve_relocs));
  398. void ISAFUNC(uasm_move_relocs)(struct uasm_reloc *rel, u32 *first, u32 *end,
  399. long off)
  400. {
  401. for (; rel->lab != UASM_LABEL_INVALID; rel++)
  402. if (rel->addr >= first && rel->addr < end)
  403. rel->addr += off;
  404. }
  405. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_move_relocs));
  406. void ISAFUNC(uasm_move_labels)(struct uasm_label *lab, u32 *first, u32 *end,
  407. long off)
  408. {
  409. for (; lab->lab != UASM_LABEL_INVALID; lab++)
  410. if (lab->addr >= first && lab->addr < end)
  411. lab->addr += off;
  412. }
  413. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_move_labels));
  414. void ISAFUNC(uasm_copy_handler)(struct uasm_reloc *rel, struct uasm_label *lab,
  415. u32 *first, u32 *end, u32 *target)
  416. {
  417. long off = (long)(target - first);
  418. memcpy(target, first, (end - first) * sizeof(u32));
  419. ISAFUNC(uasm_move_relocs(rel, first, end, off));
  420. ISAFUNC(uasm_move_labels(lab, first, end, off));
  421. }
  422. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_copy_handler));
  423. int ISAFUNC(uasm_insn_has_bdelay)(struct uasm_reloc *rel, u32 *addr)
  424. {
  425. for (; rel->lab != UASM_LABEL_INVALID; rel++) {
  426. if (rel->addr == addr
  427. && (rel->type == R_MIPS_PC16
  428. || rel->type == R_MIPS_26))
  429. return 1;
  430. }
  431. return 0;
  432. }
  433. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_insn_has_bdelay));
  434. /* Convenience functions for labeled branches. */
  435. void ISAFUNC(uasm_il_bltz)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  436. int lid)
  437. {
  438. uasm_r_mips_pc16(r, *p, lid);
  439. ISAFUNC(uasm_i_bltz)(p, reg, 0);
  440. }
  441. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bltz));
  442. void ISAFUNC(uasm_il_b)(u32 **p, struct uasm_reloc **r, int lid)
  443. {
  444. uasm_r_mips_pc16(r, *p, lid);
  445. ISAFUNC(uasm_i_b)(p, 0);
  446. }
  447. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_b));
  448. void ISAFUNC(uasm_il_beq)(u32 **p, struct uasm_reloc **r, unsigned int r1,
  449. unsigned int r2, int lid)
  450. {
  451. uasm_r_mips_pc16(r, *p, lid);
  452. ISAFUNC(uasm_i_beq)(p, r1, r2, 0);
  453. }
  454. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beq));
  455. void ISAFUNC(uasm_il_beqz)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  456. int lid)
  457. {
  458. uasm_r_mips_pc16(r, *p, lid);
  459. ISAFUNC(uasm_i_beqz)(p, reg, 0);
  460. }
  461. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beqz));
  462. void ISAFUNC(uasm_il_beqzl)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  463. int lid)
  464. {
  465. uasm_r_mips_pc16(r, *p, lid);
  466. ISAFUNC(uasm_i_beqzl)(p, reg, 0);
  467. }
  468. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beqzl));
  469. void ISAFUNC(uasm_il_bne)(u32 **p, struct uasm_reloc **r, unsigned int reg1,
  470. unsigned int reg2, int lid)
  471. {
  472. uasm_r_mips_pc16(r, *p, lid);
  473. ISAFUNC(uasm_i_bne)(p, reg1, reg2, 0);
  474. }
  475. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bne));
  476. void ISAFUNC(uasm_il_bnez)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  477. int lid)
  478. {
  479. uasm_r_mips_pc16(r, *p, lid);
  480. ISAFUNC(uasm_i_bnez)(p, reg, 0);
  481. }
  482. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bnez));
  483. void ISAFUNC(uasm_il_bgezl)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  484. int lid)
  485. {
  486. uasm_r_mips_pc16(r, *p, lid);
  487. ISAFUNC(uasm_i_bgezl)(p, reg, 0);
  488. }
  489. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bgezl));
  490. void ISAFUNC(uasm_il_bgez)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  491. int lid)
  492. {
  493. uasm_r_mips_pc16(r, *p, lid);
  494. ISAFUNC(uasm_i_bgez)(p, reg, 0);
  495. }
  496. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bgez));
  497. void ISAFUNC(uasm_il_bbit0)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  498. unsigned int bit, int lid)
  499. {
  500. uasm_r_mips_pc16(r, *p, lid);
  501. ISAFUNC(uasm_i_bbit0)(p, reg, bit, 0);
  502. }
  503. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bbit0));
  504. void ISAFUNC(uasm_il_bbit1)(u32 **p, struct uasm_reloc **r, unsigned int reg,
  505. unsigned int bit, int lid)
  506. {
  507. uasm_r_mips_pc16(r, *p, lid);
  508. ISAFUNC(uasm_i_bbit1)(p, reg, bit, 0);
  509. }
  510. UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bbit1));