Browse Source
Merge pull request #2354 from uweigand/fix-builtinuext
Add extension marker to i32 arguments of builtin functions
pull/2404/head
Chris Fallin
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
10 additions and
1 deletions
-
crates/cranelift/src/func_environ.rs
|
|
@ -69,7 +69,16 @@ macro_rules! declare_function_signatures { |
|
|
|
} |
|
|
|
|
|
|
|
fn i32(&self) -> AbiParam { |
|
|
|
AbiParam::new(I32) |
|
|
|
// Some platform ABIs require i32 values to be zero- or sign-
|
|
|
|
// extended to the full register width. We need to indicate
|
|
|
|
// this here by using the appropriate .uext or .sext attribute.
|
|
|
|
// The attribute can be added unconditionally; platforms whose
|
|
|
|
// ABI does not require such extensions will simply ignore it.
|
|
|
|
// Note that currently all i32 arguments or return values used
|
|
|
|
// by builtin functions are unsigned, so we always use .uext.
|
|
|
|
// If that ever changes, we will have to add a second type
|
|
|
|
// marker here.
|
|
|
|
AbiParam::new(I32).uext() |
|
|
|
} |
|
|
|
|
|
|
|
$( |
|
|
|