From e7c0521c9a2d0533c302f40f00f2466454ab7fad Mon Sep 17 00:00:00 2001 From: tsai Date: Sun, 6 Oct 2024 20:42:11 +0800 Subject: [PATCH] use Charms.Intrinsic --- lib/charms/env.ex | 3 ++- lib/charms/prelude.ex | 3 ++- lib/charms/term.ex | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/charms/env.ex b/lib/charms/env.ex index cece8d7..e090cdf 100644 --- a/lib/charms/env.ex +++ b/lib/charms/env.ex @@ -1,6 +1,7 @@ defmodule Charms.Env do - use Beaver + use Charms.Intrinsic + @impl true def handle_intrinsic(:t, [], opts) do Beaver.ENIF.Type.env(opts) end diff --git a/lib/charms/prelude.ex b/lib/charms/prelude.ex index 8b349da..125a0e2 100644 --- a/lib/charms/prelude.ex +++ b/lib/charms/prelude.ex @@ -1,5 +1,5 @@ defmodule Charms.Prelude do - use Beaver + use Charms.Intrinsic alias Beaver.MLIR.Dialect.{Arith, Func} @enif_functions Beaver.ENIF.functions() @binary_ops [:!=, :-, :+, :<, :>, :<=, :>=, :==, :&&, :*] @@ -31,6 +31,7 @@ defmodule Charms.Prelude do v end + @impl true def handle_intrinsic(:result_at, [%MLIR.Value{} = v, i], _opts) when is_integer(i) do v end diff --git a/lib/charms/term.ex b/lib/charms/term.ex index 90ffe1c..eaf12d9 100644 --- a/lib/charms/term.ex +++ b/lib/charms/term.ex @@ -1,6 +1,7 @@ defmodule Charms.Term do - use Beaver + use Charms.Intrinsic + @impl true def handle_intrinsic(:t, [], opts) do Beaver.ENIF.Type.term(opts) end