Skip to content

Commit

Permalink
Builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
willtebbutt committed Dec 10, 2024
1 parent cdcf983 commit e52859b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/rrules/builtins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,11 @@ function generate_hand_written_rrule!!_test_cases(rng_ctor, ::Val{:builtins})

# Core.Intrinsics:
(false, :stability, nothing, IntrinsicsWrappers.abs_float, 5.0),
(false, :stability, nothing, IntrinsicsWrappers.abs_float, 5f0),
(false, :stability, nothing, IntrinsicsWrappers.add_float, 4.0, 5.0),
(false, :stability, nothing, IntrinsicsWrappers.add_float, 4f0, 5f0),
(false, :stability, nothing, IntrinsicsWrappers.add_float_fast, 4.0, 5.0),
(false, :stability, nothing, IntrinsicsWrappers.add_float_fast, 4f0, 5f0),
(false, :stability, nothing, IntrinsicsWrappers.add_int, 1, 2),
(false, :stability, nothing, IntrinsicsWrappers.and_int, 2, 3),
(
Expand Down Expand Up @@ -793,28 +796,40 @@ function generate_hand_written_rrule!!_test_cases(rng_ctor, ::Val{:builtins})
(false, :stability, nothing, IntrinsicsWrappers.checked_usub_int, 5, 4),
(false, :stability, nothing, IntrinsicsWrappers.copysign_float, 5.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.copysign_float, 5.0, -3.0),
(false, :stability, nothing, IntrinsicsWrappers.copysign_float, 5f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.copysign_float, 5f0, -3f0),
(false, :stability, nothing, IntrinsicsWrappers.ctlz_int, 5),
(false, :stability, nothing, IntrinsicsWrappers.ctpop_int, 5),
(false, :stability, nothing, IntrinsicsWrappers.cttz_int, 5),
(false, :stability, nothing, IntrinsicsWrappers.div_float, 5.0, 3.0),
(false, :stability, nothing, IntrinsicsWrappers.div_float_fast, 5.0, 3.0),
(false, :stability, nothing, IntrinsicsWrappers.div_float, 5f0, 3f0),
(false, :stability, nothing, IntrinsicsWrappers.div_float_fast, 5f0, 3f0),
(false, :stability, nothing, IntrinsicsWrappers.eq_float, 5.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.eq_float, 4.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.eq_float, 5f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.eq_float, 4f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.eq_float_fast, 5.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.eq_float_fast, 4.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.eq_float_fast, 5f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.eq_float_fast, 4f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.eq_int, 5, 4),
(false, :stability, nothing, IntrinsicsWrappers.eq_int, 4, 4),
(false, :stability, nothing, IntrinsicsWrappers.flipsign_int, 4, -3),
(false, :stability, nothing, IntrinsicsWrappers.floor_llvm, 4.1),
(false, :stability, nothing, IntrinsicsWrappers.fma_float, 5.0, 4.0, 3.0),
(false, :stability, nothing, IntrinsicsWrappers.fma_float, 5f0, 4f0, 3f0),
(true, :stability_and_allocs, nothing, IntrinsicsWrappers.fpext, Float64, 5.0f0),
(false, :stability, nothing, IntrinsicsWrappers.fpiseq, 4.1, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.fpiseq, 4f1, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.fptosi, UInt32, 4.1),
(false, :stability, nothing, IntrinsicsWrappers.fptoui, Int32, 4.1),
(true, :stability, nothing, IntrinsicsWrappers.fptrunc, Float32, 5.0),
(true, :stability, nothing, IntrinsicsWrappers.have_fma, Float64),
(false, :stability, nothing, IntrinsicsWrappers.le_float, 4.1, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.le_float, 4f1, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.le_float_fast, 4.1, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.le_float_fast, 4f1, 4f0),
# llvm_call -- NEEDS IMPLEMENTING AND TESTING
(
false,
Expand All @@ -825,17 +840,26 @@ function generate_hand_written_rrule!!_test_cases(rng_ctor, ::Val{:builtins})
0x0000000000000018,
),
(false, :stability, nothing, IntrinsicsWrappers.lt_float, 4.1, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.lt_float, 4f1, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.lt_float_fast, 4.1, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.lt_float_fast, 4f1, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.mul_float, 5.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.mul_float, 5f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.mul_float_fast, 5.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.mul_float_fast, 5f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.mul_int, 5, 4),
(false, :stability, nothing, IntrinsicsWrappers.muladd_float, 5.0, 4.0, 3.0),
(false, :stability, nothing, IntrinsicsWrappers.muladd_float, 5f0, 4f0, 3f0),
(false, :stability, nothing, IntrinsicsWrappers.ne_float, 5.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.ne_float, 5f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.ne_float_fast, 5.0, 4.0),
(false, :stability, nothing, IntrinsicsWrappers.ne_float_fast, 5f0, 4f0),
(false, :stability, nothing, IntrinsicsWrappers.ne_int, 5, 4),
(false, :stability, nothing, IntrinsicsWrappers.ne_int, 5, 5),
(false, :stability, nothing, IntrinsicsWrappers.neg_float, 5.0),
(false, :stability, nothing, IntrinsicsWrappers.neg_float, 5f0),
(false, :stability, nothing, IntrinsicsWrappers.neg_float_fast, 5.0),
(false, :stability, nothing, IntrinsicsWrappers.neg_float_fast, 5f0),
(false, :stability, nothing, IntrinsicsWrappers.neg_int, 5),
(false, :stability, nothing, IntrinsicsWrappers.not_int, 5),
(false, :stability, nothing, IntrinsicsWrappers.or_int, 5, 5),
Expand Down Expand Up @@ -869,10 +893,14 @@ function generate_hand_written_rrule!!_test_cases(rng_ctor, ::Val{:builtins})
(false, :stability, nothing, IntrinsicsWrappers.sle_int, 5, 4),
(false, :stability, nothing, IntrinsicsWrappers.slt_int, 4, 5),
(false, :stability, nothing, IntrinsicsWrappers.sqrt_llvm, 5.0),
(false, :stability, nothing, IntrinsicsWrappers.sqrt_llvm, 5f0),
(false, :stability, nothing, IntrinsicsWrappers.sqrt_llvm_fast, 5.0),
(false, :stability, nothing, IntrinsicsWrappers.sqrt_llvm_fast, 5f0),
(false, :stability, nothing, IntrinsicsWrappers.srem_int, 4, 1),
(false, :stability, nothing, IntrinsicsWrappers.sub_float, 4.0, 1.0),
(false, :stability, nothing, IntrinsicsWrappers.sub_float, 4f0, 1f0),
(false, :stability, nothing, IntrinsicsWrappers.sub_float_fast, 4.0, 1.0),
(false, :stability, nothing, IntrinsicsWrappers.sub_float_fast, 4f0, 1f0),
(false, :stability, nothing, IntrinsicsWrappers.sub_int, 4, 1),
(false, :stability, nothing, IntrinsicsWrappers.trunc_int, UInt8, 78),
(false, :stability, nothing, IntrinsicsWrappers.trunc_llvm, 5.1),
Expand Down

0 comments on commit e52859b

Please sign in to comment.