feature-fixups-test.S 19 KB

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