This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mysum!{T}(F, A::AbstractArray{T}) | |
| for j = 1:size(A,2) | |
| @simd for i = 1:size(A,1) | |
| @inbounds F[i,j] += A[i,j] | |
| end | |
| end | |
| return F | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| make[1]: Leaving directory `/localdisk/adrobiso/tmp/julia/ui' | |
| make[1]: Entering directory `/localdisk/adrobiso/tmp/julia/base' | |
| clang -m64 -E -dM ../usr/include/pcre.h | perl -nle '/^\s*#define\s+PCRE_(\w*)\s*\(?(0x[0-9a-fA-F]+|[-+]?\s*[0-9]+)\)?\s*$/ and print "const $1 = Int32($2)"' | sort > pcre_h.jl | |
| echo '#include "errno.h"' | clang -m64 -E -dM - | perl -nle 'print "const $1 = Int32($2)" if /^#define\s+(E\w+)\s+(\d+)\s*$/' | sort > errno_h.jl | |
| clang -m64 -E -P -DJULIA ../src/file_constants.h | perl -nle 'print "$1 0o$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$/; print "$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$/' > file_constants.jl | |
| clang -m64 -E -P "-I../deps/libuv/include" -DJULIA ../src/uv_constants.h | tail -n 16 > uv_constants.jl | |
| make[1]: Leaving directory `/localdisk/adrobiso/tmp/julia/base' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ make | |
| JULIA usr/lib/julia/sys0.o | |
| exports.jl | |
| base.jl | |
| reflection.jl | |
| build_h.jl | |
| version_git.jl | |
| c.jl | |
| options.jl | |
| promotion.jl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *** IR Dump After Combine redundant instructions *** | |
| ; Function Attrs: sspreq | |
| define %jl_value_t* @julia_unoptimized_42298(%jl_value_t*, %jl_value_t**, i32) #0 { | |
| top: | |
| %3 = load %jl_value_t** %1, align 8, !dbg !15 | |
| %4 = getelementptr %jl_value_t** %1, i64 1, !dbg !15 | |
| %5 = load %jl_value_t** %4, align 8, !dbg !15 | |
| %6 = getelementptr inbounds %jl_value_t* %5, i64 4, i32 0, !dbg !16 | |
| %7 = load %jl_value_t** %6, align 8, !dbg !16, !tbaa %jtbaa_arraysize | |
| %8 = ptrtoint %jl_value_t* %7 to i64, !dbg !16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ clang -v | |
| clang version 3.7.0 (trunk 227196) | |
| Target: x86_64-unknown-linux-gnu | |
| Thread model: posix | |
| Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/4.8.2 | |
| Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2 | |
| Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2 | |
| Candidate multilib: .;@m64 | |
| Candidate multilib: 32;@m32 | |
| Selected multilib: .;@m64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cat truncloop.jl | |
| # use floating point AND instructions (andps/andpd) | |
| # https://github.com/JuliaLang/julia/issues/9868 | |
| function and_float(x::Float64,y::Float64) | |
| Base.llvmcall("""%av = insertelement<2 x double> undef, double %0, i32 0 | |
| %bv = insertelement<2 x double> undef, double %1, i32 0 | |
| %ai = bitcast <2 x double> %av to <2 x i64> | |
| %bi = bitcast <2 x double> %bv to <2 x i64> | |
| %and.i = and <2 x i64> %ai, %bi | |
| %cf = bitcast <2 x i64> %and.i to <2 x double> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| julia> ind4=CartesianIndex((1,1,1,1)) | |
| Base.IteratorsMD.CartesianIndex_4(1,1,1,1) | |
| julia> @code_llvm(mymul(ind4,N,1)) | |
| define %CartesianIndex_4 @julia_mymul_43376(%CartesianIndex_4, i64, i64) { | |
| top: | |
| %3 = icmp slt i64 %1, 2, !dbg !8 | |
| br i1 %3, label %L3, label %L.preheader, !dbg !8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| julia> function f(x,y,z) | |
| @fastmath @inbounds @simd for i=1:length(z) | |
| z[i] = sqrt(x[i]^2+y[i]^2) | |
| end | |
| end | |
| f (generic function with 1 method) | |
| julia> code_native(f,(Vector{Float32},Vector{Float32},Vector{Float32})) | |
| .text | |
| Filename: none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cat toivoh.jl | |
| module TestSLP | |
| function rmw!{T}(dest::Ptr{T}, src::Ptr{T}) | |
| s1 = unsafe_load(src, 1) | |
| s2 = unsafe_load(src, 2) | |
| d1 = unsafe_load(dest, 1) | |
| d2 = unsafe_load(dest, 2) | |
| d1 $= s1 | |
| d2 $= s2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ for f in *.jl; do echo $f; mpiexec -np 4 julia $f; done | |
| 01-hello.jl | |
| Hello world, I am 1 of 4Hello world, I am 3 of 4Hello world, I am 2 of 4Hello world, I am 0 of 4 | |
| 02-broadcast.jl | |
| ------------------------------------------------------------------------------ | |
| Running on 4 processes | |
| ------------------------------------------------------------------------------ |