libnvcuvid.so.tramp.S 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. /*
  2. * Copyright 2018-2020 Yury Gribov
  3. *
  4. * The MIT License (MIT)
  5. *
  6. * Use of this source code is governed by MIT license that can be
  7. * found in the LICENSE.txt file.
  8. */
  9. .data
  10. .globl _libnvcuvid_so_tramp_table
  11. .hidden _libnvcuvid_so_tramp_table
  12. .align 8
  13. _libnvcuvid_so_tramp_table:
  14. .zero 248
  15. .text
  16. .globl _libnvcuvid_so_tramp_resolve
  17. .hidden _libnvcuvid_so_tramp_resolve
  18. .globl _libnvcuvid_so_save_regs_and_resolve
  19. .hidden _libnvcuvid_so_save_regs_and_resolve
  20. .type _libnvcuvid_so_save_regs_and_resolve, %function
  21. _libnvcuvid_so_save_regs_and_resolve:
  22. .cfi_startproc
  23. #define PUSH_REG(reg) pushq %reg ; .cfi_adjust_cfa_offset 8; .cfi_rel_offset reg, 0
  24. #define POP_REG(reg) popq %reg ; .cfi_adjust_cfa_offset -8; .cfi_restore reg
  25. #define DEC_STACK(d) subq $d, %rsp; .cfi_adjust_cfa_offset d
  26. #define INC_STACK(d) addq $d, %rsp; .cfi_adjust_cfa_offset -d
  27. #define PUSH_XMM_REG(reg) DEC_STACK(16); movdqa %reg, (%rsp); .cfi_rel_offset reg, 0
  28. #define POP_XMM_REG(reg) movdqa (%rsp), %reg; .cfi_restore reg; INC_STACK(16)
  29. // Slow path which calls dlsym, taken only on first call.
  30. // All registers are stored to handle arbitrary calling conventions
  31. // (except x87 FPU registers which do not have to be preserved).
  32. // For Dwarf directives, read https://www.imperialviolet.org/2017/01/18/cfi.html.
  33. // FIXME: AVX (YMM, ZMM) registers are NOT saved to simplify code.
  34. PUSH_REG(rdi) // 16
  35. mov 0x10(%rsp), %rdi
  36. PUSH_REG(rax)
  37. PUSH_REG(rbx) // 16
  38. PUSH_REG(rcx)
  39. PUSH_REG(rdx) // 16
  40. PUSH_REG(rbp)
  41. PUSH_REG(rsi) // 16
  42. PUSH_REG(r8)
  43. PUSH_REG(r9) // 16
  44. PUSH_REG(r10)
  45. PUSH_REG(r11) // 16
  46. PUSH_REG(r12)
  47. PUSH_REG(r13) // 16
  48. PUSH_REG(r14)
  49. PUSH_REG(r15) // 16
  50. PUSH_XMM_REG(xmm0)
  51. PUSH_XMM_REG(xmm1)
  52. PUSH_XMM_REG(xmm2)
  53. PUSH_XMM_REG(xmm3)
  54. PUSH_XMM_REG(xmm4)
  55. PUSH_XMM_REG(xmm5)
  56. PUSH_XMM_REG(xmm6)
  57. PUSH_XMM_REG(xmm7)
  58. // Stack is just 8-byte aligned but callee will re-align to 16
  59. call _libnvcuvid_so_tramp_resolve
  60. POP_XMM_REG(xmm7)
  61. POP_XMM_REG(xmm6)
  62. POP_XMM_REG(xmm5)
  63. POP_XMM_REG(xmm4)
  64. POP_XMM_REG(xmm3)
  65. POP_XMM_REG(xmm2)
  66. POP_XMM_REG(xmm1)
  67. POP_XMM_REG(xmm0) // 16
  68. POP_REG(r15)
  69. POP_REG(r14) // 16
  70. POP_REG(r13)
  71. POP_REG(r12) // 16
  72. POP_REG(r11)
  73. POP_REG(r10) // 16
  74. POP_REG(r9)
  75. POP_REG(r8) // 16
  76. POP_REG(rsi)
  77. POP_REG(rbp) // 16
  78. POP_REG(rdx)
  79. POP_REG(rcx) // 16
  80. POP_REG(rbx)
  81. POP_REG(rax) // 16
  82. POP_REG(rdi)
  83. ret
  84. .cfi_endproc
  85. /*
  86. * Copyright 2018-2019 Yury Gribov
  87. *
  88. * The MIT License (MIT)
  89. *
  90. * Use of this source code is governed by MIT license that can be
  91. * found in the LICENSE.txt file.
  92. */
  93. .globl __std_1U4S4U_X02
  94. .p2align 4
  95. .type __std_1U4S4U_X02, %function
  96. __std_1U4S4U_X02:
  97. .cfi_startproc
  98. // Intel opt. manual says to
  99. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  100. // to hint static predictor.
  101. cmpq $0, _libnvcuvid_so_tramp_table+0(%rip)
  102. je 2f
  103. 1:
  104. jmp *_libnvcuvid_so_tramp_table+0(%rip)
  105. 2:
  106. pushq $0
  107. .cfi_adjust_cfa_offset 8
  108. call _libnvcuvid_so_save_regs_and_resolve
  109. addq $8, %rsp
  110. .cfi_adjust_cfa_offset -8
  111. jmp 1b
  112. .cfi_endproc
  113. /*
  114. * Copyright 2018-2019 Yury Gribov
  115. *
  116. * The MIT License (MIT)
  117. *
  118. * Use of this source code is governed by MIT license that can be
  119. * found in the LICENSE.txt file.
  120. */
  121. .globl __std_2U4S4U_X08
  122. .p2align 4
  123. .type __std_2U4S4U_X08, %function
  124. __std_2U4S4U_X08:
  125. .cfi_startproc
  126. // Intel opt. manual says to
  127. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  128. // to hint static predictor.
  129. cmpq $0, _libnvcuvid_so_tramp_table+8(%rip)
  130. je 2f
  131. 1:
  132. jmp *_libnvcuvid_so_tramp_table+8(%rip)
  133. 2:
  134. pushq $1
  135. .cfi_adjust_cfa_offset 8
  136. call _libnvcuvid_so_save_regs_and_resolve
  137. addq $8, %rsp
  138. .cfi_adjust_cfa_offset -8
  139. jmp 1b
  140. .cfi_endproc
  141. /*
  142. * Copyright 2018-2019 Yury Gribov
  143. *
  144. * The MIT License (MIT)
  145. *
  146. * Use of this source code is governed by MIT license that can be
  147. * found in the LICENSE.txt file.
  148. */
  149. .globl __std_4U4S4U_X04
  150. .p2align 4
  151. .type __std_4U4S4U_X04, %function
  152. __std_4U4S4U_X04:
  153. .cfi_startproc
  154. // Intel opt. manual says to
  155. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  156. // to hint static predictor.
  157. cmpq $0, _libnvcuvid_so_tramp_table+16(%rip)
  158. je 2f
  159. 1:
  160. jmp *_libnvcuvid_so_tramp_table+16(%rip)
  161. 2:
  162. pushq $2
  163. .cfi_adjust_cfa_offset 8
  164. call _libnvcuvid_so_save_regs_and_resolve
  165. addq $8, %rsp
  166. .cfi_adjust_cfa_offset -8
  167. jmp 1b
  168. .cfi_endproc
  169. /*
  170. * Copyright 2018-2019 Yury Gribov
  171. *
  172. * The MIT License (MIT)
  173. *
  174. * Use of this source code is governed by MIT license that can be
  175. * found in the LICENSE.txt file.
  176. */
  177. .globl cuvidConvertYUVToRGB
  178. .p2align 4
  179. .type cuvidConvertYUVToRGB, %function
  180. cuvidConvertYUVToRGB:
  181. .cfi_startproc
  182. // Intel opt. manual says to
  183. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  184. // to hint static predictor.
  185. cmpq $0, _libnvcuvid_so_tramp_table+24(%rip)
  186. je 2f
  187. 1:
  188. jmp *_libnvcuvid_so_tramp_table+24(%rip)
  189. 2:
  190. pushq $3
  191. .cfi_adjust_cfa_offset 8
  192. call _libnvcuvid_so_save_regs_and_resolve
  193. addq $8, %rsp
  194. .cfi_adjust_cfa_offset -8
  195. jmp 1b
  196. .cfi_endproc
  197. /*
  198. * Copyright 2018-2019 Yury Gribov
  199. *
  200. * The MIT License (MIT)
  201. *
  202. * Use of this source code is governed by MIT license that can be
  203. * found in the LICENSE.txt file.
  204. */
  205. .globl cuvidConvertYUVToRGBArray
  206. .p2align 4
  207. .type cuvidConvertYUVToRGBArray, %function
  208. cuvidConvertYUVToRGBArray:
  209. .cfi_startproc
  210. // Intel opt. manual says to
  211. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  212. // to hint static predictor.
  213. cmpq $0, _libnvcuvid_so_tramp_table+32(%rip)
  214. je 2f
  215. 1:
  216. jmp *_libnvcuvid_so_tramp_table+32(%rip)
  217. 2:
  218. pushq $4
  219. .cfi_adjust_cfa_offset 8
  220. call _libnvcuvid_so_save_regs_and_resolve
  221. addq $8, %rsp
  222. .cfi_adjust_cfa_offset -8
  223. jmp 1b
  224. .cfi_endproc
  225. /*
  226. * Copyright 2018-2019 Yury Gribov
  227. *
  228. * The MIT License (MIT)
  229. *
  230. * Use of this source code is governed by MIT license that can be
  231. * found in the LICENSE.txt file.
  232. */
  233. .globl cuvidCreateDecoder
  234. .p2align 4
  235. .type cuvidCreateDecoder, %function
  236. cuvidCreateDecoder:
  237. .cfi_startproc
  238. // Intel opt. manual says to
  239. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  240. // to hint static predictor.
  241. cmpq $0, _libnvcuvid_so_tramp_table+40(%rip)
  242. je 2f
  243. 1:
  244. jmp *_libnvcuvid_so_tramp_table+40(%rip)
  245. 2:
  246. pushq $5
  247. .cfi_adjust_cfa_offset 8
  248. call _libnvcuvid_so_save_regs_and_resolve
  249. addq $8, %rsp
  250. .cfi_adjust_cfa_offset -8
  251. jmp 1b
  252. .cfi_endproc
  253. /*
  254. * Copyright 2018-2019 Yury Gribov
  255. *
  256. * The MIT License (MIT)
  257. *
  258. * Use of this source code is governed by MIT license that can be
  259. * found in the LICENSE.txt file.
  260. */
  261. .globl cuvidCreateVideoParser
  262. .p2align 4
  263. .type cuvidCreateVideoParser, %function
  264. cuvidCreateVideoParser:
  265. .cfi_startproc
  266. // Intel opt. manual says to
  267. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  268. // to hint static predictor.
  269. cmpq $0, _libnvcuvid_so_tramp_table+48(%rip)
  270. je 2f
  271. 1:
  272. jmp *_libnvcuvid_so_tramp_table+48(%rip)
  273. 2:
  274. pushq $6
  275. .cfi_adjust_cfa_offset 8
  276. call _libnvcuvid_so_save_regs_and_resolve
  277. addq $8, %rsp
  278. .cfi_adjust_cfa_offset -8
  279. jmp 1b
  280. .cfi_endproc
  281. /*
  282. * Copyright 2018-2019 Yury Gribov
  283. *
  284. * The MIT License (MIT)
  285. *
  286. * Use of this source code is governed by MIT license that can be
  287. * found in the LICENSE.txt file.
  288. */
  289. .globl cuvidCreateVideoSource
  290. .p2align 4
  291. .type cuvidCreateVideoSource, %function
  292. cuvidCreateVideoSource:
  293. .cfi_startproc
  294. // Intel opt. manual says to
  295. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  296. // to hint static predictor.
  297. cmpq $0, _libnvcuvid_so_tramp_table+56(%rip)
  298. je 2f
  299. 1:
  300. jmp *_libnvcuvid_so_tramp_table+56(%rip)
  301. 2:
  302. pushq $7
  303. .cfi_adjust_cfa_offset 8
  304. call _libnvcuvid_so_save_regs_and_resolve
  305. addq $8, %rsp
  306. .cfi_adjust_cfa_offset -8
  307. jmp 1b
  308. .cfi_endproc
  309. /*
  310. * Copyright 2018-2019 Yury Gribov
  311. *
  312. * The MIT License (MIT)
  313. *
  314. * Use of this source code is governed by MIT license that can be
  315. * found in the LICENSE.txt file.
  316. */
  317. .globl cuvidCreateVideoSourceW
  318. .p2align 4
  319. .type cuvidCreateVideoSourceW, %function
  320. cuvidCreateVideoSourceW:
  321. .cfi_startproc
  322. // Intel opt. manual says to
  323. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  324. // to hint static predictor.
  325. cmpq $0, _libnvcuvid_so_tramp_table+64(%rip)
  326. je 2f
  327. 1:
  328. jmp *_libnvcuvid_so_tramp_table+64(%rip)
  329. 2:
  330. pushq $8
  331. .cfi_adjust_cfa_offset 8
  332. call _libnvcuvid_so_save_regs_and_resolve
  333. addq $8, %rsp
  334. .cfi_adjust_cfa_offset -8
  335. jmp 1b
  336. .cfi_endproc
  337. /*
  338. * Copyright 2018-2019 Yury Gribov
  339. *
  340. * The MIT License (MIT)
  341. *
  342. * Use of this source code is governed by MIT license that can be
  343. * found in the LICENSE.txt file.
  344. */
  345. .globl cuvidCtxLock
  346. .p2align 4
  347. .type cuvidCtxLock, %function
  348. cuvidCtxLock:
  349. .cfi_startproc
  350. // Intel opt. manual says to
  351. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  352. // to hint static predictor.
  353. cmpq $0, _libnvcuvid_so_tramp_table+72(%rip)
  354. je 2f
  355. 1:
  356. jmp *_libnvcuvid_so_tramp_table+72(%rip)
  357. 2:
  358. pushq $9
  359. .cfi_adjust_cfa_offset 8
  360. call _libnvcuvid_so_save_regs_and_resolve
  361. addq $8, %rsp
  362. .cfi_adjust_cfa_offset -8
  363. jmp 1b
  364. .cfi_endproc
  365. /*
  366. * Copyright 2018-2019 Yury Gribov
  367. *
  368. * The MIT License (MIT)
  369. *
  370. * Use of this source code is governed by MIT license that can be
  371. * found in the LICENSE.txt file.
  372. */
  373. .globl cuvidCtxLockCreate
  374. .p2align 4
  375. .type cuvidCtxLockCreate, %function
  376. cuvidCtxLockCreate:
  377. .cfi_startproc
  378. // Intel opt. manual says to
  379. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  380. // to hint static predictor.
  381. cmpq $0, _libnvcuvid_so_tramp_table+80(%rip)
  382. je 2f
  383. 1:
  384. jmp *_libnvcuvid_so_tramp_table+80(%rip)
  385. 2:
  386. pushq $10
  387. .cfi_adjust_cfa_offset 8
  388. call _libnvcuvid_so_save_regs_and_resolve
  389. addq $8, %rsp
  390. .cfi_adjust_cfa_offset -8
  391. jmp 1b
  392. .cfi_endproc
  393. /*
  394. * Copyright 2018-2019 Yury Gribov
  395. *
  396. * The MIT License (MIT)
  397. *
  398. * Use of this source code is governed by MIT license that can be
  399. * found in the LICENSE.txt file.
  400. */
  401. .globl cuvidCtxLockDestroy
  402. .p2align 4
  403. .type cuvidCtxLockDestroy, %function
  404. cuvidCtxLockDestroy:
  405. .cfi_startproc
  406. // Intel opt. manual says to
  407. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  408. // to hint static predictor.
  409. cmpq $0, _libnvcuvid_so_tramp_table+88(%rip)
  410. je 2f
  411. 1:
  412. jmp *_libnvcuvid_so_tramp_table+88(%rip)
  413. 2:
  414. pushq $11
  415. .cfi_adjust_cfa_offset 8
  416. call _libnvcuvid_so_save_regs_and_resolve
  417. addq $8, %rsp
  418. .cfi_adjust_cfa_offset -8
  419. jmp 1b
  420. .cfi_endproc
  421. /*
  422. * Copyright 2018-2019 Yury Gribov
  423. *
  424. * The MIT License (MIT)
  425. *
  426. * Use of this source code is governed by MIT license that can be
  427. * found in the LICENSE.txt file.
  428. */
  429. .globl cuvidCtxUnlock
  430. .p2align 4
  431. .type cuvidCtxUnlock, %function
  432. cuvidCtxUnlock:
  433. .cfi_startproc
  434. // Intel opt. manual says to
  435. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  436. // to hint static predictor.
  437. cmpq $0, _libnvcuvid_so_tramp_table+96(%rip)
  438. je 2f
  439. 1:
  440. jmp *_libnvcuvid_so_tramp_table+96(%rip)
  441. 2:
  442. pushq $12
  443. .cfi_adjust_cfa_offset 8
  444. call _libnvcuvid_so_save_regs_and_resolve
  445. addq $8, %rsp
  446. .cfi_adjust_cfa_offset -8
  447. jmp 1b
  448. .cfi_endproc
  449. /*
  450. * Copyright 2018-2019 Yury Gribov
  451. *
  452. * The MIT License (MIT)
  453. *
  454. * Use of this source code is governed by MIT license that can be
  455. * found in the LICENSE.txt file.
  456. */
  457. .globl cuvidDecodePicture
  458. .p2align 4
  459. .type cuvidDecodePicture, %function
  460. cuvidDecodePicture:
  461. .cfi_startproc
  462. // Intel opt. manual says to
  463. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  464. // to hint static predictor.
  465. cmpq $0, _libnvcuvid_so_tramp_table+104(%rip)
  466. je 2f
  467. 1:
  468. jmp *_libnvcuvid_so_tramp_table+104(%rip)
  469. 2:
  470. pushq $13
  471. .cfi_adjust_cfa_offset 8
  472. call _libnvcuvid_so_save_regs_and_resolve
  473. addq $8, %rsp
  474. .cfi_adjust_cfa_offset -8
  475. jmp 1b
  476. .cfi_endproc
  477. /*
  478. * Copyright 2018-2019 Yury Gribov
  479. *
  480. * The MIT License (MIT)
  481. *
  482. * Use of this source code is governed by MIT license that can be
  483. * found in the LICENSE.txt file.
  484. */
  485. .globl cuvidDestroyDecoder
  486. .p2align 4
  487. .type cuvidDestroyDecoder, %function
  488. cuvidDestroyDecoder:
  489. .cfi_startproc
  490. // Intel opt. manual says to
  491. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  492. // to hint static predictor.
  493. cmpq $0, _libnvcuvid_so_tramp_table+112(%rip)
  494. je 2f
  495. 1:
  496. jmp *_libnvcuvid_so_tramp_table+112(%rip)
  497. 2:
  498. pushq $14
  499. .cfi_adjust_cfa_offset 8
  500. call _libnvcuvid_so_save_regs_and_resolve
  501. addq $8, %rsp
  502. .cfi_adjust_cfa_offset -8
  503. jmp 1b
  504. .cfi_endproc
  505. /*
  506. * Copyright 2018-2019 Yury Gribov
  507. *
  508. * The MIT License (MIT)
  509. *
  510. * Use of this source code is governed by MIT license that can be
  511. * found in the LICENSE.txt file.
  512. */
  513. .globl cuvidDestroyVideoParser
  514. .p2align 4
  515. .type cuvidDestroyVideoParser, %function
  516. cuvidDestroyVideoParser:
  517. .cfi_startproc
  518. // Intel opt. manual says to
  519. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  520. // to hint static predictor.
  521. cmpq $0, _libnvcuvid_so_tramp_table+120(%rip)
  522. je 2f
  523. 1:
  524. jmp *_libnvcuvid_so_tramp_table+120(%rip)
  525. 2:
  526. pushq $15
  527. .cfi_adjust_cfa_offset 8
  528. call _libnvcuvid_so_save_regs_and_resolve
  529. addq $8, %rsp
  530. .cfi_adjust_cfa_offset -8
  531. jmp 1b
  532. .cfi_endproc
  533. /*
  534. * Copyright 2018-2019 Yury Gribov
  535. *
  536. * The MIT License (MIT)
  537. *
  538. * Use of this source code is governed by MIT license that can be
  539. * found in the LICENSE.txt file.
  540. */
  541. .globl cuvidDestroyVideoSource
  542. .p2align 4
  543. .type cuvidDestroyVideoSource, %function
  544. cuvidDestroyVideoSource:
  545. .cfi_startproc
  546. // Intel opt. manual says to
  547. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  548. // to hint static predictor.
  549. cmpq $0, _libnvcuvid_so_tramp_table+128(%rip)
  550. je 2f
  551. 1:
  552. jmp *_libnvcuvid_so_tramp_table+128(%rip)
  553. 2:
  554. pushq $16
  555. .cfi_adjust_cfa_offset 8
  556. call _libnvcuvid_so_save_regs_and_resolve
  557. addq $8, %rsp
  558. .cfi_adjust_cfa_offset -8
  559. jmp 1b
  560. .cfi_endproc
  561. /*
  562. * Copyright 2018-2019 Yury Gribov
  563. *
  564. * The MIT License (MIT)
  565. *
  566. * Use of this source code is governed by MIT license that can be
  567. * found in the LICENSE.txt file.
  568. */
  569. .globl cuvidGetDecodeStatus
  570. .p2align 4
  571. .type cuvidGetDecodeStatus, %function
  572. cuvidGetDecodeStatus:
  573. .cfi_startproc
  574. // Intel opt. manual says to
  575. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  576. // to hint static predictor.
  577. cmpq $0, _libnvcuvid_so_tramp_table+136(%rip)
  578. je 2f
  579. 1:
  580. jmp *_libnvcuvid_so_tramp_table+136(%rip)
  581. 2:
  582. pushq $17
  583. .cfi_adjust_cfa_offset 8
  584. call _libnvcuvid_so_save_regs_and_resolve
  585. addq $8, %rsp
  586. .cfi_adjust_cfa_offset -8
  587. jmp 1b
  588. .cfi_endproc
  589. /*
  590. * Copyright 2018-2019 Yury Gribov
  591. *
  592. * The MIT License (MIT)
  593. *
  594. * Use of this source code is governed by MIT license that can be
  595. * found in the LICENSE.txt file.
  596. */
  597. .globl cuvidGetDecoderCaps
  598. .p2align 4
  599. .type cuvidGetDecoderCaps, %function
  600. cuvidGetDecoderCaps:
  601. .cfi_startproc
  602. // Intel opt. manual says to
  603. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  604. // to hint static predictor.
  605. cmpq $0, _libnvcuvid_so_tramp_table+144(%rip)
  606. je 2f
  607. 1:
  608. jmp *_libnvcuvid_so_tramp_table+144(%rip)
  609. 2:
  610. pushq $18
  611. .cfi_adjust_cfa_offset 8
  612. call _libnvcuvid_so_save_regs_and_resolve
  613. addq $8, %rsp
  614. .cfi_adjust_cfa_offset -8
  615. jmp 1b
  616. .cfi_endproc
  617. /*
  618. * Copyright 2018-2019 Yury Gribov
  619. *
  620. * The MIT License (MIT)
  621. *
  622. * Use of this source code is governed by MIT license that can be
  623. * found in the LICENSE.txt file.
  624. */
  625. .globl cuvidGetSourceAudioFormat
  626. .p2align 4
  627. .type cuvidGetSourceAudioFormat, %function
  628. cuvidGetSourceAudioFormat:
  629. .cfi_startproc
  630. // Intel opt. manual says to
  631. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  632. // to hint static predictor.
  633. cmpq $0, _libnvcuvid_so_tramp_table+152(%rip)
  634. je 2f
  635. 1:
  636. jmp *_libnvcuvid_so_tramp_table+152(%rip)
  637. 2:
  638. pushq $19
  639. .cfi_adjust_cfa_offset 8
  640. call _libnvcuvid_so_save_regs_and_resolve
  641. addq $8, %rsp
  642. .cfi_adjust_cfa_offset -8
  643. jmp 1b
  644. .cfi_endproc
  645. /*
  646. * Copyright 2018-2019 Yury Gribov
  647. *
  648. * The MIT License (MIT)
  649. *
  650. * Use of this source code is governed by MIT license that can be
  651. * found in the LICENSE.txt file.
  652. */
  653. .globl cuvidGetSourceVideoFormat
  654. .p2align 4
  655. .type cuvidGetSourceVideoFormat, %function
  656. cuvidGetSourceVideoFormat:
  657. .cfi_startproc
  658. // Intel opt. manual says to
  659. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  660. // to hint static predictor.
  661. cmpq $0, _libnvcuvid_so_tramp_table+160(%rip)
  662. je 2f
  663. 1:
  664. jmp *_libnvcuvid_so_tramp_table+160(%rip)
  665. 2:
  666. pushq $20
  667. .cfi_adjust_cfa_offset 8
  668. call _libnvcuvid_so_save_regs_and_resolve
  669. addq $8, %rsp
  670. .cfi_adjust_cfa_offset -8
  671. jmp 1b
  672. .cfi_endproc
  673. /*
  674. * Copyright 2018-2019 Yury Gribov
  675. *
  676. * The MIT License (MIT)
  677. *
  678. * Use of this source code is governed by MIT license that can be
  679. * found in the LICENSE.txt file.
  680. */
  681. .globl cuvidGetVideoSourceState
  682. .p2align 4
  683. .type cuvidGetVideoSourceState, %function
  684. cuvidGetVideoSourceState:
  685. .cfi_startproc
  686. // Intel opt. manual says to
  687. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  688. // to hint static predictor.
  689. cmpq $0, _libnvcuvid_so_tramp_table+168(%rip)
  690. je 2f
  691. 1:
  692. jmp *_libnvcuvid_so_tramp_table+168(%rip)
  693. 2:
  694. pushq $21
  695. .cfi_adjust_cfa_offset 8
  696. call _libnvcuvid_so_save_regs_and_resolve
  697. addq $8, %rsp
  698. .cfi_adjust_cfa_offset -8
  699. jmp 1b
  700. .cfi_endproc
  701. /*
  702. * Copyright 2018-2019 Yury Gribov
  703. *
  704. * The MIT License (MIT)
  705. *
  706. * Use of this source code is governed by MIT license that can be
  707. * found in the LICENSE.txt file.
  708. */
  709. .globl cuvidMapVideoFrame
  710. .p2align 4
  711. .type cuvidMapVideoFrame, %function
  712. cuvidMapVideoFrame:
  713. .cfi_startproc
  714. // Intel opt. manual says to
  715. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  716. // to hint static predictor.
  717. cmpq $0, _libnvcuvid_so_tramp_table+176(%rip)
  718. je 2f
  719. 1:
  720. jmp *_libnvcuvid_so_tramp_table+176(%rip)
  721. 2:
  722. pushq $22
  723. .cfi_adjust_cfa_offset 8
  724. call _libnvcuvid_so_save_regs_and_resolve
  725. addq $8, %rsp
  726. .cfi_adjust_cfa_offset -8
  727. jmp 1b
  728. .cfi_endproc
  729. /*
  730. * Copyright 2018-2019 Yury Gribov
  731. *
  732. * The MIT License (MIT)
  733. *
  734. * Use of this source code is governed by MIT license that can be
  735. * found in the LICENSE.txt file.
  736. */
  737. .globl cuvidMapVideoFrame64
  738. .p2align 4
  739. .type cuvidMapVideoFrame64, %function
  740. cuvidMapVideoFrame64:
  741. .cfi_startproc
  742. // Intel opt. manual says to
  743. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  744. // to hint static predictor.
  745. cmpq $0, _libnvcuvid_so_tramp_table+184(%rip)
  746. je 2f
  747. 1:
  748. jmp *_libnvcuvid_so_tramp_table+184(%rip)
  749. 2:
  750. pushq $23
  751. .cfi_adjust_cfa_offset 8
  752. call _libnvcuvid_so_save_regs_and_resolve
  753. addq $8, %rsp
  754. .cfi_adjust_cfa_offset -8
  755. jmp 1b
  756. .cfi_endproc
  757. /*
  758. * Copyright 2018-2019 Yury Gribov
  759. *
  760. * The MIT License (MIT)
  761. *
  762. * Use of this source code is governed by MIT license that can be
  763. * found in the LICENSE.txt file.
  764. */
  765. .globl cuvidParseVideoData
  766. .p2align 4
  767. .type cuvidParseVideoData, %function
  768. cuvidParseVideoData:
  769. .cfi_startproc
  770. // Intel opt. manual says to
  771. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  772. // to hint static predictor.
  773. cmpq $0, _libnvcuvid_so_tramp_table+192(%rip)
  774. je 2f
  775. 1:
  776. jmp *_libnvcuvid_so_tramp_table+192(%rip)
  777. 2:
  778. pushq $24
  779. .cfi_adjust_cfa_offset 8
  780. call _libnvcuvid_so_save_regs_and_resolve
  781. addq $8, %rsp
  782. .cfi_adjust_cfa_offset -8
  783. jmp 1b
  784. .cfi_endproc
  785. /*
  786. * Copyright 2018-2019 Yury Gribov
  787. *
  788. * The MIT License (MIT)
  789. *
  790. * Use of this source code is governed by MIT license that can be
  791. * found in the LICENSE.txt file.
  792. */
  793. .globl cuvidPrivateOp
  794. .p2align 4
  795. .type cuvidPrivateOp, %function
  796. cuvidPrivateOp:
  797. .cfi_startproc
  798. // Intel opt. manual says to
  799. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  800. // to hint static predictor.
  801. cmpq $0, _libnvcuvid_so_tramp_table+200(%rip)
  802. je 2f
  803. 1:
  804. jmp *_libnvcuvid_so_tramp_table+200(%rip)
  805. 2:
  806. pushq $25
  807. .cfi_adjust_cfa_offset 8
  808. call _libnvcuvid_so_save_regs_and_resolve
  809. addq $8, %rsp
  810. .cfi_adjust_cfa_offset -8
  811. jmp 1b
  812. .cfi_endproc
  813. /*
  814. * Copyright 2018-2019 Yury Gribov
  815. *
  816. * The MIT License (MIT)
  817. *
  818. * Use of this source code is governed by MIT license that can be
  819. * found in the LICENSE.txt file.
  820. */
  821. .globl cuvidReconfigureDecoder
  822. .p2align 4
  823. .type cuvidReconfigureDecoder, %function
  824. cuvidReconfigureDecoder:
  825. .cfi_startproc
  826. // Intel opt. manual says to
  827. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  828. // to hint static predictor.
  829. cmpq $0, _libnvcuvid_so_tramp_table+208(%rip)
  830. je 2f
  831. 1:
  832. jmp *_libnvcuvid_so_tramp_table+208(%rip)
  833. 2:
  834. pushq $26
  835. .cfi_adjust_cfa_offset 8
  836. call _libnvcuvid_so_save_regs_and_resolve
  837. addq $8, %rsp
  838. .cfi_adjust_cfa_offset -8
  839. jmp 1b
  840. .cfi_endproc
  841. /*
  842. * Copyright 2018-2019 Yury Gribov
  843. *
  844. * The MIT License (MIT)
  845. *
  846. * Use of this source code is governed by MIT license that can be
  847. * found in the LICENSE.txt file.
  848. */
  849. .globl cuvidSetVideoSourceState
  850. .p2align 4
  851. .type cuvidSetVideoSourceState, %function
  852. cuvidSetVideoSourceState:
  853. .cfi_startproc
  854. // Intel opt. manual says to
  855. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  856. // to hint static predictor.
  857. cmpq $0, _libnvcuvid_so_tramp_table+216(%rip)
  858. je 2f
  859. 1:
  860. jmp *_libnvcuvid_so_tramp_table+216(%rip)
  861. 2:
  862. pushq $27
  863. .cfi_adjust_cfa_offset 8
  864. call _libnvcuvid_so_save_regs_and_resolve
  865. addq $8, %rsp
  866. .cfi_adjust_cfa_offset -8
  867. jmp 1b
  868. .cfi_endproc
  869. /*
  870. * Copyright 2018-2019 Yury Gribov
  871. *
  872. * The MIT License (MIT)
  873. *
  874. * Use of this source code is governed by MIT license that can be
  875. * found in the LICENSE.txt file.
  876. */
  877. .globl cuvidUnmapVideoFrame
  878. .p2align 4
  879. .type cuvidUnmapVideoFrame, %function
  880. cuvidUnmapVideoFrame:
  881. .cfi_startproc
  882. // Intel opt. manual says to
  883. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  884. // to hint static predictor.
  885. cmpq $0, _libnvcuvid_so_tramp_table+224(%rip)
  886. je 2f
  887. 1:
  888. jmp *_libnvcuvid_so_tramp_table+224(%rip)
  889. 2:
  890. pushq $28
  891. .cfi_adjust_cfa_offset 8
  892. call _libnvcuvid_so_save_regs_and_resolve
  893. addq $8, %rsp
  894. .cfi_adjust_cfa_offset -8
  895. jmp 1b
  896. .cfi_endproc
  897. /*
  898. * Copyright 2018-2019 Yury Gribov
  899. *
  900. * The MIT License (MIT)
  901. *
  902. * Use of this source code is governed by MIT license that can be
  903. * found in the LICENSE.txt file.
  904. */
  905. .globl cuvidUnmapVideoFrame64
  906. .p2align 4
  907. .type cuvidUnmapVideoFrame64, %function
  908. cuvidUnmapVideoFrame64:
  909. .cfi_startproc
  910. // Intel opt. manual says to
  911. // "make the fall-through code following a conditional branch be the likely target for a branch with a forward target"
  912. // to hint static predictor.
  913. cmpq $0, _libnvcuvid_so_tramp_table+232(%rip)
  914. je 2f
  915. 1:
  916. jmp *_libnvcuvid_so_tramp_table+232(%rip)
  917. 2:
  918. pushq $29
  919. .cfi_adjust_cfa_offset 8
  920. call _libnvcuvid_so_save_regs_and_resolve
  921. addq $8, %rsp
  922. .cfi_adjust_cfa_offset -8
  923. jmp 1b
  924. .cfi_endproc