feature-fixups-test.S 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. /*
  2. * Copyright 2008 Michael Ellerman, IBM Corporation.
  3. *
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. */
  10. #include <asm/feature-fixups.h>
  11. #include <asm/ppc_asm.h>
  12. #include <asm/synch.h>
  13. .text
  14. #define globl(x) \
  15. .globl x; \
  16. x:
  17. globl(ftr_fixup_test1)
  18. or 1,1,1
  19. or 2,2,2 /* fixup will nop out this instruction */
  20. or 3,3,3
  21. globl(end_ftr_fixup_test1)
  22. globl(ftr_fixup_test1_orig)
  23. or 1,1,1
  24. or 2,2,2
  25. or 3,3,3
  26. globl(ftr_fixup_test1_expected)
  27. or 1,1,1
  28. nop
  29. or 3,3,3
  30. globl(ftr_fixup_test2)
  31. or 1,1,1
  32. or 2,2,2 /* fixup will replace this with ftr_fixup_test2_alt */
  33. or 3,3,3
  34. globl(end_ftr_fixup_test2)
  35. globl(ftr_fixup_test2_orig)
  36. or 1,1,1
  37. or 2,2,2
  38. or 3,3,3
  39. globl(ftr_fixup_test2_alt)
  40. or 31,31,31
  41. globl(ftr_fixup_test2_expected)
  42. or 1,1,1
  43. or 31,31,31
  44. or 3,3,3
  45. globl(ftr_fixup_test3)
  46. or 1,1,1
  47. or 2,2,2 /* fixup will fail to replace this */
  48. or 3,3,3
  49. globl(end_ftr_fixup_test3)
  50. globl(ftr_fixup_test3_orig)
  51. or 1,1,1
  52. or 2,2,2
  53. or 3,3,3
  54. globl(ftr_fixup_test3_alt)
  55. or 31,31,31
  56. or 31,31,31
  57. globl(ftr_fixup_test4)
  58. or 1,1,1
  59. or 2,2,2
  60. or 2,2,2
  61. or 2,2,2
  62. or 2,2,2
  63. or 3,3,3
  64. globl(end_ftr_fixup_test4)
  65. globl(ftr_fixup_test4_expected)
  66. or 1,1,1
  67. or 31,31,31
  68. or 31,31,31
  69. nop
  70. nop
  71. or 3,3,3
  72. globl(ftr_fixup_test4_orig)
  73. or 1,1,1
  74. or 2,2,2
  75. or 2,2,2
  76. or 2,2,2
  77. or 2,2,2
  78. or 3,3,3
  79. globl(ftr_fixup_test4_alt)
  80. or 31,31,31
  81. or 31,31,31
  82. globl(ftr_fixup_test5)
  83. or 1,1,1
  84. BEGIN_FTR_SECTION
  85. or 2,2,2
  86. or 2,2,2
  87. or 2,2,2
  88. or 2,2,2
  89. or 2,2,2
  90. or 2,2,2
  91. or 2,2,2
  92. FTR_SECTION_ELSE
  93. 2: b 3f
  94. 3: or 5,5,5
  95. beq 3b
  96. b 1f
  97. or 6,6,6
  98. b 2b
  99. 1: bdnz 3b
  100. ALT_FTR_SECTION_END(0, 1)
  101. or 1,1,1
  102. globl(end_ftr_fixup_test5)
  103. globl(ftr_fixup_test5_expected)
  104. or 1,1,1
  105. 2: b 3f
  106. 3: or 5,5,5
  107. beq 3b
  108. b 1f
  109. or 6,6,6
  110. b 2b
  111. 1: bdnz 3b
  112. or 1,1,1
  113. globl(ftr_fixup_test6)
  114. 1: or 1,1,1
  115. BEGIN_FTR_SECTION
  116. or 5,5,5
  117. 2: PPC_LCMPI r3,0
  118. beq 4f
  119. blt 2b
  120. b 1b
  121. b 4f
  122. FTR_SECTION_ELSE
  123. 2: or 2,2,2
  124. PPC_LCMPI r3,1
  125. beq 3f
  126. blt 2b
  127. b 3f
  128. b 1b
  129. ALT_FTR_SECTION_END(0, 1)
  130. 3: or 1,1,1
  131. or 2,2,2
  132. 4: or 3,3,3
  133. globl(end_ftr_fixup_test6)
  134. globl(ftr_fixup_test6_expected)
  135. 1: or 1,1,1
  136. 2: or 2,2,2
  137. PPC_LCMPI r3,1
  138. beq 3f
  139. blt 2b
  140. b 3f
  141. b 1b
  142. 2: or 1,1,1
  143. or 2,2,2
  144. 3: or 3,3,3
  145. #define MAKE_MACRO_TEST(TYPE) \
  146. globl(ftr_fixup_test_ ##TYPE##_macros) \
  147. or 1,1,1; \
  148. /* Basic test, this section should all be nop'ed */ \
  149. BEGIN_##TYPE##_SECTION \
  150. or 2,2,2; \
  151. or 2,2,2; \
  152. or 2,2,2; \
  153. END_##TYPE##_SECTION(0, 1) \
  154. or 1,1,1; \
  155. or 1,1,1; \
  156. /* Basic test, this section should NOT be nop'ed */ \
  157. BEGIN_##TYPE##_SECTION \
  158. or 2,2,2; \
  159. or 2,2,2; \
  160. or 2,2,2; \
  161. END_##TYPE##_SECTION(0, 0) \
  162. or 1,1,1; \
  163. or 1,1,1; \
  164. /* Nesting test, inner section should be nop'ed */ \
  165. BEGIN_##TYPE##_SECTION \
  166. or 2,2,2; \
  167. or 2,2,2; \
  168. BEGIN_##TYPE##_SECTION_NESTED(80) \
  169. or 3,3,3; \
  170. or 3,3,3; \
  171. END_##TYPE##_SECTION_NESTED(0, 1, 80) \
  172. or 2,2,2; \
  173. or 2,2,2; \
  174. END_##TYPE##_SECTION(0, 0) \
  175. or 1,1,1; \
  176. or 1,1,1; \
  177. /* Nesting test, whole section should be nop'ed */ \
  178. BEGIN_##TYPE##_SECTION \
  179. or 2,2,2; \
  180. or 2,2,2; \
  181. BEGIN_##TYPE##_SECTION_NESTED(80) \
  182. or 3,3,3; \
  183. or 3,3,3; \
  184. END_##TYPE##_SECTION_NESTED(0, 0, 80) \
  185. or 2,2,2; \
  186. or 2,2,2; \
  187. END_##TYPE##_SECTION(0, 1) \
  188. or 1,1,1; \
  189. or 1,1,1; \
  190. /* Nesting test, none should be nop'ed */ \
  191. BEGIN_##TYPE##_SECTION \
  192. or 2,2,2; \
  193. or 2,2,2; \
  194. BEGIN_##TYPE##_SECTION_NESTED(80) \
  195. or 3,3,3; \
  196. or 3,3,3; \
  197. END_##TYPE##_SECTION_NESTED(0, 0, 80) \
  198. or 2,2,2; \
  199. or 2,2,2; \
  200. END_##TYPE##_SECTION(0, 0) \
  201. or 1,1,1; \
  202. or 1,1,1; \
  203. /* Basic alt section test, default case should be taken */ \
  204. BEGIN_##TYPE##_SECTION \
  205. or 3,3,3; \
  206. or 3,3,3; \
  207. or 3,3,3; \
  208. ##TYPE##_SECTION_ELSE \
  209. or 5,5,5; \
  210. or 5,5,5; \
  211. ALT_##TYPE##_SECTION_END(0, 0) \
  212. or 1,1,1; \
  213. or 1,1,1; \
  214. /* Basic alt section test, else case should be taken */ \
  215. BEGIN_##TYPE##_SECTION \
  216. or 3,3,3; \
  217. or 3,3,3; \
  218. or 3,3,3; \
  219. ##TYPE##_SECTION_ELSE \
  220. or 31,31,31; \
  221. or 31,31,31; \
  222. or 31,31,31; \
  223. ALT_##TYPE##_SECTION_END(0, 1) \
  224. or 1,1,1; \
  225. or 1,1,1; \
  226. /* Alt with smaller else case, should be padded with nops */ \
  227. BEGIN_##TYPE##_SECTION \
  228. or 3,3,3; \
  229. or 3,3,3; \
  230. or 3,3,3; \
  231. ##TYPE##_SECTION_ELSE \
  232. or 31,31,31; \
  233. ALT_##TYPE##_SECTION_END(0, 1) \
  234. or 1,1,1; \
  235. or 1,1,1; \
  236. /* Alt section with nested section in default case */ \
  237. /* Default case should be taken, with nop'ed inner section */ \
  238. BEGIN_##TYPE##_SECTION \
  239. or 3,3,3; \
  240. BEGIN_##TYPE##_SECTION_NESTED(95) \
  241. or 3,3,3; \
  242. or 3,3,3; \
  243. END_##TYPE##_SECTION_NESTED(0, 1, 95) \
  244. or 3,3,3; \
  245. ##TYPE##_SECTION_ELSE \
  246. or 2,2,2; \
  247. or 2,2,2; \
  248. ALT_##TYPE##_SECTION_END(0, 0) \
  249. or 1,1,1; \
  250. or 1,1,1; \
  251. /* Alt section with nested section in else, default taken */ \
  252. BEGIN_##TYPE##_SECTION \
  253. or 3,3,3; \
  254. or 3,3,3; \
  255. or 3,3,3; \
  256. ##TYPE##_SECTION_ELSE \
  257. or 5,5,5; \
  258. BEGIN_##TYPE##_SECTION_NESTED(95) \
  259. or 3,3,3; \
  260. END_##TYPE##_SECTION_NESTED(0, 1, 95) \
  261. or 5,5,5; \
  262. ALT_##TYPE##_SECTION_END(0, 0) \
  263. or 1,1,1; \
  264. or 1,1,1; \
  265. /* Alt section with nested section in else, else taken & nop */ \
  266. BEGIN_##TYPE##_SECTION \
  267. or 3,3,3; \
  268. or 3,3,3; \
  269. or 3,3,3; \
  270. ##TYPE##_SECTION_ELSE \
  271. or 5,5,5; \
  272. BEGIN_##TYPE##_SECTION_NESTED(95) \
  273. or 3,3,3; \
  274. END_##TYPE##_SECTION_NESTED(0, 1, 95) \
  275. or 5,5,5; \
  276. ALT_##TYPE##_SECTION_END(0, 1) \
  277. or 1,1,1; \
  278. or 1,1,1; \
  279. /* Feature section with nested alt section, default taken */ \
  280. BEGIN_##TYPE##_SECTION \
  281. or 2,2,2; \
  282. BEGIN_##TYPE##_SECTION_NESTED(95) \
  283. or 1,1,1; \
  284. ##TYPE##_SECTION_ELSE_NESTED(95) \
  285. or 5,5,5; \
  286. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) \
  287. or 2,2,2; \
  288. END_##TYPE##_SECTION(0, 0) \
  289. or 1,1,1; \
  290. or 1,1,1; \
  291. /* Feature section with nested alt section, else taken */ \
  292. BEGIN_##TYPE##_SECTION \
  293. or 2,2,2; \
  294. BEGIN_##TYPE##_SECTION_NESTED(95) \
  295. or 1,1,1; \
  296. ##TYPE##_SECTION_ELSE_NESTED(95) \
  297. or 5,5,5; \
  298. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) \
  299. or 2,2,2; \
  300. END_##TYPE##_SECTION(0, 0) \
  301. or 1,1,1; \
  302. or 1,1,1; \
  303. /* Feature section with nested alt section, all nop'ed */ \
  304. BEGIN_##TYPE##_SECTION \
  305. or 2,2,2; \
  306. BEGIN_##TYPE##_SECTION_NESTED(95) \
  307. or 1,1,1; \
  308. ##TYPE##_SECTION_ELSE_NESTED(95) \
  309. or 5,5,5; \
  310. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) \
  311. or 2,2,2; \
  312. END_##TYPE##_SECTION(0, 1) \
  313. or 1,1,1; \
  314. or 1,1,1; \
  315. /* Nested alt sections, default with inner default taken */ \
  316. BEGIN_##TYPE##_SECTION \
  317. or 2,2,2; \
  318. BEGIN_##TYPE##_SECTION_NESTED(95) \
  319. or 1,1,1; \
  320. ##TYPE##_SECTION_ELSE_NESTED(95) \
  321. or 5,5,5; \
  322. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) \
  323. or 2,2,2; \
  324. ##TYPE##_SECTION_ELSE \
  325. or 31,31,31; \
  326. BEGIN_##TYPE##_SECTION_NESTED(94) \
  327. or 5,5,5; \
  328. ##TYPE##_SECTION_ELSE_NESTED(94) \
  329. or 1,1,1; \
  330. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) \
  331. or 31,31,31; \
  332. ALT_##TYPE##_SECTION_END(0, 0) \
  333. or 1,1,1; \
  334. or 1,1,1; \
  335. /* Nested alt sections, default with inner else taken */ \
  336. BEGIN_##TYPE##_SECTION \
  337. or 2,2,2; \
  338. BEGIN_##TYPE##_SECTION_NESTED(95) \
  339. or 1,1,1; \
  340. ##TYPE##_SECTION_ELSE_NESTED(95) \
  341. or 5,5,5; \
  342. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) \
  343. or 2,2,2; \
  344. ##TYPE##_SECTION_ELSE \
  345. or 31,31,31; \
  346. BEGIN_##TYPE##_SECTION_NESTED(94) \
  347. or 5,5,5; \
  348. ##TYPE##_SECTION_ELSE_NESTED(94) \
  349. or 1,1,1; \
  350. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) \
  351. or 31,31,31; \
  352. ALT_##TYPE##_SECTION_END(0, 0) \
  353. or 1,1,1; \
  354. or 1,1,1; \
  355. /* Nested alt sections, else with inner default taken */ \
  356. BEGIN_##TYPE##_SECTION \
  357. or 2,2,2; \
  358. BEGIN_##TYPE##_SECTION_NESTED(95) \
  359. or 1,1,1; \
  360. ##TYPE##_SECTION_ELSE_NESTED(95) \
  361. or 5,5,5; \
  362. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) \
  363. or 2,2,2; \
  364. ##TYPE##_SECTION_ELSE \
  365. or 31,31,31; \
  366. BEGIN_##TYPE##_SECTION_NESTED(94) \
  367. or 5,5,5; \
  368. ##TYPE##_SECTION_ELSE_NESTED(94) \
  369. or 1,1,1; \
  370. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) \
  371. or 31,31,31; \
  372. ALT_##TYPE##_SECTION_END(0, 1) \
  373. or 1,1,1; \
  374. or 1,1,1; \
  375. /* Nested alt sections, else with inner else taken */ \
  376. BEGIN_##TYPE##_SECTION \
  377. or 2,2,2; \
  378. BEGIN_##TYPE##_SECTION_NESTED(95) \
  379. or 1,1,1; \
  380. ##TYPE##_SECTION_ELSE_NESTED(95) \
  381. or 5,5,5; \
  382. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) \
  383. or 2,2,2; \
  384. ##TYPE##_SECTION_ELSE \
  385. or 31,31,31; \
  386. BEGIN_##TYPE##_SECTION_NESTED(94) \
  387. or 5,5,5; \
  388. ##TYPE##_SECTION_ELSE_NESTED(94) \
  389. or 1,1,1; \
  390. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 94) \
  391. or 31,31,31; \
  392. ALT_##TYPE##_SECTION_END(0, 1) \
  393. or 1,1,1; \
  394. or 1,1,1; \
  395. /* Nested alt sections, else can have large else case */ \
  396. BEGIN_##TYPE##_SECTION \
  397. or 2,2,2; \
  398. or 2,2,2; \
  399. or 2,2,2; \
  400. or 2,2,2; \
  401. ##TYPE##_SECTION_ELSE \
  402. BEGIN_##TYPE##_SECTION_NESTED(94) \
  403. or 5,5,5; \
  404. or 5,5,5; \
  405. or 5,5,5; \
  406. or 5,5,5; \
  407. ##TYPE##_SECTION_ELSE_NESTED(94) \
  408. or 1,1,1; \
  409. or 1,1,1; \
  410. or 1,1,1; \
  411. or 1,1,1; \
  412. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 94) \
  413. ALT_##TYPE##_SECTION_END(0, 1) \
  414. or 1,1,1; \
  415. or 1,1,1;
  416. #define MAKE_MACRO_TEST_EXPECTED(TYPE) \
  417. globl(ftr_fixup_test_ ##TYPE##_macros_expected) \
  418. or 1,1,1; \
  419. /* Basic test, this section should all be nop'ed */ \
  420. /* BEGIN_##TYPE##_SECTION */ \
  421. nop; \
  422. nop; \
  423. nop; \
  424. /* END_##TYPE##_SECTION(0, 1) */ \
  425. or 1,1,1; \
  426. or 1,1,1; \
  427. /* Basic test, this section should NOT be nop'ed */ \
  428. /* BEGIN_##TYPE##_SECTION */ \
  429. or 2,2,2; \
  430. or 2,2,2; \
  431. or 2,2,2; \
  432. /* END_##TYPE##_SECTION(0, 0) */ \
  433. or 1,1,1; \
  434. or 1,1,1; \
  435. /* Nesting test, inner section should be nop'ed */ \
  436. /* BEGIN_##TYPE##_SECTION */ \
  437. or 2,2,2; \
  438. or 2,2,2; \
  439. /* BEGIN_##TYPE##_SECTION_NESTED(80) */ \
  440. nop; \
  441. nop; \
  442. /* END_##TYPE##_SECTION_NESTED(0, 1, 80) */ \
  443. or 2,2,2; \
  444. or 2,2,2; \
  445. /* END_##TYPE##_SECTION(0, 0) */ \
  446. or 1,1,1; \
  447. or 1,1,1; \
  448. /* Nesting test, whole section should be nop'ed */ \
  449. /* NB. inner section is not nop'ed, but then entire outer is */ \
  450. /* BEGIN_##TYPE##_SECTION */ \
  451. nop; \
  452. nop; \
  453. /* BEGIN_##TYPE##_SECTION_NESTED(80) */ \
  454. nop; \
  455. nop; \
  456. /* END_##TYPE##_SECTION_NESTED(0, 0, 80) */ \
  457. nop; \
  458. nop; \
  459. /* END_##TYPE##_SECTION(0, 1) */ \
  460. or 1,1,1; \
  461. or 1,1,1; \
  462. /* Nesting test, none should be nop'ed */ \
  463. /* BEGIN_##TYPE##_SECTION */ \
  464. or 2,2,2; \
  465. or 2,2,2; \
  466. /* BEGIN_##TYPE##_SECTION_NESTED(80) */ \
  467. or 3,3,3; \
  468. or 3,3,3; \
  469. /* END_##TYPE##_SECTION_NESTED(0, 0, 80) */ \
  470. or 2,2,2; \
  471. or 2,2,2; \
  472. /* END_##TYPE##_SECTION(0, 0) */ \
  473. or 1,1,1; \
  474. or 1,1,1; \
  475. /* Basic alt section test, default case should be taken */ \
  476. /* BEGIN_##TYPE##_SECTION */ \
  477. or 3,3,3; \
  478. or 3,3,3; \
  479. or 3,3,3; \
  480. /* ##TYPE##_SECTION_ELSE */ \
  481. /* or 5,5,5; */ \
  482. /* or 5,5,5; */ \
  483. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  484. or 1,1,1; \
  485. or 1,1,1; \
  486. /* Basic alt section test, else case should be taken */ \
  487. /* BEGIN_##TYPE##_SECTION */ \
  488. /* or 3,3,3; */ \
  489. /* or 3,3,3; */ \
  490. /* or 3,3,3; */ \
  491. /* ##TYPE##_SECTION_ELSE */ \
  492. or 31,31,31; \
  493. or 31,31,31; \
  494. or 31,31,31; \
  495. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  496. or 1,1,1; \
  497. or 1,1,1; \
  498. /* Alt with smaller else case, should be padded with nops */ \
  499. /* BEGIN_##TYPE##_SECTION */ \
  500. /* or 3,3,3; */ \
  501. /* or 3,3,3; */ \
  502. /* or 3,3,3; */ \
  503. /* ##TYPE##_SECTION_ELSE */ \
  504. or 31,31,31; \
  505. nop; \
  506. nop; \
  507. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  508. or 1,1,1; \
  509. or 1,1,1; \
  510. /* Alt section with nested section in default case */ \
  511. /* Default case should be taken, with nop'ed inner section */ \
  512. /* BEGIN_##TYPE##_SECTION */ \
  513. or 3,3,3; \
  514. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  515. nop; \
  516. nop; \
  517. /* END_##TYPE##_SECTION_NESTED(0, 1, 95) */ \
  518. or 3,3,3; \
  519. /* ##TYPE##_SECTION_ELSE */ \
  520. /* or 2,2,2; */ \
  521. /* or 2,2,2; */ \
  522. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  523. or 1,1,1; \
  524. or 1,1,1; \
  525. /* Alt section with nested section in else, default taken */ \
  526. /* BEGIN_##TYPE##_SECTION */ \
  527. or 3,3,3; \
  528. or 3,3,3; \
  529. or 3,3,3; \
  530. /* ##TYPE##_SECTION_ELSE */ \
  531. /* or 5,5,5; */ \
  532. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  533. /* or 3,3,3; */ \
  534. /* END_##TYPE##_SECTION_NESTED(0, 1, 95) */ \
  535. /* or 5,5,5; */ \
  536. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  537. or 1,1,1; \
  538. or 1,1,1; \
  539. /* Alt section with nested section in else, else taken & nop */ \
  540. /* BEGIN_##TYPE##_SECTION */ \
  541. /* or 3,3,3; */ \
  542. /* or 3,3,3; */ \
  543. /* or 3,3,3; */ \
  544. /* ##TYPE##_SECTION_ELSE */ \
  545. or 5,5,5; \
  546. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  547. nop; \
  548. /* END_##TYPE##_SECTION_NESTED(0, 1, 95) */ \
  549. or 5,5,5; \
  550. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  551. or 1,1,1; \
  552. or 1,1,1; \
  553. /* Feature section with nested alt section, default taken */ \
  554. /* BEGIN_##TYPE##_SECTION */ \
  555. or 2,2,2; \
  556. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  557. or 1,1,1; \
  558. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  559. /* or 5,5,5; */ \
  560. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) */ \
  561. or 2,2,2; \
  562. /* END_##TYPE##_SECTION(0, 0) */ \
  563. or 1,1,1; \
  564. or 1,1,1; \
  565. /* Feature section with nested alt section, else taken */ \
  566. /* BEGIN_##TYPE##_SECTION */ \
  567. or 2,2,2; \
  568. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  569. /* or 1,1,1; */ \
  570. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  571. or 5,5,5; \
  572. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) */ \
  573. or 2,2,2; \
  574. /* END_##TYPE##_SECTION(0, 0) */ \
  575. or 1,1,1; \
  576. or 1,1,1; \
  577. /* Feature section with nested alt section, all nop'ed */ \
  578. /* BEGIN_##TYPE##_SECTION */ \
  579. nop; \
  580. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  581. nop; \
  582. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  583. /* or 5,5,5; */ \
  584. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) */ \
  585. nop; \
  586. /* END_##TYPE##_SECTION(0, 1) */ \
  587. or 1,1,1; \
  588. or 1,1,1; \
  589. /* Nested alt sections, default with inner default taken */ \
  590. /* BEGIN_##TYPE##_SECTION */ \
  591. or 2,2,2; \
  592. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  593. or 1,1,1; \
  594. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  595. /* or 5,5,5; */ \
  596. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) */ \
  597. or 2,2,2; \
  598. /* ##TYPE##_SECTION_ELSE */ \
  599. /* or 31,31,31; */ \
  600. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  601. /* or 5,5,5; */ \
  602. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  603. /* or 1,1,1; */ \
  604. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) */ \
  605. /* or 31,31,31; */ \
  606. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  607. or 1,1,1; \
  608. or 1,1,1; \
  609. /* Nested alt sections, default with inner else taken */ \
  610. /* BEGIN_##TYPE##_SECTION */ \
  611. or 2,2,2; \
  612. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  613. /* or 1,1,1; */ \
  614. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  615. or 5,5,5; \
  616. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) */ \
  617. or 2,2,2; \
  618. /* ##TYPE##_SECTION_ELSE */ \
  619. /* or 31,31,31; */ \
  620. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  621. /* or 5,5,5; */ \
  622. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  623. /* or 1,1,1; */ \
  624. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) */ \
  625. /* or 31,31,31; */ \
  626. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  627. or 1,1,1; \
  628. or 1,1,1; \
  629. /* Nested alt sections, else with inner default taken */ \
  630. /* BEGIN_##TYPE##_SECTION */ \
  631. /* or 2,2,2; */ \
  632. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  633. /* or 1,1,1; */ \
  634. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  635. /* or 5,5,5; */ \
  636. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) */ \
  637. /* or 2,2,2; */ \
  638. /* ##TYPE##_SECTION_ELSE */ \
  639. or 31,31,31; \
  640. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  641. or 5,5,5; \
  642. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  643. /* or 1,1,1; */ \
  644. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) */ \
  645. or 31,31,31; \
  646. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  647. or 1,1,1; \
  648. or 1,1,1; \
  649. /* Nested alt sections, else with inner else taken */ \
  650. /* BEGIN_##TYPE##_SECTION */ \
  651. /* or 2,2,2; */ \
  652. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  653. /* or 1,1,1; */ \
  654. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  655. /* or 5,5,5; */ \
  656. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) */ \
  657. /* or 2,2,2; */ \
  658. /* ##TYPE##_SECTION_ELSE */ \
  659. or 31,31,31; \
  660. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  661. /* or 5,5,5; */ \
  662. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  663. or 1,1,1; \
  664. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 94) */ \
  665. or 31,31,31; \
  666. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  667. or 1,1,1; \
  668. or 1,1,1; \
  669. /* Nested alt sections, else can have large else case */ \
  670. /* BEGIN_##TYPE##_SECTION */ \
  671. /* or 2,2,2; */ \
  672. /* or 2,2,2; */ \
  673. /* or 2,2,2; */ \
  674. /* or 2,2,2; */ \
  675. /* ##TYPE##_SECTION_ELSE */ \
  676. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  677. /* or 5,5,5; */ \
  678. /* or 5,5,5; */ \
  679. /* or 5,5,5; */ \
  680. /* or 5,5,5; */ \
  681. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  682. or 1,1,1; \
  683. or 1,1,1; \
  684. or 1,1,1; \
  685. or 1,1,1; \
  686. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 94) */ \
  687. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  688. or 1,1,1; \
  689. or 1,1,1;
  690. MAKE_MACRO_TEST(FTR);
  691. MAKE_MACRO_TEST_EXPECTED(FTR);
  692. #ifdef CONFIG_PPC64
  693. MAKE_MACRO_TEST(FW_FTR);
  694. MAKE_MACRO_TEST_EXPECTED(FW_FTR);
  695. #endif
  696. globl(lwsync_fixup_test)
  697. 1: or 1,1,1
  698. LWSYNC
  699. globl(end_lwsync_fixup_test)
  700. globl(lwsync_fixup_test_expected_LWSYNC)
  701. 1: or 1,1,1
  702. lwsync
  703. globl(lwsync_fixup_test_expected_SYNC)
  704. 1: or 1,1,1
  705. sync