rustup: update to nightly-2022-04-11.

This commit is contained in:
Eduard-Mihai Burtescu 2022-04-11 19:23:31 +00:00 committed by Eduard-Mihai Burtescu
parent 3e04f62ede
commit e08d0d6a48
18 changed files with 87 additions and 62 deletions

View File

@ -408,7 +408,7 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> {
// Note: We can't use auto_struct_layout here because the spirv types here might be undefined due to
// recursive pointer types.
let a_offset = Size::ZERO;
let b_offset = a.value.size(cx).align_to(b.value.align(cx).abi);
let b_offset = a.primitive().size(cx).align_to(b.primitive().align(cx).abi);
let a = trans_scalar(cx, span, *self, a, a_offset);
let b = trans_scalar(cx, span, *self, b, b_offset);
let size = if self.is_unsized() {
@ -470,7 +470,7 @@ pub fn scalar_pair_element_backend_type<'tcx>(
};
let offset = match index {
0 => Size::ZERO,
1 => a.value.size(cx).align_to(b.value.align(cx).abi),
1 => a.primitive().size(cx).align_to(b.primitive().align(cx).abi),
_ => unreachable!(),
};
trans_scalar(cx, span, ty, [a, b][index], offset)
@ -494,7 +494,7 @@ fn trans_scalar<'tcx>(
return SpirvType::Bool.def(span, cx);
}
match scalar.value {
match scalar.primitive() {
Primitive::Int(width, signedness) => {
SpirvType::Integer(width.size().bits() as u32, signedness).def(span, cx)
}

View File

@ -918,7 +918,10 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
);
OperandValue::Immediate(self.to_immediate(llval, place.layout))
} else if let Abi::ScalarPair(a, b) = place.layout.abi {
let b_offset = a.value.size(self).align_to(b.value.align(self).abi);
let b_offset = a
.primitive()
.size(self)
.align_to(b.primitive().align(self).abi);
let pair_ty = place.layout.spirv_type(self.span(), self);
let mut load = |i, scalar: Scalar, align| {

View File

@ -20,6 +20,11 @@ impl<'tcx> CodegenCx<'tcx> {
self.builder.def_constant(ty, SpirvConst::U32(val as u32))
}
pub fn constant_i16(&self, span: Span, val: i16) -> SpirvValue {
let ty = SpirvType::Integer(16, true).def(span, self);
self.builder.def_constant(ty, SpirvConst::U32(val as u32))
}
pub fn constant_u16(&self, span: Span, val: u16) -> SpirvValue {
let ty = SpirvType::Integer(16, false).def(span, self);
self.builder.def_constant(ty, SpirvConst::U32(val as u32))
@ -139,6 +144,9 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
fn const_bool(&self, val: bool) -> Self::Value {
self.constant_bool(DUMMY_SP, val)
}
fn const_i16(&self, i: i16) -> Self::Value {
self.constant_i16(DUMMY_SP, i)
}
fn const_i32(&self, i: i32) -> Self::Value {
self.constant_i32(DUMMY_SP, i)
}
@ -213,10 +221,10 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
) -> Self::Value {
match scalar {
Scalar::Int(int) => {
assert_eq!(int.size(), layout.value.size(self));
assert_eq!(int.size(), layout.primitive().size(self));
let data = int.to_bits(int.size()).unwrap();
match layout.value {
match layout.primitive() {
Primitive::Int(int_size, int_signedness) => match self.lookup_type(ty) {
SpirvType::Integer(width, spirv_signedness) => {
assert_eq!(width as u64, int_size.size().bits());
@ -297,7 +305,7 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
// let offset = self.constant_u64(ptr.offset.bytes());
// self.gep(base_addr, once(offset))
};
if layout.value != Primitive::Pointer {
if layout.primitive() != Primitive::Pointer {
self.tcx
.sess
.fatal("Non-pointer-typed scalar_to_backend Scalar::Ptr not supported");
@ -347,7 +355,7 @@ impl<'tcx> CodegenCx<'tcx> {
pub fn primitive_to_scalar(&self, value: Primitive) -> abi::Scalar {
let bits = value.size(self.data_layout()).bits();
assert!(bits <= 128);
abi::Scalar {
abi::Scalar::Initialized {
value,
valid_range: abi::WrappingRange {
start: 0,

View File

@ -224,7 +224,7 @@ fn is_blocklisted_fn<'tcx>(
return true;
}
if tcx.opt_item_name(def.did).map(|i| i.name) == Some(sym.fmt_decimal) {
if tcx.opt_item_ident(def.did).map(|i| i.name) == Some(sym.fmt_decimal) {
if let Some(parent_def_id) = tcx.parent(def.did) {
if is_debug_fmt_method(parent_def_id) {
return true;
@ -308,7 +308,7 @@ impl CodegenBackend for SpirvCodegenBackend {
.cg
.target_cpu
.clone()
.unwrap_or_else(|| tcx.sess.target.cpu.clone()),
.unwrap_or_else(|| tcx.sess.target.cpu.to_string()),
metadata,
need_metadata_module,
))

View File

@ -77,23 +77,23 @@ impl SpirvTarget {
pub fn rustc_target(&self) -> Target {
Target {
llvm_target: self.to_string(),
llvm_target: self.to_string().into(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32:32-i64:64-n8:16:32:64".to_string(),
arch: String::from(ARCH),
data_layout: "e-m:e-p:32:32:32-i64:64-n8:16:32:64".into(),
arch: ARCH.into(),
options: TargetOptions {
simd_types_indirect: false,
allows_weak_linkage: false,
crt_static_allows_dylibs: true,
dll_prefix: "".to_string(),
dll_suffix: ".spv".to_string(),
dll_prefix: "".into(),
dll_suffix: ".spv".into(),
dynamic_linking: true,
emit_debug_gdb_scripts: false,
linker_flavor: LinkerFlavor::Ld,
panic_strategy: PanicStrategy::Abort,
os: "unknown".to_string(),
env: self.env.to_string(),
vendor: self.vendor.clone(),
os: "unknown".into(),
env: self.env.to_string().into(),
vendor: self.vendor.clone().into(),
// TODO: Investigate if main_needs_argc_argv is useful (for building exes)
main_needs_argc_argv: false,
..Default::default()

View File

@ -5,5 +5,5 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
[toolchain]
channel = "nightly-2022-04-01"
channel = "nightly-2022-04-11"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

View File

@ -89,6 +89,16 @@ error[E0277]: the trait bound `{float}: Vector<f32, 2_usize>` is not satisfied
| | the trait `Vector<f32, 2_usize>` is not implemented for `{float}`
| required by a bound introduced by this call
|
= help: the following other types implement trait `Vector<T, N>`:
<BVec2 as Vector<bool, 2_usize>>
<BVec3 as Vector<bool, 3_usize>>
<BVec4 as Vector<bool, 4_usize>>
<DVec2 as Vector<f64, 2_usize>>
<DVec3 as Vector<f64, 3_usize>>
<DVec4 as Vector<f64, 4_usize>>
<IVec2 as Vector<i32, 2_usize>>
<IVec3 as Vector<i32, 3_usize>>
and 9 others
note: required by a bound in `debug_printf_assert_is_vector`
--> $SPIRV_STD_SRC/lib.rs:144:8
|

View File

@ -1,8 +1,8 @@
error: Cannot memcpy dynamically sized data
--> $CORE_SRC/intrinsics.rs:2193:14
--> $CORE_SRC/intrinsics.rs:2210:9
|
2193 | unsafe { copy(src, dst, count) }
| ^^^^^^^^^^^^^^^^^^^^^
2210 | copy(src, dst, count)
| ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -2,7 +2,7 @@
%4 = OpFunctionParameter %5
%6 = OpFunctionParameter %5
%7 = OpLabel
OpLine %8 971 8
OpLine %8 1096 8
%9 = OpLoad %10 %4
OpLine %11 7 13
OpStore %6 %9

View File

@ -2,7 +2,7 @@
%4 = OpFunctionParameter %5
%6 = OpFunctionParameter %5
%7 = OpLabel
OpLine %8 971 8
OpLine %8 1096 8
%9 = OpLoad %10 %4
OpLine %11 7 13
OpStore %6 %9

View File

@ -4,7 +4,7 @@
%7 = OpLabel
OpLine %8 7 35
%9 = OpLoad %10 %4
OpLine %11 1162 8
OpLine %11 1287 8
OpStore %6 %9
OpLine %8 8 1
OpReturn

View File

@ -4,7 +4,7 @@
%7 = OpLabel
OpLine %8 7 37
%9 = OpLoad %10 %4
OpLine %11 1162 8
OpLine %11 1287 8
OpStore %6 %9
OpLine %8 8 1
OpReturn

View File

@ -4,10 +4,10 @@ error[E0277]: the trait bound `Image<f32, 0_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0);
| ^^^^^^ the trait `HasGather` is not implemented for `Image<f32, 0_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>`
|
= help: the following implementations were found:
<Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
<Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
<Image<SampledType, 4_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
= help: the following other types implement trait `HasGather`:
Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
Image<SampledType, 4_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::gather`
--> $SPIRV_STD_SRC/image.rs:164:15
|
@ -20,10 +20,10 @@ error[E0277]: the trait bound `Image<f32, 2_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
16 | let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0);
| ^^^^^^ the trait `HasGather` is not implemented for `Image<f32, 2_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>`
|
= help: the following implementations were found:
<Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
<Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
<Image<SampledType, 4_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
= help: the following other types implement trait `HasGather`:
Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
Image<SampledType, 4_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::gather`
--> $SPIRV_STD_SRC/image.rs:164:15
|

View File

@ -4,11 +4,11 @@ error[E0277]: the trait bound `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
12 | *output = image.query_levels();
| ^^^^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>`
|
= help: the following implementations were found:
<Image<SampledType, 0_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
<Image<SampledType, 1_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
<Image<SampledType, 2_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
<Image<SampledType, 3_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
= help: the following other types implement trait `HasQueryLevels`:
Image<SampledType, 0_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>
Image<SampledType, 1_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>
Image<SampledType, 2_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>
Image<SampledType, 3_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_levels`
--> $SPIRV_STD_SRC/image.rs:821:15
|

View File

@ -4,11 +4,11 @@ error[E0277]: the trait bound `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
13 | *output = image.query_lod(*sampler, glam::Vec2::new(0.0, 1.0));
| ^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>`
|
= help: the following implementations were found:
<Image<SampledType, 0_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
<Image<SampledType, 1_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
<Image<SampledType, 2_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
<Image<SampledType, 3_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
= help: the following other types implement trait `HasQueryLevels`:
Image<SampledType, 0_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>
Image<SampledType, 1_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>
Image<SampledType, 2_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>
Image<SampledType, 3_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_lod`
--> $SPIRV_STD_SRC/image.rs:847:15
|

View File

@ -4,12 +4,16 @@ error[E0277]: the trait bound `Image<f32, 1_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
12 | *output = image.query_size();
| ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image<f32, 1_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>`
|
= help: the following implementations were found:
<Image<SampledType, 0_u32, DEPTH, ARRAYED, 0_u32, 0_u32, FORMAT> as HasQuerySize>
<Image<SampledType, 0_u32, DEPTH, ARRAYED, 0_u32, 2_u32, FORMAT> as HasQuerySize>
<Image<SampledType, 0_u32, DEPTH, ARRAYED, 1_u32, SAMPLED, FORMAT> as HasQuerySize>
<Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, 0_u32, FORMAT> as HasQuerySize>
and 10 others
= help: the following other types implement trait `HasQuerySize`:
Image<SampledType, 0_u32, DEPTH, ARRAYED, 0_u32, 0_u32, FORMAT>
Image<SampledType, 0_u32, DEPTH, ARRAYED, 0_u32, 2_u32, FORMAT>
Image<SampledType, 0_u32, DEPTH, ARRAYED, 1_u32, SAMPLED, FORMAT>
Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, 0_u32, FORMAT>
Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, 2_u32, FORMAT>
Image<SampledType, 1_u32, DEPTH, ARRAYED, 1_u32, SAMPLED, FORMAT>
Image<SampledType, 2_u32, DEPTH, ARRAYED, 0_u32, 0_u32, FORMAT>
Image<SampledType, 2_u32, DEPTH, ARRAYED, 0_u32, 2_u32, FORMAT>
and 6 others
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_size`
--> $SPIRV_STD_SRC/image.rs:878:15
|

View File

@ -4,11 +4,11 @@ error[E0277]: the trait bound `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
12 | *output = image.query_size_lod(0);
| ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>`
|
= help: the following implementations were found:
<Image<SampledType, 0_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasQuerySizeLod>
<Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasQuerySizeLod>
<Image<SampledType, 2_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasQuerySizeLod>
<Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasQuerySizeLod>
= help: the following other types implement trait `HasQuerySizeLod`:
Image<SampledType, 0_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
Image<SampledType, 2_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT>
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::query_size_lod`
--> $SPIRV_STD_SRC/image.rs:911:15
|

View File

@ -4,30 +4,30 @@ OpLine %5 11 11
%6 = OpCompositeInsert %7 %8 %9 0
OpLine %5 11 11
%10 = OpCompositeExtract %11 %6 1
OpLine %12 781 14
OpLine %12 780 14
%13 = OpBitcast %14 %8
OpLine %12 781 8
OpLine %12 780 8
OpSelectionMerge %15 None
OpSwitch %13 %16 0 %17 1 %18
%16 = OpLabel
OpLine %12 781 14
OpLine %12 780 14
OpUnreachable
%17 = OpLabel
OpLine %12 783 20
OpLine %12 782 20
OpBranch %15
%18 = OpLabel
OpLine %12 782 23
OpLine %12 781 23
OpBranch %15
%15 = OpLabel
%19 = OpPhi %20 %21 %17 %22 %18
%23 = OpPhi %11 %24 %17 %10 %18
OpBranch %25
%25 = OpLabel
OpLine %12 785 4
OpLine %12 784 4
OpSelectionMerge %26 None
OpBranchConditional %19 %27 %28
%27 = OpLabel
OpLine %12 785 4
OpLine %12 784 4
OpBranch %26
%28 = OpLabel
OpBranch %26