Rename new crates

This commit is contained in:
Andrzej Janik 2024-08-21 20:00:22 +02:00
parent 0760c3d58f
commit 71e025845c
9 changed files with 20 additions and 18 deletions

View file

@ -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"]

View file

@ -1,12 +1,13 @@
[package]
name = "ptx_parser"
version = "0.1.0"
version = "0.0.0"
authors = ["Andrzej Janik <vosen@vosen.pl>"]
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"

View file

@ -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<P: Operand> {
Label(P::Ident),
@ -14,7 +13,7 @@ pub enum Statement<P: Operand> {
Block(Vec<Statement<P>>),
}
gen::generate_instruction_type!(
ptx_parser_macros::generate_instruction_type!(
pub enum Instruction<T: Operand> {
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,
}

View file

@ -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;

View file

@ -1,13 +1,14 @@
[package]
name = "gen"
version = "0.1.0"
name = "ptx_parser_macros"
version = "0.0.0"
authors = ["Andrzej Janik <vosen@vosen.pl>"]
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"

View file

@ -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);

View file

@ -1,6 +1,7 @@
[package]
name = "gen_impl"
version = "0.1.0"
name = "ptx_parser_macros_impl"
version = "0.0.0"
authors = ["Andrzej Janik <vosen@vosen.pl>"]
edition = "2021"
[lib]