Skip to content

Commit

Permalink
asm! (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
khyperia authored Nov 18, 2020
1 parent c1c7251 commit bedbc4d
Show file tree
Hide file tree
Showing 11 changed files with 1,134 additions and 85 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use-compiled-tools = ["spirv-tools/use-compiled-tools"]

[dependencies]
bimap = "0.5"
rspirv = { git = "https://github.com/gfx-rs/rspirv.git", rev = "f11f8797bd4df2d1d22cf10767b39a5119c57551" }
rspirv = { git = "https://github.com/gfx-rs/rspirv.git", rev = "01ca0d2e5b667a0e4ff1bc1804511e38f9a08759" }
spirv-tools = { version = "0.1.0", default-features = false }
tar = "0.4.30"
topological-sort = "0.1"
Expand Down
31 changes: 4 additions & 27 deletions crates/rustc_codegen_spirv/src/builder/mod.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
mod builder_methods;
mod ext_inst;
mod intrinsics;
mod spirv_asm;

pub use ext_inst::ExtInst;
pub use spirv_asm::InstructionTable;

use crate::abi::ConvSpirvType;
use crate::builder_spirv::{BuilderCursor, SpirvValue, SpirvValueExt};
use crate::codegen_cx::CodegenCx;
use crate::spirv_type::SpirvType;
use rspirv::spirv::{StorageClass, Word};
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_codegen_ssa::mir::operand::OperandValue;
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::{
AbiBuilderMethods, ArgAbiMethods, AsmBuilderMethods, BackendTypes, BuilderMethods,
CoverageInfoBuilderMethods, DebugInfoBuilderMethods, HasCodegen, InlineAsmOperandRef,
StaticBuilderMethods,
AbiBuilderMethods, ArgAbiMethods, BackendTypes, BuilderMethods, CoverageInfoBuilderMethods,
DebugInfoBuilderMethods, HasCodegen, StaticBuilderMethods,
};
use rustc_errors::DiagnosticBuilder;
use rustc_hir::LlvmInlineAsmInner;
use rustc_middle::mir::coverage::{
CodeRegion, CounterValueReference, ExpressionOperandId, InjectedExpressionId, Op,
};
Expand Down Expand Up @@ -343,28 +342,6 @@ impl<'a, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'tcx> {
}
}

impl<'a, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'tcx> {
fn codegen_llvm_inline_asm(
&mut self,
_ia: &LlvmInlineAsmInner,
_outputs: Vec<PlaceRef<'tcx, Self::Value>>,
_inputs: Vec<Self::Value>,
_span: Span,
) -> bool {
self.err("LLVM asm not supported");
true
}

fn codegen_inline_asm(
&mut self,
_template: &[InlineAsmTemplatePiece],
_operands: &[InlineAsmOperandRef<'tcx, Self>],
_options: InlineAsmOptions,
_line_spans: &[Span],
) {
self.err("asm not supported")
}
}
impl<'a, 'tcx> StaticBuilderMethods for Builder<'a, 'tcx> {
fn get_static(&mut self, def_id: DefId) -> Self::Value {
self.cx.get_static(def_id)
Expand Down
Loading

0 comments on commit bedbc4d

Please sign in to comment.