Edit: An admin should probably split this derailed discussion to a new thread…
Ok, I guess that was a bad example (still odd, though). The following show that my understanding was indeed wrong and it is as you said:
No flag:
julia> iee(x,y,z) = x*y + z
iee (generic function with 1 method)
julia> fast(x,y,z) = @fastmath x*y + z
fast (generic function with 1 method)
julia> @code_native iee(2.,3.,1.)
.section __TEXT,__text,regular,pure_instructions
; Function iee {
; Location: REPL[1]:1
; Function *; {
; Location: REPL[1]:1
vmulsd %xmm1, %xmm0, %xmm0
;}
; Function +; {
; Location: float.jl:395
vaddsd %xmm2, %xmm0, %xmm0
;}
retl
nopl (%eax)
;}
julia> @code_native fast(2.,3.,1.)
.section __TEXT,__text,regular,pure_instructions
; Function fast {
; Location: REPL[2]:1
; Function add_fast; {
; Location: REPL[2]:1
vfmadd213sd %xmm2, %xmm1, %xmm0
;}
retl
nopw %cs:(%eax,%eax)
;}
fast
flag:
julia> iee(x,y,z) = x*y + z
iee (generic function with 1 method)
julia> fast(x,y,z) = @fastmath x*y + z
fast (generic function with 1 method)
julia> @code_native iee(2.,3.,1.)
.section __TEXT,__text,regular,pure_instructions
; Function iee {
; Location: REPL[1]:1
; Function +; {
; Location: REPL[1]:1
vfmadd213sd %xmm2, %xmm1, %xmm0
;}
retl
nopw %cs:(%eax,%eax)
;}
julia> @code_native fast(2.,3.,1.)
.section __TEXT,__text,regular,pure_instructions
; Function fast {
; Location: REPL[2]:1
; Function add_fast; {
; Location: REPL[2]:1
vfmadd213sd %xmm2, %xmm1, %xmm0
;}
retl
nopw %cs:(%eax,%eax)
;}
ieee
flag:
julia> iee(x,y,z) = x*y + z
iee (generic function with 1 method)
julia> fast(x,y,z) = @fastmath x*y + z
fast (generic function with 1 method)
julia> @code_native iee(2.,3.,1.)
.section __TEXT,__text,regular,pure_instructions
; Function iee {
; Location: REPL[1]:1
; Function *; {
; Location: REPL[1]:1
vmulsd %xmm1, %xmm0, %xmm0
;}
; Function +; {
; Location: float.jl:395
vaddsd %xmm2, %xmm0, %xmm0
;}
retl
nopl (%eax)
;}
julia> @code_native fast(2.,3.,1.)
.section __TEXT,__text,regular,pure_instructions
; Function fast {
; Location: REPL[2]:1
; Function mul_fast; {
; Location: REPL[2]:1
vmulsd %xmm1, %xmm0, %xmm0
;}
; Function add_fast; {
; Location: fastmath.jl:161
vaddsd %xmm2, %xmm0, %xmm0
;}
retl
nopl (%eax)
;}