mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-07-25 13:16:23 +03:00
Remove Type::Pointer (#428)
This commit is contained in:
@ -138,10 +138,7 @@ pub(crate) fn default_implicit_conversion(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if instruction_space != operand_space {
|
if instruction_space != operand_space {
|
||||||
default_implicit_conversion_space(
|
default_implicit_conversion_space((operand_space, operand_type), instruction_space)
|
||||||
(operand_space, operand_type),
|
|
||||||
(instruction_space, instruction_type),
|
|
||||||
)
|
|
||||||
} else if instruction_type != operand_type {
|
} else if instruction_type != operand_type {
|
||||||
default_implicit_conversion_type(instruction_space, operand_type, instruction_type)
|
default_implicit_conversion_type(instruction_space, operand_type, instruction_type)
|
||||||
} else {
|
} else {
|
||||||
@ -167,7 +164,7 @@ fn is_addressable(this: ast::StateSpace) -> bool {
|
|||||||
// Space is different
|
// Space is different
|
||||||
fn default_implicit_conversion_space(
|
fn default_implicit_conversion_space(
|
||||||
(operand_space, operand_type): (ast::StateSpace, &ast::Type),
|
(operand_space, operand_type): (ast::StateSpace, &ast::Type),
|
||||||
(instruction_space, instruction_type): (ast::StateSpace, &ast::Type),
|
instruction_space: ast::StateSpace,
|
||||||
) -> Result<Option<ConversionKind>, TranslateError> {
|
) -> Result<Option<ConversionKind>, TranslateError> {
|
||||||
if (instruction_space == ast::StateSpace::Generic && coerces_to_generic(operand_space))
|
if (instruction_space == ast::StateSpace::Generic && coerces_to_generic(operand_space))
|
||||||
|| (operand_space == ast::StateSpace::Generic && coerces_to_generic(instruction_space))
|
|| (operand_space == ast::StateSpace::Generic && coerces_to_generic(instruction_space))
|
||||||
@ -175,15 +172,6 @@ fn default_implicit_conversion_space(
|
|||||||
Ok(Some(ConversionKind::PtrToPtr))
|
Ok(Some(ConversionKind::PtrToPtr))
|
||||||
} else if operand_space == ast::StateSpace::Reg {
|
} else if operand_space == ast::StateSpace::Reg {
|
||||||
match operand_type {
|
match operand_type {
|
||||||
ast::Type::Pointer(operand_ptr_type, operand_ptr_space)
|
|
||||||
if *operand_ptr_space == instruction_space =>
|
|
||||||
{
|
|
||||||
if instruction_type != &ast::Type::Scalar(*operand_ptr_type) {
|
|
||||||
Ok(Some(ConversionKind::PtrToPtr))
|
|
||||||
} else {
|
|
||||||
Ok(None)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// TODO: 32 bit
|
// TODO: 32 bit
|
||||||
ast::Type::Scalar(ast::ScalarType::B64)
|
ast::Type::Scalar(ast::ScalarType::B64)
|
||||||
| ast::Type::Scalar(ast::ScalarType::U64)
|
| ast::Type::Scalar(ast::ScalarType::U64)
|
||||||
@ -205,19 +193,6 @@ fn default_implicit_conversion_space(
|
|||||||
},
|
},
|
||||||
_ => Err(error_mismatched_type()),
|
_ => Err(error_mismatched_type()),
|
||||||
}
|
}
|
||||||
} else if instruction_space == ast::StateSpace::Reg {
|
|
||||||
match instruction_type {
|
|
||||||
ast::Type::Pointer(instruction_ptr_type, instruction_ptr_space)
|
|
||||||
if operand_space == *instruction_ptr_space =>
|
|
||||||
{
|
|
||||||
if operand_type != &ast::Type::Scalar(*instruction_ptr_type) {
|
|
||||||
Ok(Some(ConversionKind::PtrToPtr))
|
|
||||||
} else {
|
|
||||||
Ok(None)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => Err(error_mismatched_type()),
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Err(error_mismatched_type())
|
Err(error_mismatched_type())
|
||||||
}
|
}
|
||||||
|
@ -2600,7 +2600,6 @@ fn get_type(context: LLVMContextRef, type_: &ast::Type) -> Result<LLVMTypeRef, T
|
|||||||
LLVMArrayType2(result, *dimension as u64)
|
LLVMArrayType2(result, *dimension as u64)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
ast::Type::Pointer(_, space) => get_pointer_type(context, *space)?,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,7 +831,6 @@ pub enum Type {
|
|||||||
Vector(u8, ScalarType),
|
Vector(u8, ScalarType),
|
||||||
// .param.b32 foo[4];
|
// .param.b32 foo[4];
|
||||||
Array(Option<NonZeroU8>, ScalarType, Vec<u32>),
|
Array(Option<NonZeroU8>, ScalarType, Vec<u32>),
|
||||||
Pointer(ScalarType, StateSpace),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Type {
|
impl Type {
|
||||||
@ -882,7 +881,6 @@ impl Type {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Type::Pointer(..) => Layout::new::<usize>(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user