feature-fixups-test.S 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  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. #if 0
  146. /* Test that if we have a larger else case the assembler spots it and
  147. * reports an error. #if 0'ed so as not to break the build normally.
  148. */
  149. ftr_fixup_test7:
  150. or 1,1,1
  151. BEGIN_FTR_SECTION
  152. or 2,2,2
  153. or 2,2,2
  154. or 2,2,2
  155. FTR_SECTION_ELSE
  156. or 3,3,3
  157. or 3,3,3
  158. or 3,3,3
  159. or 3,3,3
  160. ALT_FTR_SECTION_END(0, 1)
  161. or 1,1,1
  162. #endif
  163. #define MAKE_MACRO_TEST(TYPE) \
  164. globl(ftr_fixup_test_ ##TYPE##_macros) \
  165. or 1,1,1; \
  166. /* Basic test, this section should all be nop'ed */ \
  167. BEGIN_##TYPE##_SECTION \
  168. or 2,2,2; \
  169. or 2,2,2; \
  170. or 2,2,2; \
  171. END_##TYPE##_SECTION(0, 1) \
  172. or 1,1,1; \
  173. or 1,1,1; \
  174. /* Basic test, this section should NOT be nop'ed */ \
  175. BEGIN_##TYPE##_SECTION \
  176. or 2,2,2; \
  177. or 2,2,2; \
  178. or 2,2,2; \
  179. END_##TYPE##_SECTION(0, 0) \
  180. or 1,1,1; \
  181. or 1,1,1; \
  182. /* Nesting test, inner section should be nop'ed */ \
  183. BEGIN_##TYPE##_SECTION \
  184. or 2,2,2; \
  185. or 2,2,2; \
  186. BEGIN_##TYPE##_SECTION_NESTED(80) \
  187. or 3,3,3; \
  188. or 3,3,3; \
  189. END_##TYPE##_SECTION_NESTED(0, 1, 80) \
  190. or 2,2,2; \
  191. or 2,2,2; \
  192. END_##TYPE##_SECTION(0, 0) \
  193. or 1,1,1; \
  194. or 1,1,1; \
  195. /* Nesting test, whole section should be nop'ed */ \
  196. BEGIN_##TYPE##_SECTION \
  197. or 2,2,2; \
  198. or 2,2,2; \
  199. BEGIN_##TYPE##_SECTION_NESTED(80) \
  200. or 3,3,3; \
  201. or 3,3,3; \
  202. END_##TYPE##_SECTION_NESTED(0, 0, 80) \
  203. or 2,2,2; \
  204. or 2,2,2; \
  205. END_##TYPE##_SECTION(0, 1) \
  206. or 1,1,1; \
  207. or 1,1,1; \
  208. /* Nesting test, none should be nop'ed */ \
  209. BEGIN_##TYPE##_SECTION \
  210. or 2,2,2; \
  211. or 2,2,2; \
  212. BEGIN_##TYPE##_SECTION_NESTED(80) \
  213. or 3,3,3; \
  214. or 3,3,3; \
  215. END_##TYPE##_SECTION_NESTED(0, 0, 80) \
  216. or 2,2,2; \
  217. or 2,2,2; \
  218. END_##TYPE##_SECTION(0, 0) \
  219. or 1,1,1; \
  220. or 1,1,1; \
  221. /* Basic alt section test, default case should be taken */ \
  222. BEGIN_##TYPE##_SECTION \
  223. or 3,3,3; \
  224. or 3,3,3; \
  225. or 3,3,3; \
  226. ##TYPE##_SECTION_ELSE \
  227. or 5,5,5; \
  228. or 5,5,5; \
  229. ALT_##TYPE##_SECTION_END(0, 0) \
  230. or 1,1,1; \
  231. or 1,1,1; \
  232. /* Basic alt section test, else case should be taken */ \
  233. BEGIN_##TYPE##_SECTION \
  234. or 3,3,3; \
  235. or 3,3,3; \
  236. or 3,3,3; \
  237. ##TYPE##_SECTION_ELSE \
  238. or 31,31,31; \
  239. or 31,31,31; \
  240. or 31,31,31; \
  241. ALT_##TYPE##_SECTION_END(0, 1) \
  242. or 1,1,1; \
  243. or 1,1,1; \
  244. /* Alt with smaller else case, should be padded with nops */ \
  245. BEGIN_##TYPE##_SECTION \
  246. or 3,3,3; \
  247. or 3,3,3; \
  248. or 3,3,3; \
  249. ##TYPE##_SECTION_ELSE \
  250. or 31,31,31; \
  251. ALT_##TYPE##_SECTION_END(0, 1) \
  252. or 1,1,1; \
  253. or 1,1,1; \
  254. /* Alt section with nested section in default case */ \
  255. /* Default case should be taken, with nop'ed inner section */ \
  256. BEGIN_##TYPE##_SECTION \
  257. or 3,3,3; \
  258. BEGIN_##TYPE##_SECTION_NESTED(95) \
  259. or 3,3,3; \
  260. or 3,3,3; \
  261. END_##TYPE##_SECTION_NESTED(0, 1, 95) \
  262. or 3,3,3; \
  263. ##TYPE##_SECTION_ELSE \
  264. or 2,2,2; \
  265. or 2,2,2; \
  266. ALT_##TYPE##_SECTION_END(0, 0) \
  267. or 1,1,1; \
  268. or 1,1,1; \
  269. /* Alt section with nested section in else, default taken */ \
  270. BEGIN_##TYPE##_SECTION \
  271. or 3,3,3; \
  272. or 3,3,3; \
  273. or 3,3,3; \
  274. ##TYPE##_SECTION_ELSE \
  275. or 5,5,5; \
  276. BEGIN_##TYPE##_SECTION_NESTED(95) \
  277. or 3,3,3; \
  278. END_##TYPE##_SECTION_NESTED(0, 1, 95) \
  279. or 5,5,5; \
  280. ALT_##TYPE##_SECTION_END(0, 0) \
  281. or 1,1,1; \
  282. or 1,1,1; \
  283. /* Alt section with nested section in else, else taken & nop */ \
  284. BEGIN_##TYPE##_SECTION \
  285. or 3,3,3; \
  286. or 3,3,3; \
  287. or 3,3,3; \
  288. ##TYPE##_SECTION_ELSE \
  289. or 5,5,5; \
  290. BEGIN_##TYPE##_SECTION_NESTED(95) \
  291. or 3,3,3; \
  292. END_##TYPE##_SECTION_NESTED(0, 1, 95) \
  293. or 5,5,5; \
  294. ALT_##TYPE##_SECTION_END(0, 1) \
  295. or 1,1,1; \
  296. or 1,1,1; \
  297. /* Feature section with nested alt section, default taken */ \
  298. BEGIN_##TYPE##_SECTION \
  299. or 2,2,2; \
  300. BEGIN_##TYPE##_SECTION_NESTED(95) \
  301. or 1,1,1; \
  302. ##TYPE##_SECTION_ELSE_NESTED(95) \
  303. or 5,5,5; \
  304. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) \
  305. or 2,2,2; \
  306. END_##TYPE##_SECTION(0, 0) \
  307. or 1,1,1; \
  308. or 1,1,1; \
  309. /* Feature section with nested alt section, else taken */ \
  310. BEGIN_##TYPE##_SECTION \
  311. or 2,2,2; \
  312. BEGIN_##TYPE##_SECTION_NESTED(95) \
  313. or 1,1,1; \
  314. ##TYPE##_SECTION_ELSE_NESTED(95) \
  315. or 5,5,5; \
  316. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) \
  317. or 2,2,2; \
  318. END_##TYPE##_SECTION(0, 0) \
  319. or 1,1,1; \
  320. or 1,1,1; \
  321. /* Feature section with nested alt section, all nop'ed */ \
  322. BEGIN_##TYPE##_SECTION \
  323. or 2,2,2; \
  324. BEGIN_##TYPE##_SECTION_NESTED(95) \
  325. or 1,1,1; \
  326. ##TYPE##_SECTION_ELSE_NESTED(95) \
  327. or 5,5,5; \
  328. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) \
  329. or 2,2,2; \
  330. END_##TYPE##_SECTION(0, 1) \
  331. or 1,1,1; \
  332. or 1,1,1; \
  333. /* Nested alt sections, default with inner default taken */ \
  334. BEGIN_##TYPE##_SECTION \
  335. or 2,2,2; \
  336. BEGIN_##TYPE##_SECTION_NESTED(95) \
  337. or 1,1,1; \
  338. ##TYPE##_SECTION_ELSE_NESTED(95) \
  339. or 5,5,5; \
  340. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) \
  341. or 2,2,2; \
  342. ##TYPE##_SECTION_ELSE \
  343. or 31,31,31; \
  344. BEGIN_##TYPE##_SECTION_NESTED(94) \
  345. or 5,5,5; \
  346. ##TYPE##_SECTION_ELSE_NESTED(94) \
  347. or 1,1,1; \
  348. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) \
  349. or 31,31,31; \
  350. ALT_##TYPE##_SECTION_END(0, 0) \
  351. or 1,1,1; \
  352. or 1,1,1; \
  353. /* Nested alt sections, default with inner else taken */ \
  354. BEGIN_##TYPE##_SECTION \
  355. or 2,2,2; \
  356. BEGIN_##TYPE##_SECTION_NESTED(95) \
  357. or 1,1,1; \
  358. ##TYPE##_SECTION_ELSE_NESTED(95) \
  359. or 5,5,5; \
  360. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) \
  361. or 2,2,2; \
  362. ##TYPE##_SECTION_ELSE \
  363. or 31,31,31; \
  364. BEGIN_##TYPE##_SECTION_NESTED(94) \
  365. or 5,5,5; \
  366. ##TYPE##_SECTION_ELSE_NESTED(94) \
  367. or 1,1,1; \
  368. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) \
  369. or 31,31,31; \
  370. ALT_##TYPE##_SECTION_END(0, 0) \
  371. or 1,1,1; \
  372. or 1,1,1; \
  373. /* Nested alt sections, else with inner default taken */ \
  374. BEGIN_##TYPE##_SECTION \
  375. or 2,2,2; \
  376. BEGIN_##TYPE##_SECTION_NESTED(95) \
  377. or 1,1,1; \
  378. ##TYPE##_SECTION_ELSE_NESTED(95) \
  379. or 5,5,5; \
  380. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) \
  381. or 2,2,2; \
  382. ##TYPE##_SECTION_ELSE \
  383. or 31,31,31; \
  384. BEGIN_##TYPE##_SECTION_NESTED(94) \
  385. or 5,5,5; \
  386. ##TYPE##_SECTION_ELSE_NESTED(94) \
  387. or 1,1,1; \
  388. ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) \
  389. or 31,31,31; \
  390. ALT_##TYPE##_SECTION_END(0, 1) \
  391. or 1,1,1; \
  392. or 1,1,1; \
  393. /* Nested alt sections, else with inner else taken */ \
  394. BEGIN_##TYPE##_SECTION \
  395. or 2,2,2; \
  396. BEGIN_##TYPE##_SECTION_NESTED(95) \
  397. or 1,1,1; \
  398. ##TYPE##_SECTION_ELSE_NESTED(95) \
  399. or 5,5,5; \
  400. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) \
  401. or 2,2,2; \
  402. ##TYPE##_SECTION_ELSE \
  403. or 31,31,31; \
  404. BEGIN_##TYPE##_SECTION_NESTED(94) \
  405. or 5,5,5; \
  406. ##TYPE##_SECTION_ELSE_NESTED(94) \
  407. or 1,1,1; \
  408. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 94) \
  409. or 31,31,31; \
  410. ALT_##TYPE##_SECTION_END(0, 1) \
  411. or 1,1,1; \
  412. or 1,1,1; \
  413. /* Nested alt sections, else can have large else case */ \
  414. BEGIN_##TYPE##_SECTION \
  415. or 2,2,2; \
  416. or 2,2,2; \
  417. or 2,2,2; \
  418. or 2,2,2; \
  419. ##TYPE##_SECTION_ELSE \
  420. BEGIN_##TYPE##_SECTION_NESTED(94) \
  421. or 5,5,5; \
  422. or 5,5,5; \
  423. or 5,5,5; \
  424. or 5,5,5; \
  425. ##TYPE##_SECTION_ELSE_NESTED(94) \
  426. or 1,1,1; \
  427. or 1,1,1; \
  428. or 1,1,1; \
  429. or 1,1,1; \
  430. ALT_##TYPE##_SECTION_END_NESTED(0, 1, 94) \
  431. ALT_##TYPE##_SECTION_END(0, 1) \
  432. or 1,1,1; \
  433. or 1,1,1;
  434. #define MAKE_MACRO_TEST_EXPECTED(TYPE) \
  435. globl(ftr_fixup_test_ ##TYPE##_macros_expected) \
  436. or 1,1,1; \
  437. /* Basic test, this section should all be nop'ed */ \
  438. /* BEGIN_##TYPE##_SECTION */ \
  439. nop; \
  440. nop; \
  441. nop; \
  442. /* END_##TYPE##_SECTION(0, 1) */ \
  443. or 1,1,1; \
  444. or 1,1,1; \
  445. /* Basic test, this section should NOT be nop'ed */ \
  446. /* BEGIN_##TYPE##_SECTION */ \
  447. or 2,2,2; \
  448. or 2,2,2; \
  449. or 2,2,2; \
  450. /* END_##TYPE##_SECTION(0, 0) */ \
  451. or 1,1,1; \
  452. or 1,1,1; \
  453. /* Nesting test, inner section should be nop'ed */ \
  454. /* BEGIN_##TYPE##_SECTION */ \
  455. or 2,2,2; \
  456. or 2,2,2; \
  457. /* BEGIN_##TYPE##_SECTION_NESTED(80) */ \
  458. nop; \
  459. nop; \
  460. /* END_##TYPE##_SECTION_NESTED(0, 1, 80) */ \
  461. or 2,2,2; \
  462. or 2,2,2; \
  463. /* END_##TYPE##_SECTION(0, 0) */ \
  464. or 1,1,1; \
  465. or 1,1,1; \
  466. /* Nesting test, whole section should be nop'ed */ \
  467. /* NB. inner section is not nop'ed, but then entire outer is */ \
  468. /* BEGIN_##TYPE##_SECTION */ \
  469. nop; \
  470. nop; \
  471. /* BEGIN_##TYPE##_SECTION_NESTED(80) */ \
  472. nop; \
  473. nop; \
  474. /* END_##TYPE##_SECTION_NESTED(0, 0, 80) */ \
  475. nop; \
  476. nop; \
  477. /* END_##TYPE##_SECTION(0, 1) */ \
  478. or 1,1,1; \
  479. or 1,1,1; \
  480. /* Nesting test, none should be nop'ed */ \
  481. /* BEGIN_##TYPE##_SECTION */ \
  482. or 2,2,2; \
  483. or 2,2,2; \
  484. /* BEGIN_##TYPE##_SECTION_NESTED(80) */ \
  485. or 3,3,3; \
  486. or 3,3,3; \
  487. /* END_##TYPE##_SECTION_NESTED(0, 0, 80) */ \
  488. or 2,2,2; \
  489. or 2,2,2; \
  490. /* END_##TYPE##_SECTION(0, 0) */ \
  491. or 1,1,1; \
  492. or 1,1,1; \
  493. /* Basic alt section test, default case should be taken */ \
  494. /* BEGIN_##TYPE##_SECTION */ \
  495. or 3,3,3; \
  496. or 3,3,3; \
  497. or 3,3,3; \
  498. /* ##TYPE##_SECTION_ELSE */ \
  499. /* or 5,5,5; */ \
  500. /* or 5,5,5; */ \
  501. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  502. or 1,1,1; \
  503. or 1,1,1; \
  504. /* Basic alt section test, else case should be taken */ \
  505. /* BEGIN_##TYPE##_SECTION */ \
  506. /* or 3,3,3; */ \
  507. /* or 3,3,3; */ \
  508. /* or 3,3,3; */ \
  509. /* ##TYPE##_SECTION_ELSE */ \
  510. or 31,31,31; \
  511. or 31,31,31; \
  512. or 31,31,31; \
  513. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  514. or 1,1,1; \
  515. or 1,1,1; \
  516. /* Alt with smaller else case, should be padded with nops */ \
  517. /* BEGIN_##TYPE##_SECTION */ \
  518. /* or 3,3,3; */ \
  519. /* or 3,3,3; */ \
  520. /* or 3,3,3; */ \
  521. /* ##TYPE##_SECTION_ELSE */ \
  522. or 31,31,31; \
  523. nop; \
  524. nop; \
  525. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  526. or 1,1,1; \
  527. or 1,1,1; \
  528. /* Alt section with nested section in default case */ \
  529. /* Default case should be taken, with nop'ed inner section */ \
  530. /* BEGIN_##TYPE##_SECTION */ \
  531. or 3,3,3; \
  532. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  533. nop; \
  534. nop; \
  535. /* END_##TYPE##_SECTION_NESTED(0, 1, 95) */ \
  536. or 3,3,3; \
  537. /* ##TYPE##_SECTION_ELSE */ \
  538. /* or 2,2,2; */ \
  539. /* or 2,2,2; */ \
  540. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  541. or 1,1,1; \
  542. or 1,1,1; \
  543. /* Alt section with nested section in else, default taken */ \
  544. /* BEGIN_##TYPE##_SECTION */ \
  545. or 3,3,3; \
  546. or 3,3,3; \
  547. or 3,3,3; \
  548. /* ##TYPE##_SECTION_ELSE */ \
  549. /* or 5,5,5; */ \
  550. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  551. /* or 3,3,3; */ \
  552. /* END_##TYPE##_SECTION_NESTED(0, 1, 95) */ \
  553. /* or 5,5,5; */ \
  554. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  555. or 1,1,1; \
  556. or 1,1,1; \
  557. /* Alt section with nested section in else, else taken & nop */ \
  558. /* BEGIN_##TYPE##_SECTION */ \
  559. /* or 3,3,3; */ \
  560. /* or 3,3,3; */ \
  561. /* or 3,3,3; */ \
  562. /* ##TYPE##_SECTION_ELSE */ \
  563. or 5,5,5; \
  564. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  565. nop; \
  566. /* END_##TYPE##_SECTION_NESTED(0, 1, 95) */ \
  567. or 5,5,5; \
  568. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  569. or 1,1,1; \
  570. or 1,1,1; \
  571. /* Feature section with nested alt section, default taken */ \
  572. /* BEGIN_##TYPE##_SECTION */ \
  573. or 2,2,2; \
  574. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  575. or 1,1,1; \
  576. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  577. /* or 5,5,5; */ \
  578. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) */ \
  579. or 2,2,2; \
  580. /* END_##TYPE##_SECTION(0, 0) */ \
  581. or 1,1,1; \
  582. or 1,1,1; \
  583. /* Feature section with nested alt section, else taken */ \
  584. /* BEGIN_##TYPE##_SECTION */ \
  585. or 2,2,2; \
  586. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  587. /* or 1,1,1; */ \
  588. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  589. or 5,5,5; \
  590. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) */ \
  591. or 2,2,2; \
  592. /* END_##TYPE##_SECTION(0, 0) */ \
  593. or 1,1,1; \
  594. or 1,1,1; \
  595. /* Feature section with nested alt section, all nop'ed */ \
  596. /* BEGIN_##TYPE##_SECTION */ \
  597. nop; \
  598. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  599. nop; \
  600. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  601. /* or 5,5,5; */ \
  602. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) */ \
  603. nop; \
  604. /* END_##TYPE##_SECTION(0, 1) */ \
  605. or 1,1,1; \
  606. or 1,1,1; \
  607. /* Nested alt sections, default with inner default taken */ \
  608. /* BEGIN_##TYPE##_SECTION */ \
  609. or 2,2,2; \
  610. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  611. or 1,1,1; \
  612. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  613. /* or 5,5,5; */ \
  614. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 95) */ \
  615. or 2,2,2; \
  616. /* ##TYPE##_SECTION_ELSE */ \
  617. /* or 31,31,31; */ \
  618. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  619. /* or 5,5,5; */ \
  620. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  621. /* or 1,1,1; */ \
  622. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) */ \
  623. /* or 31,31,31; */ \
  624. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  625. or 1,1,1; \
  626. or 1,1,1; \
  627. /* Nested alt sections, default with inner else taken */ \
  628. /* BEGIN_##TYPE##_SECTION */ \
  629. or 2,2,2; \
  630. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  631. /* or 1,1,1; */ \
  632. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  633. or 5,5,5; \
  634. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) */ \
  635. or 2,2,2; \
  636. /* ##TYPE##_SECTION_ELSE */ \
  637. /* or 31,31,31; */ \
  638. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  639. /* or 5,5,5; */ \
  640. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  641. /* or 1,1,1; */ \
  642. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) */ \
  643. /* or 31,31,31; */ \
  644. /* ALT_##TYPE##_SECTION_END(0, 0) */ \
  645. or 1,1,1; \
  646. or 1,1,1; \
  647. /* Nested alt sections, else with inner default taken */ \
  648. /* BEGIN_##TYPE##_SECTION */ \
  649. /* or 2,2,2; */ \
  650. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  651. /* or 1,1,1; */ \
  652. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  653. /* or 5,5,5; */ \
  654. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) */ \
  655. /* or 2,2,2; */ \
  656. /* ##TYPE##_SECTION_ELSE */ \
  657. or 31,31,31; \
  658. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  659. or 5,5,5; \
  660. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  661. /* or 1,1,1; */ \
  662. /* ALT_##TYPE##_SECTION_END_NESTED(0, 0, 94) */ \
  663. or 31,31,31; \
  664. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  665. or 1,1,1; \
  666. or 1,1,1; \
  667. /* Nested alt sections, else with inner else taken */ \
  668. /* BEGIN_##TYPE##_SECTION */ \
  669. /* or 2,2,2; */ \
  670. /* BEGIN_##TYPE##_SECTION_NESTED(95) */ \
  671. /* or 1,1,1; */ \
  672. /* ##TYPE##_SECTION_ELSE_NESTED(95) */ \
  673. /* or 5,5,5; */ \
  674. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 95) */ \
  675. /* or 2,2,2; */ \
  676. /* ##TYPE##_SECTION_ELSE */ \
  677. or 31,31,31; \
  678. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  679. /* or 5,5,5; */ \
  680. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  681. or 1,1,1; \
  682. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 94) */ \
  683. or 31,31,31; \
  684. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  685. or 1,1,1; \
  686. or 1,1,1; \
  687. /* Nested alt sections, else can have large else case */ \
  688. /* BEGIN_##TYPE##_SECTION */ \
  689. /* or 2,2,2; */ \
  690. /* or 2,2,2; */ \
  691. /* or 2,2,2; */ \
  692. /* or 2,2,2; */ \
  693. /* ##TYPE##_SECTION_ELSE */ \
  694. /* BEGIN_##TYPE##_SECTION_NESTED(94) */ \
  695. /* or 5,5,5; */ \
  696. /* or 5,5,5; */ \
  697. /* or 5,5,5; */ \
  698. /* or 5,5,5; */ \
  699. /* ##TYPE##_SECTION_ELSE_NESTED(94) */ \
  700. or 1,1,1; \
  701. or 1,1,1; \
  702. or 1,1,1; \
  703. or 1,1,1; \
  704. /* ALT_##TYPE##_SECTION_END_NESTED(0, 1, 94) */ \
  705. /* ALT_##TYPE##_SECTION_END(0, 1) */ \
  706. or 1,1,1; \
  707. or 1,1,1;
  708. MAKE_MACRO_TEST(FTR);
  709. MAKE_MACRO_TEST_EXPECTED(FTR);
  710. #ifdef CONFIG_PPC64
  711. MAKE_MACRO_TEST(FW_FTR);
  712. MAKE_MACRO_TEST_EXPECTED(FW_FTR);
  713. #endif
  714. globl(lwsync_fixup_test)
  715. 1: or 1,1,1
  716. LWSYNC
  717. globl(end_lwsync_fixup_test)
  718. globl(lwsync_fixup_test_expected_LWSYNC)
  719. 1: or 1,1,1
  720. lwsync
  721. globl(lwsync_fixup_test_expected_SYNC)
  722. 1: or 1,1,1
  723. sync