You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

650 lines
27KB

  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-2020 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>btver1</code>,
  147. <code>btver2</code>,
  148. <code>generic32</code> and
  149. <code>generic64</code>.
  150. </p>
  151. <p>In addition to the basic instruction set, the assembler can be told to
  152. accept various extension mnemonics. For example,
  153. <code>-march=i686+sse4+vmx</code> extends <var>i686</var> with <var>sse4</var> and
  154. <var>vmx</var>. The following extensions are currently supported:
  155. <code>8087</code>,
  156. <code>287</code>,
  157. <code>387</code>,
  158. <code>687</code>,
  159. <code>no87</code>,
  160. <code>no287</code>,
  161. <code>no387</code>,
  162. <code>no687</code>,
  163. <code>cmov</code>,
  164. <code>nocmov</code>,
  165. <code>fxsr</code>,
  166. <code>nofxsr</code>,
  167. <code>mmx</code>,
  168. <code>nommx</code>,
  169. <code>sse</code>,
  170. <code>sse2</code>,
  171. <code>sse3</code>,
  172. <code>sse4a</code>,
  173. <code>ssse3</code>,
  174. <code>sse4.1</code>,
  175. <code>sse4.2</code>,
  176. <code>sse4</code>,
  177. <code>nosse</code>,
  178. <code>nosse2</code>,
  179. <code>nosse3</code>,
  180. <code>nosse4a</code>,
  181. <code>nossse3</code>,
  182. <code>nosse4.1</code>,
  183. <code>nosse4.2</code>,
  184. <code>nosse4</code>,
  185. <code>avx</code>,
  186. <code>avx2</code>,
  187. <code>noavx</code>,
  188. <code>noavx2</code>,
  189. <code>adx</code>,
  190. <code>rdseed</code>,
  191. <code>prfchw</code>,
  192. <code>smap</code>,
  193. <code>mpx</code>,
  194. <code>sha</code>,
  195. <code>rdpid</code>,
  196. <code>ptwrite</code>,
  197. <code>cet</code>,
  198. <code>gfni</code>,
  199. <code>vaes</code>,
  200. <code>vpclmulqdq</code>,
  201. <code>prefetchwt1</code>,
  202. <code>clflushopt</code>,
  203. <code>se1</code>,
  204. <code>clwb</code>,
  205. <code>movdiri</code>,
  206. <code>movdir64b</code>,
  207. <code>enqcmd</code>,
  208. <code>serialize</code>,
  209. <code>tsxldtrk</code>,
  210. <code>avx512f</code>,
  211. <code>avx512cd</code>,
  212. <code>avx512er</code>,
  213. <code>avx512pf</code>,
  214. <code>avx512vl</code>,
  215. <code>avx512bw</code>,
  216. <code>avx512dq</code>,
  217. <code>avx512ifma</code>,
  218. <code>avx512vbmi</code>,
  219. <code>avx512_4fmaps</code>,
  220. <code>avx512_4vnniw</code>,
  221. <code>avx512_vpopcntdq</code>,
  222. <code>avx512_vbmi2</code>,
  223. <code>avx512_vnni</code>,
  224. <code>avx512_bitalg</code>,
  225. <code>avx512_vp2intersect</code>,
  226. <code>avx512_bf16</code>,
  227. <code>noavx512f</code>,
  228. <code>noavx512cd</code>,
  229. <code>noavx512er</code>,
  230. <code>noavx512pf</code>,
  231. <code>noavx512vl</code>,
  232. <code>noavx512bw</code>,
  233. <code>noavx512dq</code>,
  234. <code>noavx512ifma</code>,
  235. <code>noavx512vbmi</code>,
  236. <code>noavx512_4fmaps</code>,
  237. <code>noavx512_4vnniw</code>,
  238. <code>noavx512_vpopcntdq</code>,
  239. <code>noavx512_vbmi2</code>,
  240. <code>noavx512_vnni</code>,
  241. <code>noavx512_bitalg</code>,
  242. <code>noavx512_vp2intersect</code>,
  243. <code>noavx512_bf16</code>,
  244. <code>noenqcmd</code>,
  245. <code>noserialize</code>,
  246. <code>notsxldtrk</code>,
  247. <code>vmx</code>,
  248. <code>vmfunc</code>,
  249. <code>smx</code>,
  250. <code>xsave</code>,
  251. <code>xsaveopt</code>,
  252. <code>xsavec</code>,
  253. <code>xsaves</code>,
  254. <code>aes</code>,
  255. <code>pclmul</code>,
  256. <code>fsgsbase</code>,
  257. <code>rdrnd</code>,
  258. <code>f16c</code>,
  259. <code>bmi2</code>,
  260. <code>fma</code>,
  261. <code>movbe</code>,
  262. <code>ept</code>,
  263. <code>lzcnt</code>,
  264. <code>popcnt</code>,
  265. <code>hle</code>,
  266. <code>rtm</code>,
  267. <code>invpcid</code>,
  268. <code>clflush</code>,
  269. <code>mwaitx</code>,
  270. <code>clzero</code>,
  271. <code>wbnoinvd</code>,
  272. <code>pconfig</code>,
  273. <code>waitpkg</code>,
  274. <code>cldemote</code>,
  275. <code>rdpru</code>,
  276. <code>mcommit</code>,
  277. <code>sev_es</code>,
  278. <code>lwp</code>,
  279. <code>fma4</code>,
  280. <code>xop</code>,
  281. <code>cx16</code>,
  282. <code>syscall</code>,
  283. <code>rdtscp</code>,
  284. <code>3dnow</code>,
  285. <code>3dnowa</code>,
  286. <code>sse4a</code>,
  287. <code>sse5</code>,
  288. <code>svme</code> and
  289. <code>padlock</code>.
  290. Note that rather than extending a basic instruction set, the extension
  291. mnemonics starting with <code>no</code> revoke the respective functionality.
  292. </p>
  293. <p>When the <code>.arch</code> directive is used with <samp>-march</samp>, the
  294. <code>.arch</code> directive will take precedent.
  295. </p>
  296. <a name="index-_002dmtune_003d-option_002c-i386"></a>
  297. <a name="index-_002dmtune_003d-option_002c-x86_002d64"></a>
  298. </dd>
  299. <dt><code>-mtune=<var>CPU</var></code></dt>
  300. <dd><p>This option specifies a processor to optimize for. When used in
  301. conjunction with the <samp>-march</samp> option, only instructions
  302. of the processor specified by the <samp>-march</samp> option will be
  303. generated.
  304. </p>
  305. <p>Valid <var>CPU</var> values are identical to the processor list of
  306. <samp>-march=<var>CPU</var></samp>.
  307. </p>
  308. <a name="index-_002dmsse2avx-option_002c-i386"></a>
  309. <a name="index-_002dmsse2avx-option_002c-x86_002d64"></a>
  310. </dd>
  311. <dt><code>-msse2avx</code></dt>
  312. <dd><p>This option specifies that the assembler should encode SSE instructions
  313. with VEX prefix.
  314. </p>
  315. <a name="index-_002dmsse_002dcheck_003d-option_002c-i386"></a>
  316. <a name="index-_002dmsse_002dcheck_003d-option_002c-x86_002d64"></a>
  317. </dd>
  318. <dt><code>-msse-check=<var>none</var></code></dt>
  319. <dt><code>-msse-check=<var>warning</var></code></dt>
  320. <dt><code>-msse-check=<var>error</var></code></dt>
  321. <dd><p>These options control if the assembler should check SSE instructions.
  322. <samp>-msse-check=<var>none</var></samp> will make the assembler not to check SSE
  323. instructions, which is the default. <samp>-msse-check=<var>warning</var></samp>
  324. will make the assembler issue a warning for any SSE instruction.
  325. <samp>-msse-check=<var>error</var></samp> will make the assembler issue an error
  326. for any SSE instruction.
  327. </p>
  328. <a name="index-_002dmavxscalar_003d-option_002c-i386"></a>
  329. <a name="index-_002dmavxscalar_003d-option_002c-x86_002d64"></a>
  330. </dd>
  331. <dt><code>-mavxscalar=<var>128</var></code></dt>
  332. <dt><code>-mavxscalar=<var>256</var></code></dt>
  333. <dd><p>These options control how the assembler should encode scalar AVX
  334. instructions. <samp>-mavxscalar=<var>128</var></samp> will encode scalar
  335. AVX instructions with 128bit vector length, which is the default.
  336. <samp>-mavxscalar=<var>256</var></samp> will encode scalar AVX instructions
  337. with 256bit vector length.
  338. </p>
  339. <p>WARNING: Don&rsquo;t use this for production code - due to CPU errata the
  340. resulting code may not work on certain models.
  341. </p>
  342. <a name="index-_002dmvexwig_003d-option_002c-i386"></a>
  343. <a name="index-_002dmvexwig_003d-option_002c-x86_002d64"></a>
  344. </dd>
  345. <dt><code>-mvexwig=<var>0</var></code></dt>
  346. <dt><code>-mvexwig=<var>1</var></code></dt>
  347. <dd><p>These options control how the assembler should encode VEX.W-ignored (WIG)
  348. VEX instructions. <samp>-mvexwig=<var>0</var></samp> will encode WIG VEX
  349. instructions with vex.w = 0, which is the default.
  350. <samp>-mvexwig=<var>1</var></samp> will encode WIG EVEX instructions with
  351. vex.w = 1.
  352. </p>
  353. <p>WARNING: Don&rsquo;t use this for production code - due to CPU errata the
  354. resulting code may not work on certain models.
  355. </p>
  356. <a name="index-_002dmevexlig_003d-option_002c-i386"></a>
  357. <a name="index-_002dmevexlig_003d-option_002c-x86_002d64"></a>
  358. </dd>
  359. <dt><code>-mevexlig=<var>128</var></code></dt>
  360. <dt><code>-mevexlig=<var>256</var></code></dt>
  361. <dt><code>-mevexlig=<var>512</var></code></dt>
  362. <dd><p>These options control how the assembler should encode length-ignored
  363. (LIG) EVEX instructions. <samp>-mevexlig=<var>128</var></samp> will encode LIG
  364. EVEX instructions with 128bit vector length, which is the default.
  365. <samp>-mevexlig=<var>256</var></samp> and <samp>-mevexlig=<var>512</var></samp> will
  366. encode LIG EVEX instructions with 256bit and 512bit vector length,
  367. respectively.
  368. </p>
  369. <a name="index-_002dmevexwig_003d-option_002c-i386"></a>
  370. <a name="index-_002dmevexwig_003d-option_002c-x86_002d64"></a>
  371. </dd>
  372. <dt><code>-mevexwig=<var>0</var></code></dt>
  373. <dt><code>-mevexwig=<var>1</var></code></dt>
  374. <dd><p>These options control how the assembler should encode w-ignored (WIG)
  375. EVEX instructions. <samp>-mevexwig=<var>0</var></samp> will encode WIG
  376. EVEX instructions with evex.w = 0, which is the default.
  377. <samp>-mevexwig=<var>1</var></samp> will encode WIG EVEX instructions with
  378. evex.w = 1.
  379. </p>
  380. <a name="index-_002dmmnemonic_003d-option_002c-i386"></a>
  381. <a name="index-_002dmmnemonic_003d-option_002c-x86_002d64"></a>
  382. </dd>
  383. <dt><code>-mmnemonic=<var>att</var></code></dt>
  384. <dt><code>-mmnemonic=<var>intel</var></code></dt>
  385. <dd><p>This option specifies instruction mnemonic for matching instructions.
  386. The <code>.att_mnemonic</code> and <code>.intel_mnemonic</code> directives will
  387. take precedent.
  388. </p>
  389. <a name="index-_002dmsyntax_003d-option_002c-i386"></a>
  390. <a name="index-_002dmsyntax_003d-option_002c-x86_002d64"></a>
  391. </dd>
  392. <dt><code>-msyntax=<var>att</var></code></dt>
  393. <dt><code>-msyntax=<var>intel</var></code></dt>
  394. <dd><p>This option specifies instruction syntax when processing instructions.
  395. The <code>.att_syntax</code> and <code>.intel_syntax</code> directives will
  396. take precedent.
  397. </p>
  398. <a name="index-_002dmnaked_002dreg-option_002c-i386"></a>
  399. <a name="index-_002dmnaked_002dreg-option_002c-x86_002d64"></a>
  400. </dd>
  401. <dt><code>-mnaked-reg</code></dt>
  402. <dd><p>This option specifies that registers don&rsquo;t require a &lsquo;<samp>%</samp>&rsquo; prefix.
  403. The <code>.att_syntax</code> and <code>.intel_syntax</code> directives will take precedent.
  404. </p>
  405. <a name="index-_002dmadd_002dbnd_002dprefix-option_002c-i386"></a>
  406. <a name="index-_002dmadd_002dbnd_002dprefix-option_002c-x86_002d64"></a>
  407. </dd>
  408. <dt><code>-madd-bnd-prefix</code></dt>
  409. <dd><p>This option forces the assembler to add BND prefix to all branches, even
  410. if such prefix was not explicitly specified in the source code.
  411. </p>
  412. <a name="index-_002dmshared-option_002c-i386"></a>
  413. <a name="index-_002dmshared-option_002c-x86_002d64"></a>
  414. </dd>
  415. <dt><code>-mno-shared</code></dt>
  416. <dd><p>On ELF target, the assembler normally optimizes out non-PLT relocations
  417. against defined non-weak global branch targets with default visibility.
  418. The &lsquo;<samp>-mshared</samp>&rsquo; option tells the assembler to generate code which
  419. may go into a shared library where all non-weak global branch targets
  420. with default visibility can be preempted. The resulting code is
  421. slightly bigger. This option only affects the handling of branch
  422. instructions.
  423. </p>
  424. <a name="index-_002dmbig_002dobj-option_002c-i386"></a>
  425. <a name="index-_002dmbig_002dobj-option_002c-x86_002d64"></a>
  426. </dd>
  427. <dt><code>-mbig-obj</code></dt>
  428. <dd><p>On PE/COFF target this option forces the use of big object file
  429. format, which allows more than 32768 sections.
  430. </p>
  431. <a name="index-_002dmomit_002dlock_002dprefix_003d-option_002c-i386"></a>
  432. <a name="index-_002dmomit_002dlock_002dprefix_003d-option_002c-x86_002d64"></a>
  433. </dd>
  434. <dt><code>-momit-lock-prefix=<var>no</var></code></dt>
  435. <dt><code>-momit-lock-prefix=<var>yes</var></code></dt>
  436. <dd><p>These options control how the assembler should encode lock prefix.
  437. This option is intended as a workaround for processors, that fail on
  438. lock prefix. This option can only be safely used with single-core,
  439. single-thread computers
  440. <samp>-momit-lock-prefix=<var>yes</var></samp> will omit all lock prefixes.
  441. <samp>-momit-lock-prefix=<var>no</var></samp> will encode lock prefix as usual,
  442. which is the default.
  443. </p>
  444. <a name="index-_002dmfence_002das_002dlock_002dadd_003d-option_002c-i386"></a>
  445. <a name="index-_002dmfence_002das_002dlock_002dadd_003d-option_002c-x86_002d64"></a>
  446. </dd>
  447. <dt><code>-mfence-as-lock-add=<var>no</var></code></dt>
  448. <dt><code>-mfence-as-lock-add=<var>yes</var></code></dt>
  449. <dd><p>These options control how the assembler should encode lfence, mfence and
  450. sfence.
  451. <samp>-mfence-as-lock-add=<var>yes</var></samp> will encode lfence, mfence and
  452. sfence as &lsquo;<samp>lock addl $0x0, (%rsp)</samp>&rsquo; in 64-bit mode and
  453. &lsquo;<samp>lock addl $0x0, (%esp)</samp>&rsquo; in 32-bit mode.
  454. <samp>-mfence-as-lock-add=<var>no</var></samp> will encode lfence, mfence and
  455. sfence as usual, which is the default.
  456. </p>
  457. <a name="index-_002dmrelax_002drelocations_003d-option_002c-i386"></a>
  458. <a name="index-_002dmrelax_002drelocations_003d-option_002c-x86_002d64"></a>
  459. </dd>
  460. <dt><code>-mrelax-relocations=<var>no</var></code></dt>
  461. <dt><code>-mrelax-relocations=<var>yes</var></code></dt>
  462. <dd><p>These options control whether the assembler should generate relax
  463. relocations, R_386_GOT32X, in 32-bit mode, or R_X86_64_GOTPCRELX and
  464. R_X86_64_REX_GOTPCRELX, in 64-bit mode.
  465. <samp>-mrelax-relocations=<var>yes</var></samp> will generate relax relocations.
  466. <samp>-mrelax-relocations=<var>no</var></samp> will not generate relax
  467. relocations. The default can be controlled by a configure option
  468. <samp>--enable-x86-relax-relocations</samp>.
  469. </p>
  470. <a name="index-_002dmalign_002dbranch_002dboundary_003d-option_002c-i386"></a>
  471. <a name="index-_002dmalign_002dbranch_002dboundary_003d-option_002c-x86_002d64"></a>
  472. </dd>
  473. <dt><code>-malign-branch-boundary=<var>NUM</var></code></dt>
  474. <dd><p>This option controls how the assembler should align branches with segment
  475. prefixes or NOP. <var>NUM</var> must be a power of 2. It should be 0 or
  476. no less than 16. Branches will be aligned within <var>NUM</var> byte
  477. boundary. <samp>-malign-branch-boundary=0</samp>, which is the default,
  478. doesn&rsquo;t align branches.
  479. </p>
  480. <a name="index-_002dmalign_002dbranch_003d-option_002c-i386"></a>
  481. <a name="index-_002dmalign_002dbranch_003d-option_002c-x86_002d64"></a>
  482. </dd>
  483. <dt><code>-malign-branch=<var>TYPE</var>[+<var>TYPE</var>...]</code></dt>
  484. <dd><p>This option specifies types of branches to align. <var>TYPE</var> is
  485. combination of &lsquo;<samp>jcc</samp>&rsquo;, which aligns conditional jumps,
  486. &lsquo;<samp>fused</samp>&rsquo;, which aligns fused conditional jumps, &lsquo;<samp>jmp</samp>&rsquo;,
  487. which aligns unconditional jumps, &lsquo;<samp>call</samp>&rsquo; which aligns calls,
  488. &lsquo;<samp>ret</samp>&rsquo;, which aligns rets, &lsquo;<samp>indirect</samp>&rsquo;, which aligns indirect
  489. jumps and calls. The default is <samp>-malign-branch=jcc+fused+jmp</samp>.
  490. </p>
  491. <a name="index-_002dmalign_002dbranch_002dprefix_002dsize_003d-option_002c-i386"></a>
  492. <a name="index-_002dmalign_002dbranch_002dprefix_002dsize_003d-option_002c-x86_002d64"></a>
  493. </dd>
  494. <dt><code>-malign-branch-prefix-size=<var>NUM</var></code></dt>
  495. <dd><p>This option specifies the maximum number of prefixes on an instruction
  496. to align branches. <var>NUM</var> should be between 0 and 5. The default
  497. <var>NUM</var> is 5.
  498. </p>
  499. <a name="index-_002dmbranches_002dwithin_002d32B_002dboundaries-option_002c-i386"></a>
  500. <a name="index-_002dmbranches_002dwithin_002d32B_002dboundaries-option_002c-x86_002d64"></a>
  501. </dd>
  502. <dt><code>-mbranches-within-32B-boundaries</code></dt>
  503. <dd><p>This option aligns conditional jumps, fused conditional jumps and
  504. unconditional jumps within 32 byte boundary with up to 5 segment prefixes
  505. on an instruction. It is equivalent to
  506. <samp>-malign-branch-boundary=32</samp>
  507. <samp>-malign-branch=jcc+fused+jmp</samp>
  508. <samp>-malign-branch-prefix-size=5</samp>.
  509. The default doesn&rsquo;t align branches.
  510. </p>
  511. <a name="index-_002dmlfence_002dafter_002dload_003d-option_002c-i386"></a>
  512. <a name="index-_002dmlfence_002dafter_002dload_003d-option_002c-x86_002d64"></a>
  513. </dd>
  514. <dt><code>-mlfence-after-load=<var>no</var></code></dt>
  515. <dt><code>-mlfence-after-load=<var>yes</var></code></dt>
  516. <dd><p>These options control whether the assembler should generate lfence
  517. after load instructions. <samp>-mlfence-after-load=<var>yes</var></samp> will
  518. generate lfence. <samp>-mlfence-after-load=<var>no</var></samp> will not generate
  519. lfence, which is the default.
  520. </p>
  521. <a name="index-_002dmlfence_002dbefore_002dindirect_002dbranch_003d-option_002c-i386"></a>
  522. <a name="index-_002dmlfence_002dbefore_002dindirect_002dbranch_003d-option_002c-x86_002d64"></a>
  523. </dd>
  524. <dt><code>-mlfence-before-indirect-branch=<var>none</var></code></dt>
  525. <dt><code>-mlfence-before-indirect-branch=<var>all</var></code></dt>
  526. <dt><code>-mlfence-before-indirect-branch=<var>register</var></code></dt>
  527. <dt><code>-mlfence-before-indirect-branch=<var>memory</var></code></dt>
  528. <dd><p>These options control whether the assembler should generate lfence
  529. before indirect near branch instructions.
  530. <samp>-mlfence-before-indirect-branch=<var>all</var></samp> will generate lfence
  531. before indirect near branch via register and issue a warning before
  532. indirect near branch via memory.
  533. It also implicitly sets <samp>-mlfence-before-ret=<var>shl</var></samp> when
  534. there&rsquo;s no explict <samp>-mlfence-before-ret=</samp>.
  535. <samp>-mlfence-before-indirect-branch=<var>register</var></samp> will generate
  536. lfence before indirect near branch via register.
  537. <samp>-mlfence-before-indirect-branch=<var>memory</var></samp> will issue a
  538. warning before indirect near branch via memory.
  539. <samp>-mlfence-before-indirect-branch=<var>none</var></samp> will not generate
  540. lfence nor issue warning, which is the default. Note that lfence won&rsquo;t
  541. be generated before indirect near branch via register with
  542. <samp>-mlfence-after-load=<var>yes</var></samp> since lfence will be generated
  543. after loading branch target register.
  544. </p>
  545. <a name="index-_002dmlfence_002dbefore_002dret_003d-option_002c-i386"></a>
  546. <a name="index-_002dmlfence_002dbefore_002dret_003d-option_002c-x86_002d64"></a>
  547. </dd>
  548. <dt><code>-mlfence-before-ret=<var>none</var></code></dt>
  549. <dt><code>-mlfence-before-ret=<var>shl</var></code></dt>
  550. <dt><code>-mlfence-before-ret=<var>or</var></code></dt>
  551. <dt><code>-mlfence-before-ret=<var>yes</var></code></dt>
  552. <dt><code>-mlfence-before-ret=<var>not</var></code></dt>
  553. <dd><p>These options control whether the assembler should generate lfence
  554. before ret. <samp>-mlfence-before-ret=<var>or</var></samp> will generate
  555. generate or instruction with lfence.
  556. <samp>-mlfence-before-ret=<var>shl/yes</var></samp> will generate shl instruction
  557. with lfence. <samp>-mlfence-before-ret=<var>not</var></samp> will generate not
  558. instruction with lfence. <samp>-mlfence-before-ret=<var>none</var></samp> will not
  559. generate lfence, which is the default.
  560. </p>
  561. <a name="index-_002dmx86_002dused_002dnote_003d-option_002c-i386"></a>
  562. <a name="index-_002dmx86_002dused_002dnote_003d-option_002c-x86_002d64"></a>
  563. </dd>
  564. <dt><code>-mx86-used-note=<var>no</var></code></dt>
  565. <dt><code>-mx86-used-note=<var>yes</var></code></dt>
  566. <dd><p>These options control whether the assembler should generate
  567. GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_FEATURE_2_USED
  568. GNU property notes. The default can be controlled by the
  569. <samp>--enable-x86-used-note</samp> configure option.
  570. </p>
  571. <a name="index-_002dmevexrcig_003d-option_002c-i386"></a>
  572. <a name="index-_002dmevexrcig_003d-option_002c-x86_002d64"></a>
  573. </dd>
  574. <dt><code>-mevexrcig=<var>rne</var></code></dt>
  575. <dt><code>-mevexrcig=<var>rd</var></code></dt>
  576. <dt><code>-mevexrcig=<var>ru</var></code></dt>
  577. <dt><code>-mevexrcig=<var>rz</var></code></dt>
  578. <dd><p>These options control how the assembler should encode SAE-only
  579. EVEX instructions. <samp>-mevexrcig=<var>rne</var></samp> will encode RC bits
  580. of EVEX instruction with 00, which is the default.
  581. <samp>-mevexrcig=<var>rd</var></samp>, <samp>-mevexrcig=<var>ru</var></samp>
  582. and <samp>-mevexrcig=<var>rz</var></samp> will encode SAE-only EVEX instructions
  583. with 01, 10 and 11 RC bits, respectively.
  584. </p>
  585. <a name="index-_002dmamd64-option_002c-x86_002d64"></a>
  586. <a name="index-_002dmintel64-option_002c-x86_002d64"></a>
  587. </dd>
  588. <dt><code>-mamd64</code></dt>
  589. <dt><code>-mintel64</code></dt>
  590. <dd><p>This option specifies that the assembler should accept only AMD64 or
  591. Intel64 ISA in 64-bit mode. The default is to accept common, Intel64
  592. only and AMD64 ISAs.
  593. </p>
  594. <a name="index-_002dO0-option_002c-i386"></a>
  595. <a name="index-_002dO0-option_002c-x86_002d64"></a>
  596. <a name="index-_002dO-option_002c-i386"></a>
  597. <a name="index-_002dO-option_002c-x86_002d64"></a>
  598. <a name="index-_002dO1-option_002c-i386"></a>
  599. <a name="index-_002dO1-option_002c-x86_002d64"></a>
  600. <a name="index-_002dO2-option_002c-i386"></a>
  601. <a name="index-_002dO2-option_002c-x86_002d64"></a>
  602. <a name="index-_002dOs-option_002c-i386"></a>
  603. <a name="index-_002dOs-option_002c-x86_002d64"></a>
  604. </dd>
  605. <dt><code>-O0 | -O | -O1 | -O2 | -Os</code></dt>
  606. <dd><p>Optimize instruction encoding with smaller instruction size. &lsquo;<samp>-O</samp>&rsquo;
  607. and &lsquo;<samp>-O1</samp>&rsquo; encode 64-bit register load instructions with 64-bit
  608. immediate as 32-bit register load instructions with 31-bit or 32-bits
  609. immediates, encode 64-bit register clearing instructions with 32-bit
  610. register clearing instructions, encode 256-bit/512-bit VEX/EVEX vector
  611. register clearing instructions with 128-bit VEX vector register
  612. clearing instructions, encode 128-bit/256-bit EVEX vector
  613. register load/store instructions with VEX vector register load/store
  614. instructions, and encode 128-bit/256-bit EVEX packed integer logical
  615. instructions with 128-bit/256-bit VEX packed integer logical.
  616. </p>
  617. <p>&lsquo;<samp>-O2</samp>&rsquo; includes &lsquo;<samp>-O1</samp>&rsquo; optimization plus encodes
  618. 256-bit/512-bit EVEX vector register clearing instructions with 128-bit
  619. EVEX vector register clearing instructions. In 64-bit mode VEX encoded
  620. instructions with commutative source operands will also have their
  621. source operands swapped if this allows using the 2-byte VEX prefix form
  622. instead of the 3-byte one. Certain forms of AND as well as OR with the
  623. same (register) operand specified twice will also be changed to TEST.
  624. </p>
  625. <p>&lsquo;<samp>-Os</samp>&rsquo; includes &lsquo;<samp>-O2</samp>&rsquo; optimization plus encodes 16-bit, 32-bit
  626. and 64-bit register tests with immediate as 8-bit register test with
  627. immediate. &lsquo;<samp>-O0</samp>&rsquo; turns off this optimization.
  628. </p>
  629. </dd>
  630. </dl>
  631. <hr>
  632. <div class="header">
  633. <p>
  634. 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>
  635. </div>
  636. </body>
  637. </html>