diff --git a/Cargo.toml b/Cargo.toml index 7f38976..350d568 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,9 +17,9 @@ members = [ "zluda_redirect", "zluda_ml", "ptx", - "gen", - "gen_impl", - "ptx_parser" + "ptx_parser", + "ptx_parser_macros", + "ptx_parser_macros_impl", ] default-members = ["zluda_lib", "zluda_ml", "zluda_inject", "zluda_redirect"] diff --git a/ptx_parser/Cargo.toml b/ptx_parser/Cargo.toml index 35251ee..af3058b 100644 --- a/ptx_parser/Cargo.toml +++ b/ptx_parser/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "ptx_parser" -version = "0.1.0" +version = "0.0.0" +authors = ["Andrzej Janik "] edition = "2021" [dependencies] logos = "0.14" winnow = { version = "0.6.18" } -gen = { path = "../gen" } +ptx_parser_macros = { path = "../ptx_parser_macros" } thiserror = "1.0" bitflags = "1.2" rustc-hash = "2.0.0" diff --git a/ptx_parser/src/ast.rs b/ptx_parser/src/ast.rs index 1eead3c..6cf1264 100644 --- a/ptx_parser/src/ast.rs +++ b/ptx_parser/src/ast.rs @@ -1,11 +1,10 @@ -use std::cmp::Ordering; - use super::{ AtomSemantics, MemScope, RawRoundingMode, RawSetpCompareOp, ScalarType, SetpBoolPostOp, StateSpace, VectorPrefix, }; use crate::{PtxError, PtxParserState}; use bitflags::bitflags; +use std::cmp::Ordering; pub enum Statement { Label(P::Ident), @@ -14,7 +13,7 @@ pub enum Statement { Block(Vec>), } -gen::generate_instruction_type!( +ptx_parser_macros::generate_instruction_type!( pub enum Instruction { Mov { type: { &data.typ }, @@ -1448,5 +1447,5 @@ pub enum DivFloatKind { #[derive(Copy, Clone, Eq, PartialEq)] pub struct FlushToZero { - pub flush_to_zero: bool + pub flush_to_zero: bool, } diff --git a/ptx_parser/src/main.rs b/ptx_parser/src/main.rs index 87b5e93..5db94f2 100644 --- a/ptx_parser/src/main.rs +++ b/ptx_parser/src/main.rs @@ -1,5 +1,5 @@ -use gen::derive_parser; use logos::Logos; +use ptx_parser_macros::derive_parser; use rustc_hash::FxHashMap; use std::fmt::Debug; use std::mem; diff --git a/gen/Cargo.toml b/ptx_parser_macros/Cargo.toml similarity index 54% rename from gen/Cargo.toml rename to ptx_parser_macros/Cargo.toml index e26383d..62a5081 100644 --- a/gen/Cargo.toml +++ b/ptx_parser_macros/Cargo.toml @@ -1,13 +1,14 @@ [package] -name = "gen" -version = "0.1.0" +name = "ptx_parser_macros" +version = "0.0.0" +authors = ["Andrzej Janik "] edition = "2021" [lib] proc-macro = true [dependencies] -gen_impl = { path = "../gen_impl" } +ptx_parser_macros_impl = { path = "../ptx_parser_macros_impl" } convert_case = "0.6.0" rustc-hash = "2.0.0" syn = "2.0.67" diff --git a/gen/src/lib.rs b/ptx_parser_macros/src/lib.rs similarity index 96% rename from gen/src/lib.rs rename to ptx_parser_macros/src/lib.rs index a110fdc..a2f8396 100644 --- a/gen/src/lib.rs +++ b/ptx_parser_macros/src/lib.rs @@ -1,5 +1,5 @@ use either::Either; -use gen_impl::parser; +use ptx_parser_macros_impl::parser; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote, ToTokens}; use rustc_hash::{FxHashMap, FxHashSet}; @@ -359,7 +359,7 @@ fn gather_rules( #[proc_macro] pub fn derive_parser(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream { - let parse_definitions = parse_macro_input!(tokens as gen_impl::parser::ParseDefinitions); + let parse_definitions = parse_macro_input!(tokens as ptx_parser_macros_impl::parser::ParseDefinitions); let mut definitions = FxHashMap::default(); let mut special_definitions = FxHashMap::default(); let types = OpcodeDefinitions::get_enum_types(&parse_definitions.definitions); @@ -1012,7 +1012,7 @@ impl DotModifierRef { #[proc_macro] pub fn generate_instruction_type(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream { - let input = parse_macro_input!(tokens as gen_impl::GenerateInstructionType); + let input = parse_macro_input!(tokens as ptx_parser_macros_impl::GenerateInstructionType); let mut result = proc_macro2::TokenStream::new(); input.emit_arg_types(&mut result); input.emit_instruction_type(&mut result); diff --git a/gen_impl/Cargo.toml b/ptx_parser_macros_impl/Cargo.toml similarity index 64% rename from gen_impl/Cargo.toml rename to ptx_parser_macros_impl/Cargo.toml index ff93f98..96f3b74 100644 --- a/gen_impl/Cargo.toml +++ b/ptx_parser_macros_impl/Cargo.toml @@ -1,6 +1,7 @@ [package] -name = "gen_impl" -version = "0.1.0" +name = "ptx_parser_macros_impl" +version = "0.0.0" +authors = ["Andrzej Janik "] edition = "2021" [lib] diff --git a/gen_impl/src/lib.rs b/ptx_parser_macros_impl/src/lib.rs similarity index 100% rename from gen_impl/src/lib.rs rename to ptx_parser_macros_impl/src/lib.rs diff --git a/gen_impl/src/parser.rs b/ptx_parser_macros_impl/src/parser.rs similarity index 100% rename from gen_impl/src/parser.rs rename to ptx_parser_macros_impl/src/parser.rs