aboutsummaryrefslogtreecommitdiffhomepage
path: root/ptx
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-04-15 19:53:54 +0200
committerAndrzej Janik <[email protected]>2021-04-15 19:53:54 +0200
commit8cd3db66485175b7589f7d3828a147fafe5ecaed (patch)
tree1f2efb69e6a7c9c633f186c6aa6492c09c19e14b /ptx
parent4d04fe251d4776722d8e5ee74333e8b5fa8b6931 (diff)
downloadZLUDA-8cd3db66485175b7589f7d3828a147fafe5ecaed.tar.gz
ZLUDA-8cd3db66485175b7589f7d3828a147fafe5ecaed.zip
Remove LdStType
Diffstat (limited to 'ptx')
-rw-r--r--ptx/src/ast.rs26
-rw-r--r--ptx/src/ptx.lalrpop6
-rw-r--r--ptx/src/translate.rs6
3 files changed, 8 insertions, 30 deletions
diff --git a/ptx/src/ast.rs b/ptx/src/ast.rs
index 3a7cf98..6a01a6a 100644
--- a/ptx/src/ast.rs
+++ b/ptx/src/ast.rs
@@ -595,32 +595,10 @@ pub struct LdDetails {
pub qualifier: LdStQualifier,
pub state_space: LdStateSpace,
pub caching: LdCacheOperator,
- pub typ: LdStType,
+ pub typ: PointerType,
pub non_coherent: bool,
}
-sub_type! {
- LdStType {
- Scalar(ScalarType),
- Vector(ScalarType, u8),
- // Used in generated code
- Pointer(PointerType, LdStateSpace),
- }
-}
-
-impl From<LdStType> for PointerType {
- fn from(t: LdStType) -> Self {
- match t {
- LdStType::Scalar(t) => PointerType::Scalar(t.into()),
- LdStType::Vector(t, len) => PointerType::Vector(t.into(), len),
- LdStType::Pointer(PointerType::Scalar(scalar_type), space) => {
- PointerType::Pointer(scalar_type, space)
- }
- LdStType::Pointer(..) => unreachable!(),
- }
- }
-}
-
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum LdStQualifier {
Weak,
@@ -853,7 +831,7 @@ pub struct StData {
pub qualifier: LdStQualifier,
pub state_space: StStateSpace,
pub caching: StCacheOperator,
- pub typ: LdStType,
+ pub typ: PointerType,
}
#[derive(PartialEq, Eq, Copy, Clone)]
diff --git a/ptx/src/ptx.lalrpop b/ptx/src/ptx.lalrpop
index 7bd9c4f..44852a2 100644
--- a/ptx/src/ptx.lalrpop
+++ b/ptx/src/ptx.lalrpop
@@ -789,9 +789,9 @@ InstLd: ast::Instruction<ast::ParsedArgParams<'input>> = {
}
};
-LdStType: ast::LdStType = {
- <v:VectorPrefix> <t:LdStScalarType> => ast::LdStType::Vector(t, v),
- <t:LdStScalarType> => ast::LdStType::Scalar(t),
+LdStType: ast::PointerType = {
+ <v:VectorPrefix> <t:LdStScalarType> => ast::PointerType::Vector(t, v),
+ <t:LdStScalarType> => ast::PointerType::Scalar(t),
}
LdStQualifier: ast::LdStQualifier = {
diff --git a/ptx/src/translate.rs b/ptx/src/translate.rs
index 7eec085..1f647bd 100644
--- a/ptx/src/translate.rs
+++ b/ptx/src/translate.rs
@@ -4553,7 +4553,7 @@ fn convert_to_stateful_memory_access<'a>(
Statement::Instruction(ast::Instruction::Ld(
ast::LdDetails {
state_space: ast::LdStateSpace::Param,
- typ: ast::LdStType::Scalar(ast::ScalarType::U64),
+ typ: ast::PointerType::Scalar(ast::ScalarType::U64),
..
},
arg,
@@ -4561,7 +4561,7 @@ fn convert_to_stateful_memory_access<'a>(
| Statement::Instruction(ast::Instruction::Ld(
ast::LdDetails {
state_space: ast::LdStateSpace::Param,
- typ: ast::LdStType::Scalar(ast::ScalarType::S64),
+ typ: ast::PointerType::Scalar(ast::ScalarType::S64),
..
},
arg,
@@ -4569,7 +4569,7 @@ fn convert_to_stateful_memory_access<'a>(
| Statement::Instruction(ast::Instruction::Ld(
ast::LdDetails {
state_space: ast::LdStateSpace::Param,
- typ: ast::LdStType::Scalar(ast::ScalarType::B64),
+ typ: ast::PointerType::Scalar(ast::ScalarType::B64),
..
},
arg,