case ir_unop_f2b: result = nir_f2b(&b, srcs[0]); break;
case ir_unop_i2b: result = nir_i2b(&b, srcs[0]); break;
case ir_unop_b2i: result = nir_b2i(&b, srcs[0]); break;
+ case ir_unop_b2i64:result = nir_b2i64(&b, srcs[0]); break;
case ir_unop_d2f: result = nir_d2f(&b, srcs[0]); break;
case ir_unop_f2d: result = nir_f2d(&b, srcs[0]); break;
case ir_unop_d2i: result = nir_d2i(&b, srcs[0]); break;
assert(supports_ints);
result = nir_u2d(&b, srcs[0]);
break;
+ case ir_unop_i642i: result = nir_i2i32(&b, srcs[0]); break;
+ case ir_unop_i642u: result = nir_i2u32(&b, srcs[0]); break;
+ case ir_unop_i642f: result = nir_i642f(&b, srcs[0]); break;
+ case ir_unop_i642d: result = nir_i642d(&b, srcs[0]); break;
+
+ case ir_unop_u642i: result = nir_u2i32(&b, srcs[0]); break;
+ case ir_unop_u642u: result = nir_u2u32(&b, srcs[0]); break;
+ case ir_unop_u642f: result = nir_u642f(&b, srcs[0]); break;
+ case ir_unop_u642d: result = nir_u642d(&b, srcs[0]); break;
+
+ case ir_unop_i2i64: result = nir_i2i64(&b, srcs[0]); break;
+ case ir_unop_u2i64: result = nir_u2i64(&b, srcs[0]); break;
+ case ir_unop_f2i64:
+ case ir_unop_d2i64:
+ result = nir_f2i64(&b, srcs[0]);
+ break;
+ case ir_unop_i2u64: result = nir_i2u64(&b, srcs[0]); break;
+ case ir_unop_u2u64: result = nir_u2u64(&b, srcs[0]); break;
+ case ir_unop_f2u64:
+ case ir_unop_d2u64:
+ result = nir_f2u64(&b, srcs[0]);
+ break;
case ir_unop_i2u:
case ir_unop_u2i:
+ case ir_unop_i642u64:
+ case ir_unop_u642i64:
case ir_unop_bitcast_i2f:
case ir_unop_bitcast_f2i:
case ir_unop_bitcast_u2f:
case ir_unop_bitcast_f2u:
+ case ir_unop_bitcast_i642d:
+ case ir_unop_bitcast_d2i64:
+ case ir_unop_bitcast_u642d:
+ case ir_unop_bitcast_d2u64:
case ir_unop_subroutine_to_int:
/* no-op */
result = nir_imov(&b, srcs[0]);
case ir_unop_unpack_double_2x32:
result = nir_unpack_double_2x32(&b, srcs[0]);
break;
+ case ir_unop_pack_int_2x32:
+ case ir_unop_pack_uint_2x32:
+ result = nir_pack_int_2x32(&b, srcs[0]);
+ break;
+ case ir_unop_unpack_int_2x32:
+ case ir_unop_unpack_uint_2x32:
+ result = nir_unpack_int_2x32(&b, srcs[0]);
+ break;
case ir_unop_bitfield_reverse:
result = nir_bitfield_reverse(&b, srcs[0]);
break;
tfloat32 = "float32"
tint32 = "int32"
tuint32 = "uint32"
+tint64 = "int64"
tuint64 = "uint64"
tfloat64 = "float64"
unop_convert("d2u", tuint32, tfloat64, "src0") # Double-to-unsigned conversion.
unop_convert("i2f", tfloat32, tint32, "src0") # Integer-to-float conversion.
unop_convert("i2d", tfloat64, tint32, "src0") # Integer-to-double conversion.
+unop_convert("i2i32", tint32, tint, "src0") # General int (int8_t, int64_t, etc.) to int32_t conversion
+unop_convert("u2i32", tint32, tuint, "src0") # General uint (uint8_t, uint64_t, etc.) to int32_t conversion
+unop_convert("i2u32", tuint32, tint, "src0") # General int (int8_t, int64_t, etc.) to uint32_t conversion
+unop_convert("u2u32", tuint32, tuint, "src0") # General uint (uint8_t, uint64_t, etc.) to uint32_t conversion
+unop_convert("i2i64", tint64, tint, "src0") # General int (int8_t, int32_t, etc.) to int64_t conversion
+unop_convert("u2i64", tint64, tuint, "src0") # General uint (uint8_t, uint64_t, etc.) to int64_t conversion
+unop_convert("f2i64", tint64, tfloat, "src0") # General float (float or double) to int64_t conversion
+unop_convert("i2u64", tuint64, tint, "src0") # General int (int8_t, int64_t, etc.) to uint64_t conversion
+unop_convert("u2u64", tuint64, tuint, "src0") # General uint (uint8_t, uint32_t, etc.) to uint64_t conversion
+unop_convert("f2u64", tuint64, tfloat, "src0") # General float (float or double) to uint64_t conversion
+unop_convert("i642f", tfloat32, tint64, "src0") # int64_t-to-float conversion.
+unop_convert("i642d", tfloat64, tint64, "src0") # int64_t-to-double conversion.
+unop_convert("u642f", tfloat32, tuint64, "src0") # uint64_t-to-float conversion.
+unop_convert("u642d", tfloat64, tuint64, "src0") # uint64_t-to-double conversion.
+
# Float-to-boolean conversion
unop_convert("f2b", tbool, tfloat32, "src0 != 0.0f")
unop_convert("d2b", tbool, tfloat64, "src0 != 0.0")
# Boolean-to-float conversion
unop_convert("b2f", tfloat32, tbool, "src0 ? 1.0f : 0.0f")
# Int-to-boolean conversion
-unop_convert("i2b", tbool, tint32, "src0 != 0")
+unop_convert("i2b", tbool, tint, "src0 != 0")
unop_convert("b2i", tint32, tbool, "src0 ? 1 : 0") # Boolean-to-int conversion
+unop_convert("b2i64", tint64, tbool, "src0 ? 1 : 0") # Boolean-to-int64_t conversion.
unop_convert("u2f", tfloat32, tuint32, "src0") # Unsigned-to-float conversion.
unop_convert("u2d", tfloat64, tuint32, "src0") # Unsigned-to-double conversion.
# double-to-float conversion
unop_horiz("pack_double_2x32", 1, tuint64, 2, tuint32,
"dst.x = src0.x | ((uint64_t)src0.y << 32);")
+unop_horiz("pack_int_2x32", 1, tint64, 2, tint32,
+ "dst.x = src0.x | ((int64_t)src0.y << 32);")
+
unop_horiz("unpack_double_2x32", 2, tuint32, 1, tuint64,
"dst.x = src0.x; dst.y = src0.x >> 32;")
+unop_horiz("unpack_int_2x32", 2, tint32, 1, tint64,
+ "dst.x = src0.x; dst.y = src0.x >> 32;")
+
# Lowered floating point unpacking operations.
unop_convert("unpack_double_2x32_split_x", tuint32, tuint64, "src0")
unop_convert("unpack_double_2x32_split_y", tuint32, tuint64, "src0 >> 32")
+unop_convert("unpack_int_2x32_split_x", tuint32, tuint64, "src0")
+unop_convert("unpack_int_2x32_split_y", tuint32, tuint64, "src0 >> 32")
# Bit operations, part of ARB_gpu_shader5.
binop_convert("pack_double_2x32_split", tuint64, tuint32, "",
"src0 | ((uint64_t)src1 << 32)")
+binop_convert("pack_int_2x32_split", tuint64, tuint32, "",
+ "src0 | ((uint64_t)src1 << 32)")
+
# bfm implements the behavior of the first operation of the SM5 "bfi" assembly
# and that of the "bfi1" i965 instruction. That is, it has undefined behavior
# if either of its arguments are 32.