Skip to content

Commit

Permalink
add some llvm intrinsics (#331)
Browse files Browse the repository at this point in the history
Btw i found out about the ods, its pretty neat!

Although i haven't found these intrinsics in the ods.
  • Loading branch information
edg-l authored Sep 29, 2023
1 parent cdee88c commit 6984569
Show file tree
Hide file tree
Showing 8 changed files with 496 additions and 1 deletion.
420 changes: 419 additions & 1 deletion melior/src/dialect/llvm.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: melior/src/dialect/llvm.rs
expression: module.as_operation()
---
module attributes {llvm.data_layout = ""} {
llvm.func @foo(%arg0: i64) -> i64 {
%0 = "llvm.intr.abs"(%arg0) <{is_int_min_poison = true}> : (i64) -> i64
llvm.return %0 : i64
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: melior/src/dialect/llvm.rs
expression: module.as_operation()
---
module attributes {llvm.data_layout = ""} {
llvm.func @foo(%arg0: i64) -> i64 {
%0 = llvm.intr.bitreverse(%arg0) : (i64) -> i64
llvm.return %0 : i64
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: melior/src/dialect/llvm.rs
expression: module.as_operation()
---
module attributes {llvm.data_layout = ""} {
llvm.func @foo(%arg0: i64) -> i64 {
%0 = llvm.intr.bswap(%arg0) : (i64) -> i64
llvm.return %0 : i64
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: melior/src/dialect/llvm.rs
expression: module.as_operation()
---
module attributes {llvm.data_layout = ""} {
llvm.func @foo(%arg0: i64) -> i64 {
%0 = "llvm.intr.ctlz"(%arg0) <{is_zero_poison = true}> : (i64) -> i64
llvm.return %0 : i64
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: melior/src/dialect/llvm.rs
expression: module.as_operation()
---
module attributes {llvm.data_layout = ""} {
llvm.func @foo(%arg0: i64) -> i64 {
%0 = llvm.intr.ctpop(%arg0) : (i64) -> i64
llvm.return %0 : i64
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: melior/src/dialect/llvm.rs
expression: module.as_operation()
---
module attributes {llvm.data_layout = ""} {
llvm.func @foo(%arg0: i64) -> i64 {
%0 = "llvm.intr.cttz"(%arg0) <{is_zero_poison = true}> : (i64) -> i64
llvm.return %0 : i64
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: melior/src/dialect/llvm.rs
expression: module.as_operation()
---
module attributes {llvm.data_layout = ""} {
llvm.func @foo(%arg0: i64) -> i128 {
%0 = llvm.zext %arg0 : i64 to i128
llvm.return %0 : i128
}
}

0 comments on commit 6984569

Please sign in to comment.