Fix emit_small_memset
This commit is contained in:
@@ -638,7 +638,7 @@ impl<'a> FunctionBuilder<'a> {
|
|||||||
|
|
||||||
/// Calls libc.memset
|
/// Calls libc.memset
|
||||||
///
|
///
|
||||||
/// Writes `size` bytes of value `ch` to memory starting at `buffer`.
|
/// Writes `size` bytes of i8 value `ch` to memory starting at `buffer`.
|
||||||
pub fn call_memset(
|
pub fn call_memset(
|
||||||
&mut self,
|
&mut self,
|
||||||
config: TargetFrontendConfig,
|
config: TargetFrontendConfig,
|
||||||
@@ -672,7 +672,7 @@ impl<'a> FunctionBuilder<'a> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
config: TargetFrontendConfig,
|
config: TargetFrontendConfig,
|
||||||
buffer: Value,
|
buffer: Value,
|
||||||
ch: u32,
|
ch: u8,
|
||||||
size: u64,
|
size: u64,
|
||||||
buffer_align: u8,
|
buffer_align: u8,
|
||||||
) {
|
) {
|
||||||
@@ -702,7 +702,7 @@ impl<'a> FunctionBuilder<'a> {
|
|||||||
let load_and_store_amount = size / access_size;
|
let load_and_store_amount = size / access_size;
|
||||||
|
|
||||||
if load_and_store_amount > THRESHOLD {
|
if load_and_store_amount > THRESHOLD {
|
||||||
let ch = self.ins().iconst(types::I32, i64::from(ch));
|
let ch = self.ins().iconst(types::I8, i64::from(ch));
|
||||||
let size = self.ins().iconst(config.pointer_type(), size as i64);
|
let size = self.ins().iconst(config.pointer_type(), size as i64);
|
||||||
self.call_memset(config, buffer, ch, size);
|
self.call_memset(config, buffer, ch, size);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user