Skip to content

Commit

Permalink
now's the last time!
Browse files Browse the repository at this point in the history
  • Loading branch information
jumerckx committed Jun 6, 2024
1 parent bd6e79e commit d6e9bcb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions examples/brutus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const intrinsics_to_mlir = Dict([
arg = only(args)
mT = IR.type(arg)
T = IR.julia_type(mT)
ones = IR.result(push!(
block, arith.constant(; value=typemax(UInt64) % T, result=mT, location)
))
ones = IR.result(
push!(block, arith.constant(; value=typemax(UInt64) % T, result=mT, location)),
)
return push!(block, arith.xori(arg, ones; location))
end,
])
Expand Down Expand Up @@ -251,11 +251,13 @@ macro code_mlir(call)
@assert Meta.isexpr(call, :call) "only calls are supported"

f = esc(first(call.args))
args = esc(Expr(
:curly,
Tuple,
map(arg -> :($(Core.Typeof)($arg)), call.args[(begin + 1):end])...,
))
args = esc(
Expr(
:curly,
Tuple,
map(arg -> :($(Core.Typeof)($arg)), call.args[(begin + 1):end])...,
),
)

quote
code_mlir($f, $args)
Expand Down

0 comments on commit d6e9bcb

Please sign in to comment.