Skip to content

Commit bedbc4d

Browse files
authored
asm! (#254)
1 parent c1c7251 commit bedbc4d

File tree

11 files changed

+1134
-85
lines changed

11 files changed

+1134
-85
lines changed

Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rustc_codegen_spirv/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use-compiled-tools = ["spirv-tools/use-compiled-tools"]
2828

2929
[dependencies]
3030
bimap = "0.5"
31-
rspirv = { git = "https://github.com/gfx-rs/rspirv.git", rev = "f11f8797bd4df2d1d22cf10767b39a5119c57551" }
31+
rspirv = { git = "https://github.com/gfx-rs/rspirv.git", rev = "01ca0d2e5b667a0e4ff1bc1804511e38f9a08759" }
3232
spirv-tools = { version = "0.1.0", default-features = false }
3333
tar = "0.4.30"
3434
topological-sort = "0.1"

crates/rustc_codegen_spirv/src/builder/mod.rs

+4-27
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
mod builder_methods;
22
mod ext_inst;
33
mod intrinsics;
4+
mod spirv_asm;
45

56
pub use ext_inst::ExtInst;
7+
pub use spirv_asm::InstructionTable;
68

79
use crate::abi::ConvSpirvType;
810
use crate::builder_spirv::{BuilderCursor, SpirvValue, SpirvValueExt};
911
use crate::codegen_cx::CodegenCx;
1012
use crate::spirv_type::SpirvType;
1113
use rspirv::spirv::{StorageClass, Word};
12-
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
1314
use rustc_codegen_ssa::mir::operand::OperandValue;
1415
use rustc_codegen_ssa::mir::place::PlaceRef;
1516
use rustc_codegen_ssa::traits::{
16-
AbiBuilderMethods, ArgAbiMethods, AsmBuilderMethods, BackendTypes, BuilderMethods,
17-
CoverageInfoBuilderMethods, DebugInfoBuilderMethods, HasCodegen, InlineAsmOperandRef,
18-
StaticBuilderMethods,
17+
AbiBuilderMethods, ArgAbiMethods, BackendTypes, BuilderMethods, CoverageInfoBuilderMethods,
18+
DebugInfoBuilderMethods, HasCodegen, StaticBuilderMethods,
1919
};
2020
use rustc_errors::DiagnosticBuilder;
21-
use rustc_hir::LlvmInlineAsmInner;
2221
use rustc_middle::mir::coverage::{
2322
CodeRegion, CounterValueReference, ExpressionOperandId, InjectedExpressionId, Op,
2423
};
@@ -343,28 +342,6 @@ impl<'a, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'tcx> {
343342
}
344343
}
345344

346-
impl<'a, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'tcx> {
347-
fn codegen_llvm_inline_asm(
348-
&mut self,
349-
_ia: &LlvmInlineAsmInner,
350-
_outputs: Vec<PlaceRef<'tcx, Self::Value>>,
351-
_inputs: Vec<Self::Value>,
352-
_span: Span,
353-
) -> bool {
354-
self.err("LLVM asm not supported");
355-
true
356-
}
357-
358-
fn codegen_inline_asm(
359-
&mut self,
360-
_template: &[InlineAsmTemplatePiece],
361-
_operands: &[InlineAsmOperandRef<'tcx, Self>],
362-
_options: InlineAsmOptions,
363-
_line_spans: &[Span],
364-
) {
365-
self.err("asm not supported")
366-
}
367-
}
368345
impl<'a, 'tcx> StaticBuilderMethods for Builder<'a, 'tcx> {
369346
fn get_static(&mut self, def_id: DefId) -> Self::Value {
370347
self.cx.get_static(def_id)

0 commit comments

Comments
 (0)