Skip to content

Commit 8c48fe9

Browse files
authored
Change default output of [@]code_native to intel syntax (#48103)
* Change `[@]code_{native,llvm}` default output to intel syntax * Add code_native change to NEWS.md Co-authored-by: Sukera <[email protected]>
1 parent a9ce60a commit 8c48fe9

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Standard library changes
8282
#### DelimitedFiles
8383

8484

85+
#### InteractiveUtils
86+
87+
* `code_native` and `@code_native` now default to intel syntax instead of AT&T.
88+
8589
Deprecated or removed
8690
---------------------
8791

stdlib/InteractiveUtils/src/codeview.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Keyword argument `debuginfo` may be one of source (default) or none, to specify
268268
"""
269269
function code_llvm(io::IO, @nospecialize(f), @nospecialize(types), raw::Bool,
270270
dump_module::Bool=false, optimize::Bool=true, debuginfo::Symbol=:default)
271-
d = _dump_function(f, types, false, false, !raw, dump_module, :att, optimize, debuginfo, false)
271+
d = _dump_function(f, types, false, false, !raw, dump_module, :intel, optimize, debuginfo, false)
272272
if highlighting[:llvm] && get(io, :color, false)::Bool
273273
print_llvm(io, d)
274274
else
@@ -281,28 +281,28 @@ code_llvm(@nospecialize(f), @nospecialize(types=Base.default_tt(f)); raw=false,
281281
code_llvm(stdout, f, types; raw, dump_module, optimize, debuginfo)
282282

283283
"""
284-
code_native([io=stdout,], f, types; syntax=:att, debuginfo=:default, binary=false, dump_module=true)
284+
code_native([io=stdout,], f, types; syntax=:intel, debuginfo=:default, binary=false, dump_module=true)
285285
286286
Prints the native assembly instructions generated for running the method matching the given
287287
generic function and type signature to `io`.
288288
289-
* Set assembly syntax by setting `syntax` to `:att` (default) for AT&T syntax or `:intel` for Intel syntax.
289+
* Set assembly syntax by setting `syntax` to `:intel` (default) for intel syntax or `:att` for AT&T syntax.
290290
* Specify verbosity of code comments by setting `debuginfo` to `:source` (default) or `:none`.
291291
* If `binary` is `true`, also print the binary machine code for each instruction precedented by an abbreviated address.
292292
* If `dump_module` is `false`, do not print metadata such as rodata or directives.
293293
294294
See also: [`@code_native`](@ref), [`code_llvm`](@ref), [`code_typed`](@ref) and [`code_lowered`](@ref)
295295
"""
296296
function code_native(io::IO, @nospecialize(f), @nospecialize(types=Base.default_tt(f));
297-
dump_module::Bool=true, syntax::Symbol=:att, debuginfo::Symbol=:default, binary::Bool=false)
297+
dump_module::Bool=true, syntax::Symbol=:intel, debuginfo::Symbol=:default, binary::Bool=false)
298298
d = _dump_function(f, types, true, false, false, dump_module, syntax, true, debuginfo, binary)
299299
if highlighting[:native] && get(io, :color, false)::Bool
300300
print_native(io, d)
301301
else
302302
print(io, d)
303303
end
304304
end
305-
code_native(@nospecialize(f), @nospecialize(types=Base.default_tt(f)); dump_module::Bool=true, syntax::Symbol=:att, debuginfo::Symbol=:default, binary::Bool=false) =
305+
code_native(@nospecialize(f), @nospecialize(types=Base.default_tt(f)); dump_module::Bool=true, syntax::Symbol=:intel, debuginfo::Symbol=:default, binary::Bool=false) =
306306
code_native(stdout, f, types; dump_module, syntax, debuginfo, binary)
307307
code_native(::IO, ::Any, ::Symbol) = error("invalid code_native call") # resolve ambiguous call
308308

stdlib/InteractiveUtils/src/macros.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ by putting it before the function call, like this:
345345
346346
@code_native syntax=:intel debuginfo=:default binary=true dump_module=false f(x)
347347
348-
* Set assembly syntax by setting `syntax` to `:att` (default) for AT&T syntax or `:intel` for Intel syntax.
348+
* Set assembly syntax by setting `syntax` to `:intel` (default) for Intel syntax or `:att` for AT&T syntax.
349349
* Specify verbosity of code comments by setting `debuginfo` to `:source` (default) or `:none`.
350350
* If `binary` is `true`, also print the binary machine code for each instruction precedented by an abbreviated address.
351351
* If `dump_module` is `false`, do not print metadata such as rodata or directives.

0 commit comments

Comments
 (0)