Goose  Artifact [8da648f0ce]

Artifact 8da648f0ce340d6212445488aaa6627657fd8f8033a659bebf72c02acbc4a804:

  • File tests/g0/codegen/bitwiseops.ll — part of check-in [51f288ba2a] at 2021-09-13 21:52:06 on branch trunk —
    • Implemented a generic wrapper for the simple native types that can be embedded in Terms
    • Added more specific overloads for the assignment operator that should work only on builtin types, so that library and user defined types will be able to choose whether they're copyable
    • The EIR representation for all builtin runtime types are now prefixed with "rt_type" to more easily write generic matching rules against them
    • EIR: Fixed long standing bugs in Enumerate and Decompose that surfaced because of the above
    • Miscellaneous code cleaning
    (user: achavasse size: 2645)

; ModuleID = 'bitwise ops test'
source_filename = "bitwise ops test"

define void @main(i8 %0, i8 %1, i16 %2, i16 %3) {
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  store i8 %0, i8* %5, align 1
  store i8 %1, i8* %6, align 1
  store i16 %2, i16* %7, align 2
  store i16 %3, i16* %8, align 2
  %9 = load i8, i8* %5, align 1
  %10 = load i8, i8* %6, align 1
  %11 = call i8 @"_2_3s2:g0s3#1f#s6:lomarf_5Vo_3ti0_6up_5Vo_3ti0_5T_2RPps7:integer_2i8i0_2q_2_5Vr_5Vo_3ti0_5T_2RPp$3_2i8i0hs1:_n_5Vr_5Vo_3ti0_5T_2RPp$3_2i8i0h$4nPi0"(i8 %9, i8 %10)
  %12 = load i16, i16* %8, align 2
  %13 = call i16 @"_2_3s2:g0s3#1f#s6:lomarf_5Vo_3ti0_6up_5Vo_3ti0_5T_2RPps7:integer_2i10i1_2q_2_5Vr_5Vo_3ti0_5T_2RPp$3_2i10i1hs1:_n_5Vr_5Vo_3ti0_5T_2RPp$3_2i10i1h$4nPi0"(i16 219, i16 %12)
  %14 = load i16, i16* %8, align 2
  %15 = call i16 @"_2_3s2:g0s3#1f#s6:lomarf_5Vo_3ti0_6up_5Vo_3ti0_5T_2RPps7:integer_2i10i1_2q_2_5Vr_5Vo_3ti0_5T_2RPp$3_2i10i1hs1:_n_5Vr_5Vo_3ti0_5T_2RPp$3_2i10i1h$4nPi0"(i16 %14, i16 69)
  %16 = load i8, i8* %5, align 1
  %17 = load i8, i8* %6, align 1
  %18 = xor i8 %16, %17
  %19 = load i16, i16* %7, align 2
  %20 = load i16, i16* %8, align 2
  %21 = xor i16 %19, %20
  %22 = load i16, i16* %7, align 2
  %23 = xor i16 %22, 1337
  %24 = load i16, i16* %7, align 2
  %25 = xor i16 1337, %24
  %26 = load i16, i16* %8, align 2
  %27 = xor i16 %26, -1
  %28 = load i8, i8* %5, align 1
  %29 = load i8, i8* %6, align 1
  %30 = or i8 %28, %29
  %31 = load i8, i8* %5, align 1
  %32 = load i8, i8* %6, align 1
  %33 = and i8 %31, %32
  %34 = load i8, i8* %5, align 1
  %35 = shl i8 %34, 4
  %36 = load i8, i8* %5, align 1
  %37 = lshr i8 %36, 4
  %38 = load i16, i16* %7, align 2
  %39 = shl i16 %38, 4
  %40 = load i16, i16* %7, align 2
  %41 = ashr i16 %40, 4
  ret void
}

define private i8 @"_2_3s2:g0s3#1f#s6:lomarf_5Vo_3ti0_6up_5Vo_3ti0_5T_2RPps7:integer_2i8i0_2q_2_5Vr_5Vo_3ti0_5T_2RPp$3_2i8i0hs1:_n_5Vr_5Vo_3ti0_5T_2RPp$3_2i8i0h$4nPi0"(i8 %0, i8 %1) {
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  store i8 %0, i8* %3, align 1
  store i8 %1, i8* %4, align 1
  %5 = load i8, i8* %3, align 1
  %6 = load i8, i8* %4, align 1
  %7 = xor i8 %5, %6
  ret i8 %7
}

define private i16 @"_2_3s2:g0s3#1f#s6:lomarf_5Vo_3ti0_6up_5Vo_3ti0_5T_2RPps7:integer_2i10i1_2q_2_5Vr_5Vo_3ti0_5T_2RPp$3_2i10i1hs1:_n_5Vr_5Vo_3ti0_5T_2RPp$3_2i10i1h$4nPi0"(i16 %0, i16 %1) {
  %3 = alloca i16, align 2
  %4 = alloca i16, align 2
  store i16 %0, i16* %3, align 2
  store i16 %1, i16* %4, align 2
  %5 = load i16, i16* %3, align 2
  %6 = load i16, i16* %4, align 2
  %7 = xor i16 %5, %6
  ret i16 %7
}