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_redirect",
"zluda_ml", "zluda_ml",
"ptx", "ptx",
"gen", "ptx_parser",
"gen_impl", "ptx_parser_macros",
"ptx_parser" "ptx_parser_macros_impl",
] ]
default-members = ["zluda_lib", "zluda_ml", "zluda_inject", "zluda_redirect"] default-members = ["zluda_lib", "zluda_ml", "zluda_inject", "zluda_redirect"]

View File

@ -1,12 +1,13 @@
[package] [package]
name = "ptx_parser" name = "ptx_parser"
version = "0.1.0" version = "0.0.0"
authors = ["Andrzej Janik <vosen@vosen.pl>"]
edition = "2021" edition = "2021"
[dependencies] [dependencies]
logos = "0.14" logos = "0.14"
winnow = { version = "0.6.18" } winnow = { version = "0.6.18" }
gen = { path = "../gen" } ptx_parser_macros = { path = "../ptx_parser_macros" }
thiserror = "1.0" thiserror = "1.0"
bitflags = "1.2" bitflags = "1.2"
rustc-hash = "2.0.0" rustc-hash = "2.0.0"

View File

@ -1,11 +1,10 @@
use std::cmp::Ordering;
use super::{ use super::{
AtomSemantics, MemScope, RawRoundingMode, RawSetpCompareOp, ScalarType, SetpBoolPostOp, AtomSemantics, MemScope, RawRoundingMode, RawSetpCompareOp, ScalarType, SetpBoolPostOp,
StateSpace, VectorPrefix, StateSpace, VectorPrefix,
}; };
use crate::{PtxError, PtxParserState}; use crate::{PtxError, PtxParserState};
use bitflags::bitflags; use bitflags::bitflags;
use std::cmp::Ordering;
pub enum Statement<P: Operand> { pub enum Statement<P: Operand> {
Label(P::Ident), Label(P::Ident),
@ -14,7 +13,7 @@ pub enum Statement<P: Operand> {
Block(Vec<Statement<P>>), Block(Vec<Statement<P>>),
} }
gen::generate_instruction_type!( ptx_parser_macros::generate_instruction_type!(
pub enum Instruction<T: Operand> { pub enum Instruction<T: Operand> {
Mov { Mov {
type: { &data.typ }, type: { &data.typ },
@ -1448,5 +1447,5 @@ pub enum DivFloatKind {
#[derive(Copy, Clone, Eq, PartialEq)] #[derive(Copy, Clone, Eq, PartialEq)]
pub struct FlushToZero { 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 logos::Logos;
use ptx_parser_macros::derive_parser;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use std::fmt::Debug; use std::fmt::Debug;
use std::mem; use std::mem;

View File

@ -1,13 +1,14 @@
[package] [package]
name = "gen" name = "ptx_parser_macros"
version = "0.1.0" version = "0.0.0"
authors = ["Andrzej Janik <vosen@vosen.pl>"]
edition = "2021" edition = "2021"
[lib] [lib]
proc-macro = true proc-macro = true
[dependencies] [dependencies]
gen_impl = { path = "../gen_impl" } ptx_parser_macros_impl = { path = "../ptx_parser_macros_impl" }
convert_case = "0.6.0" convert_case = "0.6.0"
rustc-hash = "2.0.0" rustc-hash = "2.0.0"
syn = "2.0.67" syn = "2.0.67"

View File

@ -1,5 +1,5 @@
use either::Either; use either::Either;
use gen_impl::parser; use ptx_parser_macros_impl::parser;
use proc_macro2::{Span, TokenStream}; use proc_macro2::{Span, TokenStream};
use quote::{format_ident, quote, ToTokens}; use quote::{format_ident, quote, ToTokens};
use rustc_hash::{FxHashMap, FxHashSet}; use rustc_hash::{FxHashMap, FxHashSet};
@ -359,7 +359,7 @@ fn gather_rules(
#[proc_macro] #[proc_macro]
pub fn derive_parser(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream { 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 definitions = FxHashMap::default();
let mut special_definitions = FxHashMap::default(); let mut special_definitions = FxHashMap::default();
let types = OpcodeDefinitions::get_enum_types(&parse_definitions.definitions); let types = OpcodeDefinitions::get_enum_types(&parse_definitions.definitions);
@ -1012,7 +1012,7 @@ impl DotModifierRef {
#[proc_macro] #[proc_macro]
pub fn generate_instruction_type(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream { 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(); let mut result = proc_macro2::TokenStream::new();
input.emit_arg_types(&mut result); input.emit_arg_types(&mut result);
input.emit_instruction_type(&mut result); input.emit_instruction_type(&mut result);

View File

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