i386_002dOptions.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU Assembler "as".
  4. Copyright (C) 1991-2021 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3
  7. or any later version published by the Free Software Foundation;
  8. with no Invariant Sections, with no Front-Cover Texts, and with no
  9. Back-Cover Texts. A copy of the license is included in the
  10. section entitled "GNU Free Documentation License".
  11. -->
  12. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>i386-Options (Using as)</title>
  16. <meta name="description" content="i386-Options (Using as)">
  17. <meta name="keywords" content="i386-Options (Using as)">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <link href="index.html#Top" rel="start" title="Top">
  22. <link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
  23. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  24. <link href="i386_002dDependent.html#i386_002dDependent" rel="up" title="i386-Dependent">
  25. <link href="i386_002dDirectives.html#i386_002dDirectives" rel="next" title="i386-Directives">
  26. <link href="i386_002dDependent.html#i386_002dDependent" rel="prev" title="i386-Dependent">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.indentedblock {margin-right: 0em}
  31. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  32. blockquote.smallquotation {font-size: smaller}
  33. div.display {margin-left: 3.2em}
  34. div.example {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smalllisp {margin-left: 3.2em}
  39. kbd {font-style: oblique}
  40. pre.display {font-family: inherit}
  41. pre.format {font-family: inherit}
  42. pre.menu-comment {font-family: serif}
  43. pre.menu-preformatted {font-family: serif}
  44. pre.smalldisplay {font-family: inherit; font-size: smaller}
  45. pre.smallexample {font-size: smaller}
  46. pre.smallformat {font-family: inherit; font-size: smaller}
  47. pre.smalllisp {font-size: smaller}
  48. span.nolinebreak {white-space: nowrap}
  49. span.roman {font-family: initial; font-weight: normal}
  50. span.sansserif {font-family: sans-serif; font-weight: normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en">
  56. <a name="i386_002dOptions"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="i386_002dDirectives.html#i386_002dDirectives" accesskey="n" rel="next">i386-Directives</a>, Up: <a href="i386_002dDependent.html#i386_002dDependent" accesskey="u" rel="up">i386-Dependent</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  60. </div>
  61. <hr>
  62. <a name="Options-11"></a>
  63. <h4 class="subsection">9.16.1 Options</h4>
  64. <a name="index-options-for-i386"></a>
  65. <a name="index-options-for-x86_002d64"></a>
  66. <a name="index-i386-options"></a>
  67. <a name="index-x86_002d64-options"></a>
  68. <p>The i386 version of <code>as</code> has a few machine
  69. dependent options:
  70. </p>
  71. <dl compact="compact">
  72. <dd><a name="index-_002d_002d32-option_002c-i386"></a>
  73. <a name="index-_002d_002d32-option_002c-x86_002d64"></a>
  74. <a name="index-_002d_002dx32-option_002c-i386"></a>
  75. <a name="index-_002d_002dx32-option_002c-x86_002d64"></a>
  76. <a name="index-_002d_002d64-option_002c-i386"></a>
  77. <a name="index-_002d_002d64-option_002c-x86_002d64"></a>
  78. </dd>
  79. <dt><code>--32 | --x32 | --64</code></dt>
  80. <dd><p>Select the word size, either 32 bits or 64 bits. &lsquo;<samp>--32</samp>&rsquo;
  81. implies Intel i386 architecture, while &lsquo;<samp>--x32</samp>&rsquo; and &lsquo;<samp>--64</samp>&rsquo;
  82. imply AMD x86-64 architecture with 32-bit or 64-bit word-size
  83. respectively.
  84. </p>
  85. <p>These options are only available with the ELF object file format, and
  86. require that the necessary BFD support has been included (on a 32-bit
  87. platform you have to add &ndash;enable-64-bit-bfd to configure enable 64-bit
  88. usage and use x86-64 as target platform).
  89. </p>
  90. </dd>
  91. <dt><code>-n</code></dt>
  92. <dd><p>By default, x86 GAS replaces multiple nop instructions used for
  93. alignment within code sections with multi-byte nop instructions such
  94. as leal 0(%esi,1),%esi. This switch disables the optimization if a single
  95. byte nop (0x90) is explicitly specified as the fill byte for alignment.
  96. </p>
  97. <a name="index-_002d_002ddivide-option_002c-i386"></a>
  98. </dd>
  99. <dt><code>--divide</code></dt>
  100. <dd><p>On SVR4-derived platforms, the character &lsquo;<samp>/</samp>&rsquo; is treated as a comment
  101. character, which means that it cannot be used in expressions. The
  102. &lsquo;<samp>--divide</samp>&rsquo; option turns &lsquo;<samp>/</samp>&rsquo; into a normal character. This does
  103. not disable &lsquo;<samp>/</samp>&rsquo; at the beginning of a line starting a comment, or
  104. affect using &lsquo;<samp>#</samp>&rsquo; for starting a comment.
  105. </p>
  106. <a name="index-_002dmarch_003d-option_002c-i386"></a>
  107. <a name="index-_002dmarch_003d-option_002c-x86_002d64"></a>
  108. </dd>
  109. <dt><code>-march=<var>CPU</var>[+<var>EXTENSION</var>&hellip;]</code></dt>
  110. <dd><p>This option specifies the target processor. The assembler will
  111. issue an error message if an attempt is made to assemble an instruction
  112. which will not execute on the target processor. The following
  113. processor names are recognized:
  114. <code>i8086</code>,
  115. <code>i186</code>,
  116. <code>i286</code>,
  117. <code>i386</code>,
  118. <code>i486</code>,
  119. <code>i586</code>,
  120. <code>i686</code>,
  121. <code>pentium</code>,
  122. <code>pentiumpro</code>,
  123. <code>pentiumii</code>,
  124. <code>pentiumiii</code>,
  125. <code>pentium4</code>,
  126. <code>prescott</code>,
  127. <code>nocona</code>,
  128. <code>core</code>,
  129. <code>core2</code>,
  130. <code>corei7</code>,
  131. <code>l1om</code>,
  132. <code>k1om</code>,
  133. <code>iamcu</code>,
  134. <code>k6</code>,
  135. <code>k6_2</code>,
  136. <code>athlon</code>,
  137. <code>opteron</code>,
  138. <code>k8</code>,
  139. <code>amdfam10</code>,
  140. <code>bdver1</code>,
  141. <code>bdver2</code>,
  142. <code>bdver3</code>,
  143. <code>bdver4</code>,
  144. <code>znver1</code>,
  145. <code>znver2</code>,
  146. <code>znver3</code>,
  147. <code>btver1</code>,
  148. <code>btver2</code>,
  149. <code>generic32</code> and
  150. <code>generic64</code>.
  151. </p>
  152. <p>In addition to the basic instruction set, the assembler can be told to
  153. accept various extension mnemonics. For example,
  154. <code>-march=i686+sse4+vmx</code> extends <var>i686</var> with <var>sse4</var> and
  155. <var>vmx</var>. The following extensions are currently supported:
  156. <code>8087</code>,
  157. <code>287</code>,
  158. <code>387</code>,
  159. <code>687</code>,
  160. <code>no87</code>,
  161. <code>no287</code>,
  162. <code>no387</code>,
  163. <code>no687</code>,
  164. <code>cmov</code>,
  165. <code>nocmov</code>,
  166. <code>fxsr</code>,
  167. <code>nofxsr</code>,
  168. <code>mmx</code>,
  169. <code>nommx</code>,
  170. <code>sse</code>,
  171. <code>sse2</code>,
  172. <code>sse3</code>,
  173. <code>sse4a</code>,
  174. <code>ssse3</code>,
  175. <code>sse4.1</code>,
  176. <code>sse4.2</code>,
  177. <code>sse4</code>,
  178. <code>nosse</code>,
  179. <code>nosse2</code>,
  180. <code>nosse3</code>,
  181. <code>nosse4a</code>,
  182. <code>nossse3</code>,
  183. <code>nosse4.1</code>,
  184. <code>nosse4.2</code>,
  185. <code>nosse4</code>,
  186. <code>avx</code>,
  187. <code>avx2</code>,
  188. <code>noavx</code>,
  189. <code>noavx2</code>,
  190. <code>adx</code>,
  191. <code>rdseed</code>,
  192. <code>prfchw</code>,
  193. <code>smap</code>,
  194. <code>mpx</code>,
  195. <code>sha</code>,
  196. <code>rdpid</code>,
  197. <code>ptwrite</code>,
  198. <code>cet</code>,
  199. <code>gfni</code>,
  200. <code>vaes</code>,
  201. <code>vpclmulqdq</code>,
  202. <code>prefetchwt1</code>,
  203. <code>clflushopt</code>,
  204. <code>se1</code>,
  205. <code>clwb</code>,
  206. <code>movdiri</code>,
  207. <code>movdir64b</code>,
  208. <code>enqcmd</code>,
  209. <code>serialize</code>,
  210. <code>tsxldtrk</code>,
  211. <code>kl</code>,
  212. <code>nokl</code>,
  213. <code>widekl</code>,
  214. <code>nowidekl</code>,
  215. <code>hreset</code>,
  216. <code>avx512f</code>,
  217. <code>avx512cd</code>,
  218. <code>avx512er</code>,
  219. <code>avx512pf</code>,
  220. <code>avx512vl</code>,
  221. <code>avx512bw</code>,
  222. <code>avx512dq</code>,
  223. <code>avx512ifma</code>,
  224. <code>avx512vbmi</code>,
  225. <code>avx512_4fmaps</code>,
  226. <code>avx512_4vnniw</code>,
  227. <code>avx512_vpopcntdq</code>,
  228. <code>avx512_vbmi2</code>,
  229. <code>avx512_vnni</code>,
  230. <code>avx512_bitalg</code>,
  231. <code>avx512_vp2intersect</code>,
  232. <code>tdx</code>,
  233. <code>avx512_bf16</code>,
  234. <code>avx_vnni</code>,
  235. <code>noavx512f</code>,
  236. <code>noavx512cd</code>,
  237. <code>noavx512er</code>,
  238. <code>noavx512pf</code>,
  239. <code>noavx512vl</code>,
  240. <code>noavx512bw</code>,
  241. <code>noavx512dq</code>,
  242. <code>noavx512ifma</code>,
  243. <code>noavx512vbmi</code>,
  244. <code>noavx512_4fmaps</code>,
  245. <code>noavx512_4vnniw</code>,
  246. <code>noavx512_vpopcntdq</code>,
  247. <code>noavx512_vbmi2</code>,
  248. <code>noavx512_vnni</code>,
  249. <code>noavx512_bitalg</code>,
  250. <code>noavx512_vp2intersect</code>,
  251. <code>notdx</code>,
  252. <code>noavx512_bf16</code>,
  253. <code>noavx_vnni</code>,
  254. <code>noenqcmd</code>,
  255. <code>noserialize</code>,
  256. <code>notsxldtrk</code>,
  257. <code>amx_int8</code>,
  258. <code>noamx_int8</code>,
  259. <code>amx_bf16</code>,
  260. <code>noamx_bf16</code>,
  261. <code>amx_tile</code>,
  262. <code>noamx_tile</code>,
  263. <code>nouintr</code>,
  264. <code>nohreset</code>,
  265. <code>vmx</code>,
  266. <code>vmfunc</code>,
  267. <code>smx</code>,
  268. <code>xsave</code>,
  269. <code>xsaveopt</code>,
  270. <code>xsavec</code>,
  271. <code>xsaves</code>,
  272. <code>aes</code>,
  273. <code>pclmul</code>,
  274. <code>fsgsbase</code>,
  275. <code>rdrnd</code>,
  276. <code>f16c</code>,
  277. <code>bmi2</code>,
  278. <code>fma</code>,
  279. <code>movbe</code>,
  280. <code>ept</code>,
  281. <code>lzcnt</code>,
  282. <code>popcnt</code>,
  283. <code>hle</code>,
  284. <code>rtm</code>,
  285. <code>invpcid</code>,
  286. <code>clflush</code>,
  287. <code>mwaitx</code>,
  288. <code>clzero</code>,
  289. <code>wbnoinvd</code>,
  290. <code>pconfig</code>,
  291. <code>waitpkg</code>,
  292. <code>uintr</code>,
  293. <code>cldemote</code>,
  294. <code>rdpru</code>,
  295. <code>mcommit</code>,
  296. <code>sev_es</code>,
  297. <code>lwp</code>,
  298. <code>fma4</code>,
  299. <code>xop</code>,
  300. <code>cx16</code>,
  301. <code>syscall</code>,
  302. <code>rdtscp</code>,
  303. <code>3dnow</code>,
  304. <code>3dnowa</code>,
  305. <code>sse4a</code>,
  306. <code>sse5</code>,
  307. <code>snp</code>,
  308. <code>invlpgb</code>,
  309. <code>tlbsync</code>,
  310. <code>svme</code> and
  311. <code>padlock</code>.
  312. Note that rather than extending a basic instruction set, the extension
  313. mnemonics starting with <code>no</code> revoke the respective functionality.
  314. </p>
  315. <p>When the <code>.arch</code> directive is used with <samp>-march</samp>, the
  316. <code>.arch</code> directive will take precedent.
  317. </p>
  318. <a name="index-_002dmtune_003d-option_002c-i386"></a>
  319. <a name="index-_002dmtune_003d-option_002c-x86_002d64"></a>
  320. </dd>
  321. <dt><code>-mtune=<var>CPU</var></code></dt>
  322. <dd><p>This option specifies a processor to optimize for. When used in
  323. conjunction with the <samp>-march</samp> option, only instructions
  324. of the processor specified by the <samp>-march</samp> option will be
  325. generated.
  326. </p>
  327. <p>Valid <var>CPU</var> values are identical to the processor list of
  328. <samp>-march=<var>CPU</var></samp>.
  329. </p>
  330. <a name="index-_002dmsse2avx-option_002c-i386"></a>
  331. <a name="index-_002dmsse2avx-option_002c-x86_002d64"></a>
  332. </dd>
  333. <dt><code>-msse2avx</code></dt>
  334. <dd><p>This option specifies that the assembler should encode SSE instructions
  335. with VEX prefix.
  336. </p>
  337. <a name="index-_002dmsse_002dcheck_003d-option_002c-i386"></a>
  338. <a name="index-_002dmsse_002dcheck_003d-option_002c-x86_002d64"></a>
  339. </dd>
  340. <dt><code>-msse-check=<var>none</var></code></dt>
  341. <dt><code>-msse-check=<var>warning</var></code></dt>
  342. <dt><code>-msse-check=<var>error</var></code></dt>
  343. <dd><p>These options control if the assembler should check SSE instructions.
  344. <samp>-msse-check=<var>none</var></samp> will make the assembler not to check SSE
  345. instructions, which is the default. <samp>-msse-check=<var>warning</var></samp>
  346. will make the assembler issue a warning for any SSE instruction.
  347. <samp>-msse-check=<var>error</var></samp> will make the assembler issue an error
  348. for any SSE instruction.
  349. </p>
  350. <a name="index-_002dmavxscalar_003d-option_002c-i386"></a>
  351. <a name="index-_002dmavxscalar_003d-option_002c-x86_002d64"></a>
  352. </dd>
  353. <dt><code>-mavxscalar=<var>128</var></code></dt>
  354. <dt><code>-mavxscalar=<var>256</var></code></dt>
  355. <dd><p>These options control how the assembler should encode scalar AVX
  356. instructions. <samp>-mavxscalar=<var>128</var></samp> will encode scalar
  357. AVX instructions with 128bit vector length, which is the default.
  358. <samp>-mavxscalar=<var>256</var></samp> will encode scalar AVX instructions
  359. with 256bit vector length.
  360. </p>
  361. <p>WARNING: Don&rsquo;t use this for production code - due to CPU errata the
  362. resulting code may not work on certain models.
  363. </p>
  364. <a name="index-_002dmvexwig_003d-option_002c-i386"></a>
  365. <a name="index-_002dmvexwig_003d-option_002c-x86_002d64"></a>
  366. </dd>
  367. <dt><code>-mvexwig=<var>0</var></code></dt>
  368. <dt><code>-mvexwig=<var>1</var></code></dt>
  369. <dd><p>These options control how the assembler should encode VEX.W-ignored (WIG)
  370. VEX instructions. <samp>-mvexwig=<var>0</var></samp> will encode WIG VEX
  371. instructions with vex.w = 0, which is the default.
  372. <samp>-mvexwig=<var>1</var></samp> will encode WIG EVEX instructions with
  373. vex.w = 1.
  374. </p>
  375. <p>WARNING: Don&rsquo;t use this for production code - due to CPU errata the
  376. resulting code may not work on certain models.
  377. </p>
  378. <a name="index-_002dmevexlig_003d-option_002c-i386"></a>
  379. <a name="index-_002dmevexlig_003d-option_002c-x86_002d64"></a>
  380. </dd>
  381. <dt><code>-mevexlig=<var>128</var></code></dt>
  382. <dt><code>-mevexlig=<var>256</var></code></dt>
  383. <dt><code>-mevexlig=<var>512</var></code></dt>
  384. <dd><p>These options control how the assembler should encode length-ignored
  385. (LIG) EVEX instructions. <samp>-mevexlig=<var>128</var></samp> will encode LIG
  386. EVEX instructions with 128bit vector length, which is the default.
  387. <samp>-mevexlig=<var>256</var></samp> and <samp>-mevexlig=<var>512</var></samp> will
  388. encode LIG EVEX instructions with 256bit and 512bit vector length,
  389. respectively.
  390. </p>
  391. <a name="index-_002dmevexwig_003d-option_002c-i386"></a>
  392. <a name="index-_002dmevexwig_003d-option_002c-x86_002d64"></a>
  393. </dd>
  394. <dt><code>-mevexwig=<var>0</var></code></dt>
  395. <dt><code>-mevexwig=<var>1</var></code></dt>
  396. <dd><p>These options control how the assembler should encode w-ignored (WIG)
  397. EVEX instructions. <samp>-mevexwig=<var>0</var></samp> will encode WIG
  398. EVEX instructions with evex.w = 0, which is the default.
  399. <samp>-mevexwig=<var>1</var></samp> will encode WIG EVEX instructions with
  400. evex.w = 1.
  401. </p>
  402. <a name="index-_002dmmnemonic_003d-option_002c-i386"></a>
  403. <a name="index-_002dmmnemonic_003d-option_002c-x86_002d64"></a>
  404. </dd>
  405. <dt><code>-mmnemonic=<var>att</var></code></dt>
  406. <dt><code>-mmnemonic=<var>intel</var></code></dt>
  407. <dd><p>This option specifies instruction mnemonic for matching instructions.
  408. The <code>.att_mnemonic</code> and <code>.intel_mnemonic</code> directives will
  409. take precedent.
  410. </p>
  411. <a name="index-_002dmsyntax_003d-option_002c-i386"></a>
  412. <a name="index-_002dmsyntax_003d-option_002c-x86_002d64"></a>
  413. </dd>
  414. <dt><code>-msyntax=<var>att</var></code></dt>
  415. <dt><code>-msyntax=<var>intel</var></code></dt>
  416. <dd><p>This option specifies instruction syntax when processing instructions.
  417. The <code>.att_syntax</code> and <code>.intel_syntax</code> directives will
  418. take precedent.
  419. </p>
  420. <a name="index-_002dmnaked_002dreg-option_002c-i386"></a>
  421. <a name="index-_002dmnaked_002dreg-option_002c-x86_002d64"></a>
  422. </dd>
  423. <dt><code>-mnaked-reg</code></dt>
  424. <dd><p>This option specifies that registers don&rsquo;t require a &lsquo;<samp>%</samp>&rsquo; prefix.
  425. The <code>.att_syntax</code> and <code>.intel_syntax</code> directives will take precedent.
  426. </p>
  427. <a name="index-_002dmadd_002dbnd_002dprefix-option_002c-i386"></a>
  428. <a name="index-_002dmadd_002dbnd_002dprefix-option_002c-x86_002d64"></a>
  429. </dd>
  430. <dt><code>-madd-bnd-prefix</code></dt>
  431. <dd><p>This option forces the assembler to add BND prefix to all branches, even
  432. if such prefix was not explicitly specified in the source code.
  433. </p>
  434. <a name="index-_002dmshared-option_002c-i386"></a>
  435. <a name="index-_002dmshared-option_002c-x86_002d64"></a>
  436. </dd>
  437. <dt><code>-mno-shared</code></dt>
  438. <dd><p>On ELF target, the assembler normally optimizes out non-PLT relocations
  439. against defined non-weak global branch targets with default visibility.
  440. The &lsquo;<samp>-mshared</samp>&rsquo; option tells the assembler to generate code which
  441. may go into a shared library where all non-weak global branch targets
  442. with default visibility can be preempted. The resulting code is
  443. slightly bigger. This option only affects the handling of branch
  444. instructions.
  445. </p>
  446. <a name="index-_002dmbig_002dobj-option_002c-i386"></a>
  447. <a name="index-_002dmbig_002dobj-option_002c-x86_002d64"></a>
  448. </dd>
  449. <dt><code>-mbig-obj</code></dt>
  450. <dd><p>On PE/COFF target this option forces the use of big object file
  451. format, which allows more than 32768 sections.
  452. </p>
  453. <a name="index-_002dmomit_002dlock_002dprefix_003d-option_002c-i386"></a>
  454. <a name="index-_002dmomit_002dlock_002dprefix_003d-option_002c-x86_002d64"></a>
  455. </dd>
  456. <dt><code>-momit-lock-prefix=<var>no</var></code></dt>
  457. <dt><code>-momit-lock-prefix=<var>yes</var></code></dt>
  458. <dd><p>These options control how the assembler should encode lock prefix.
  459. This option is intended as a workaround for processors, that fail on
  460. lock prefix. This option can only be safely used with single-core,
  461. single-thread computers
  462. <samp>-momit-lock-prefix=<var>yes</var></samp> will omit all lock prefixes.
  463. <samp>-momit-lock-prefix=<var>no</var></samp> will encode lock prefix as usual,
  464. which is the default.
  465. </p>
  466. <a name="index-_002dmfence_002das_002dlock_002dadd_003d-option_002c-i386"></a>
  467. <a name="index-_002dmfence_002das_002dlock_002dadd_003d-option_002c-x86_002d64"></a>
  468. </dd>
  469. <dt><code>-mfence-as-lock-add=<var>no</var></code></dt>
  470. <dt><code>-mfence-as-lock-add=<var>yes</var></code></dt>
  471. <dd><p>These options control how the assembler should encode lfence, mfence and
  472. sfence.
  473. <samp>-mfence-as-lock-add=<var>yes</var></samp> will encode lfence, mfence and
  474. sfence as &lsquo;<samp>lock addl $0x0, (%rsp)</samp>&rsquo; in 64-bit mode and
  475. &lsquo;<samp>lock addl $0x0, (%esp)</samp>&rsquo; in 32-bit mode.
  476. <samp>-mfence-as-lock-add=<var>no</var></samp> will encode lfence, mfence and
  477. sfence as usual, which is the default.
  478. </p>
  479. <a name="index-_002dmrelax_002drelocations_003d-option_002c-i386"></a>
  480. <a name="index-_002dmrelax_002drelocations_003d-option_002c-x86_002d64"></a>
  481. </dd>
  482. <dt><code>-mrelax-relocations=<var>no</var></code></dt>
  483. <dt><code>-mrelax-relocations=<var>yes</var></code></dt>
  484. <dd><p>These options control whether the assembler should generate relax
  485. relocations, R_386_GOT32X, in 32-bit mode, or R_X86_64_GOTPCRELX and
  486. R_X86_64_REX_GOTPCRELX, in 64-bit mode.
  487. <samp>-mrelax-relocations=<var>yes</var></samp> will generate relax relocations.
  488. <samp>-mrelax-relocations=<var>no</var></samp> will not generate relax
  489. relocations. The default can be controlled by a configure option
  490. <samp>--enable-x86-relax-relocations</samp>.
  491. </p>
  492. <a name="index-_002dmalign_002dbranch_002dboundary_003d-option_002c-i386"></a>
  493. <a name="index-_002dmalign_002dbranch_002dboundary_003d-option_002c-x86_002d64"></a>
  494. </dd>
  495. <dt><code>-malign-branch-boundary=<var>NUM</var></code></dt>
  496. <dd><p>This option controls how the assembler should align branches with segment
  497. prefixes or NOP. <var>NUM</var> must be a power of 2. It should be 0 or
  498. no less than 16. Branches will be aligned within <var>NUM</var> byte
  499. boundary. <samp>-malign-branch-boundary=0</samp>, which is the default,
  500. doesn&rsquo;t align branches.
  501. </p>
  502. <a name="index-_002dmalign_002dbranch_003d-option_002c-i386"></a>
  503. <a name="index-_002dmalign_002dbranch_003d-option_002c-x86_002d64"></a>
  504. </dd>
  505. <dt><code>-malign-branch=<var>TYPE</var>[+<var>TYPE</var>...]</code></dt>
  506. <dd><p>This option specifies types of branches to align. <var>TYPE</var> is
  507. combination of &lsquo;<samp>jcc</samp>&rsquo;, which aligns conditional jumps,
  508. &lsquo;<samp>fused</samp>&rsquo;, which aligns fused conditional jumps, &lsquo;<samp>jmp</samp>&rsquo;,
  509. which aligns unconditional jumps, &lsquo;<samp>call</samp>&rsquo; which aligns calls,
  510. &lsquo;<samp>ret</samp>&rsquo;, which aligns rets, &lsquo;<samp>indirect</samp>&rsquo;, which aligns indirect
  511. jumps and calls. The default is <samp>-malign-branch=jcc+fused+jmp</samp>.
  512. </p>
  513. <a name="index-_002dmalign_002dbranch_002dprefix_002dsize_003d-option_002c-i386"></a>
  514. <a name="index-_002dmalign_002dbranch_002dprefix_002dsize_003d-option_002c-x86_002d64"></a>
  515. </dd>
  516. <dt><code>-malign-branch-prefix-size=<var>NUM</var></code></dt>
  517. <dd><p>This option specifies the maximum number of prefixes on an instruction
  518. to align branches. <var>NUM</var> should be between 0 and 5. The default
  519. <var>NUM</var> is 5.
  520. </p>
  521. <a name="index-_002dmbranches_002dwithin_002d32B_002dboundaries-option_002c-i386"></a>
  522. <a name="index-_002dmbranches_002dwithin_002d32B_002dboundaries-option_002c-x86_002d64"></a>
  523. </dd>
  524. <dt><code>-mbranches-within-32B-boundaries</code></dt>
  525. <dd><p>This option aligns conditional jumps, fused conditional jumps and
  526. unconditional jumps within 32 byte boundary with up to 5 segment prefixes
  527. on an instruction. It is equivalent to
  528. <samp>-malign-branch-boundary=32</samp>
  529. <samp>-malign-branch=jcc+fused+jmp</samp>
  530. <samp>-malign-branch-prefix-size=5</samp>.
  531. The default doesn&rsquo;t align branches.
  532. </p>
  533. <a name="index-_002dmlfence_002dafter_002dload_003d-option_002c-i386"></a>
  534. <a name="index-_002dmlfence_002dafter_002dload_003d-option_002c-x86_002d64"></a>
  535. </dd>
  536. <dt><code>-mlfence-after-load=<var>no</var></code></dt>
  537. <dt><code>-mlfence-after-load=<var>yes</var></code></dt>
  538. <dd><p>These options control whether the assembler should generate lfence
  539. after load instructions. <samp>-mlfence-after-load=<var>yes</var></samp> will
  540. generate lfence. <samp>-mlfence-after-load=<var>no</var></samp> will not generate
  541. lfence, which is the default.
  542. </p>
  543. <a name="index-_002dmlfence_002dbefore_002dindirect_002dbranch_003d-option_002c-i386"></a>
  544. <a name="index-_002dmlfence_002dbefore_002dindirect_002dbranch_003d-option_002c-x86_002d64"></a>
  545. </dd>
  546. <dt><code>-mlfence-before-indirect-branch=<var>none</var></code></dt>
  547. <dt><code>-mlfence-before-indirect-branch=<var>all</var></code></dt>
  548. <dt><code>-mlfence-before-indirect-branch=<var>register</var></code></dt>
  549. <dt><code>-mlfence-before-indirect-branch=<var>memory</var></code></dt>
  550. <dd><p>These options control whether the assembler should generate lfence
  551. before indirect near branch instructions.
  552. <samp>-mlfence-before-indirect-branch=<var>all</var></samp> will generate lfence
  553. before indirect near branch via register and issue a warning before
  554. indirect near branch via memory.
  555. It also implicitly sets <samp>-mlfence-before-ret=<var>shl</var></samp> when
  556. there&rsquo;s no explicit <samp>-mlfence-before-ret=</samp>.
  557. <samp>-mlfence-before-indirect-branch=<var>register</var></samp> will generate
  558. lfence before indirect near branch via register.
  559. <samp>-mlfence-before-indirect-branch=<var>memory</var></samp> will issue a
  560. warning before indirect near branch via memory.
  561. <samp>-mlfence-before-indirect-branch=<var>none</var></samp> will not generate
  562. lfence nor issue warning, which is the default. Note that lfence won&rsquo;t
  563. be generated before indirect near branch via register with
  564. <samp>-mlfence-after-load=<var>yes</var></samp> since lfence will be generated
  565. after loading branch target register.
  566. </p>
  567. <a name="index-_002dmlfence_002dbefore_002dret_003d-option_002c-i386"></a>
  568. <a name="index-_002dmlfence_002dbefore_002dret_003d-option_002c-x86_002d64"></a>
  569. </dd>
  570. <dt><code>-mlfence-before-ret=<var>none</var></code></dt>
  571. <dt><code>-mlfence-before-ret=<var>shl</var></code></dt>
  572. <dt><code>-mlfence-before-ret=<var>or</var></code></dt>
  573. <dt><code>-mlfence-before-ret=<var>yes</var></code></dt>
  574. <dt><code>-mlfence-before-ret=<var>not</var></code></dt>
  575. <dd><p>These options control whether the assembler should generate lfence
  576. before ret. <samp>-mlfence-before-ret=<var>or</var></samp> will generate
  577. generate or instruction with lfence.
  578. <samp>-mlfence-before-ret=<var>shl/yes</var></samp> will generate shl instruction
  579. with lfence. <samp>-mlfence-before-ret=<var>not</var></samp> will generate not
  580. instruction with lfence. <samp>-mlfence-before-ret=<var>none</var></samp> will not
  581. generate lfence, which is the default.
  582. </p>
  583. <a name="index-_002dmx86_002dused_002dnote_003d-option_002c-i386"></a>
  584. <a name="index-_002dmx86_002dused_002dnote_003d-option_002c-x86_002d64"></a>
  585. </dd>
  586. <dt><code>-mx86-used-note=<var>no</var></code></dt>
  587. <dt><code>-mx86-used-note=<var>yes</var></code></dt>
  588. <dd><p>These options control whether the assembler should generate
  589. GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_FEATURE_2_USED
  590. GNU property notes. The default can be controlled by the
  591. <samp>--enable-x86-used-note</samp> configure option.
  592. </p>
  593. <a name="index-_002dmevexrcig_003d-option_002c-i386"></a>
  594. <a name="index-_002dmevexrcig_003d-option_002c-x86_002d64"></a>
  595. </dd>
  596. <dt><code>-mevexrcig=<var>rne</var></code></dt>
  597. <dt><code>-mevexrcig=<var>rd</var></code></dt>
  598. <dt><code>-mevexrcig=<var>ru</var></code></dt>
  599. <dt><code>-mevexrcig=<var>rz</var></code></dt>
  600. <dd><p>These options control how the assembler should encode SAE-only
  601. EVEX instructions. <samp>-mevexrcig=<var>rne</var></samp> will encode RC bits
  602. of EVEX instruction with 00, which is the default.
  603. <samp>-mevexrcig=<var>rd</var></samp>, <samp>-mevexrcig=<var>ru</var></samp>
  604. and <samp>-mevexrcig=<var>rz</var></samp> will encode SAE-only EVEX instructions
  605. with 01, 10 and 11 RC bits, respectively.
  606. </p>
  607. <a name="index-_002dmamd64-option_002c-x86_002d64"></a>
  608. <a name="index-_002dmintel64-option_002c-x86_002d64"></a>
  609. </dd>
  610. <dt><code>-mamd64</code></dt>
  611. <dt><code>-mintel64</code></dt>
  612. <dd><p>This option specifies that the assembler should accept only AMD64 or
  613. Intel64 ISA in 64-bit mode. The default is to accept common, Intel64
  614. only and AMD64 ISAs.
  615. </p>
  616. <a name="index-_002dO0-option_002c-i386"></a>
  617. <a name="index-_002dO0-option_002c-x86_002d64"></a>
  618. <a name="index-_002dO-option_002c-i386"></a>
  619. <a name="index-_002dO-option_002c-x86_002d64"></a>
  620. <a name="index-_002dO1-option_002c-i386"></a>
  621. <a name="index-_002dO1-option_002c-x86_002d64"></a>
  622. <a name="index-_002dO2-option_002c-i386"></a>
  623. <a name="index-_002dO2-option_002c-x86_002d64"></a>
  624. <a name="index-_002dOs-option_002c-i386"></a>
  625. <a name="index-_002dOs-option_002c-x86_002d64"></a>
  626. </dd>
  627. <dt><code>-O0 | -O | -O1 | -O2 | -Os</code></dt>
  628. <dd><p>Optimize instruction encoding with smaller instruction size. &lsquo;<samp>-O</samp>&rsquo;
  629. and &lsquo;<samp>-O1</samp>&rsquo; encode 64-bit register load instructions with 64-bit
  630. immediate as 32-bit register load instructions with 31-bit or 32-bits
  631. immediates, encode 64-bit register clearing instructions with 32-bit
  632. register clearing instructions, encode 256-bit/512-bit VEX/EVEX vector
  633. register clearing instructions with 128-bit VEX vector register
  634. clearing instructions, encode 128-bit/256-bit EVEX vector
  635. register load/store instructions with VEX vector register load/store
  636. instructions, and encode 128-bit/256-bit EVEX packed integer logical
  637. instructions with 128-bit/256-bit VEX packed integer logical.
  638. </p>
  639. <p>&lsquo;<samp>-O2</samp>&rsquo; includes &lsquo;<samp>-O1</samp>&rsquo; optimization plus encodes
  640. 256-bit/512-bit EVEX vector register clearing instructions with 128-bit
  641. EVEX vector register clearing instructions. In 64-bit mode VEX encoded
  642. instructions with commutative source operands will also have their
  643. source operands swapped if this allows using the 2-byte VEX prefix form
  644. instead of the 3-byte one. Certain forms of AND as well as OR with the
  645. same (register) operand specified twice will also be changed to TEST.
  646. </p>
  647. <p>&lsquo;<samp>-Os</samp>&rsquo; includes &lsquo;<samp>-O2</samp>&rsquo; optimization plus encodes 16-bit, 32-bit
  648. and 64-bit register tests with immediate as 8-bit register test with
  649. immediate. &lsquo;<samp>-O0</samp>&rsquo; turns off this optimization.
  650. </p>
  651. </dd>
  652. </dl>
  653. <hr>
  654. <div class="header">
  655. <p>
  656. Next: <a href="i386_002dDirectives.html#i386_002dDirectives" accesskey="n" rel="next">i386-Directives</a>, Up: <a href="i386_002dDependent.html#i386_002dDependent" accesskey="u" rel="up">i386-Dependent</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  657. </div>
  658. </body>
  659. </html>