-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set
signext
or zeroext
for integer arguments on LoongArch64
- Loading branch information
Showing
6 changed files
with
78 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,111 @@ | ||
//@ compile-flags: -O -C no-prepopulate-passes | ||
//@ revisions: riscv64 | ||
//@ revisions: riscv64 loongarch64 | ||
|
||
//@[riscv64] only-riscv64 | ||
//@[riscv64] compile-flags: --target riscv64gc-unknown-linux-gnu | ||
//@[riscv64] needs-llvm-components: riscv | ||
|
||
//@[loongarch64] only-loongarch64 | ||
//@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu | ||
//@[loongarch64] needs-llvm-components: loongarch | ||
|
||
#![crate_type = "lib"] | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i8 @arg_attr_u8(i8 noundef zeroext %x) | ||
// riscv64: define noundef i8 @arg_attr_u8(i8 noundef zeroext %x) | ||
// loongarch64: define noundef i8 @arg_attr_u8(i8 noundef zeroext %x) | ||
pub fn arg_attr_u8(x: u8) -> u8 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i16 @arg_attr_u16(i16 noundef zeroext %x) | ||
// riscv64: define noundef i16 @arg_attr_u16(i16 noundef zeroext %x) | ||
// loongarch64: define noundef i16 @arg_attr_u16(i16 noundef zeroext %x) | ||
pub fn arg_attr_u16(x: u16) -> u16 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i32 @arg_attr_u32(i32 noundef signext %x) | ||
// riscv64: define noundef i32 @arg_attr_u32(i32 noundef signext %x) | ||
// loongarch64: define noundef i32 @arg_attr_u32(i32 noundef signext %x) | ||
pub fn arg_attr_u32(x: u32) -> u32 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i64 @arg_attr_u64(i64 noundef %x) | ||
// riscv64: define noundef i64 @arg_attr_u64(i64 noundef %x) | ||
// loongarch64: define noundef i64 @arg_attr_u64(i64 noundef %x) | ||
pub fn arg_attr_u64(x: u64) -> u64 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i128 @arg_attr_u128(i128 noundef %x) | ||
// riscv64: define noundef i128 @arg_attr_u128(i128 noundef %x) | ||
// loongarch64: define noundef i128 @arg_attr_u128(i128 noundef %x) | ||
pub fn arg_attr_u128(x: u128) -> u128 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i8 @arg_attr_i8(i8 noundef signext %x) | ||
// riscv64: define noundef i8 @arg_attr_i8(i8 noundef signext %x) | ||
// loongarch64: define noundef i8 @arg_attr_i8(i8 noundef signext %x) | ||
pub fn arg_attr_i8(x: i8) -> i8 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i16 @arg_attr_i16(i16 noundef signext %x) | ||
// riscv64: define noundef i16 @arg_attr_i16(i16 noundef signext %x) | ||
// loongarch64: define noundef i16 @arg_attr_i16(i16 noundef signext %x) | ||
pub fn arg_attr_i16(x: i16) -> i16 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i32 @arg_attr_i32(i32 noundef signext %x) | ||
// riscv64: define noundef i32 @arg_attr_i32(i32 noundef signext %x) | ||
// loongarch64: define noundef i32 @arg_attr_i32(i32 noundef signext %x) | ||
pub fn arg_attr_i32(x: i32) -> i32 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i64 @arg_attr_i64(i64 noundef %x) | ||
// riscv64: define noundef i64 @arg_attr_i64(i64 noundef %x) | ||
// loongarch64: define noundef i64 @arg_attr_i64(i64 noundef %x) | ||
pub fn arg_attr_i64(x: i64) -> i64 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef i128 @arg_attr_i128(i128 noundef %x) | ||
// riscv64: define noundef i128 @arg_attr_i128(i128 noundef %x) | ||
// loongarch64: define noundef i128 @arg_attr_i128(i128 noundef %x) | ||
pub fn arg_attr_i128(x: i128) -> i128 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef zeroext i1 @arg_attr_bool(i1 noundef zeroext %x) | ||
// riscv64: define noundef zeroext i1 @arg_attr_bool(i1 noundef zeroext %x) | ||
// loongarch64: define noundef zeroext i1 @arg_attr_bool(i1 noundef zeroext %x) | ||
pub fn arg_attr_bool(x: bool) -> bool { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// ignore-tidy-linelength | ||
// riscv64: define noundef{{( range\(i32 0, 1114112\))?}} i32 @arg_attr_char(i32 noundef signext{{( range\(i32 0, 1114112\))?}} %x) | ||
// riscv64: define noundef{{( range\(i32 0, 1114112\))?}} i32 @arg_attr_char(i32 noundef signext{{( range\(i32 0, 1114112\))?}} %x) | ||
// loongarch64: define noundef{{( range\(i32 0, 1114112\))?}} i32 @arg_attr_char(i32 noundef signext{{( range\(i32 0, 1114112\))?}} %x) | ||
pub fn arg_attr_char(x: char) -> char { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef float @arg_attr_f32(float noundef %x) | ||
// riscv64: define noundef float @arg_attr_f32(float noundef %x) | ||
// loongarch64: define noundef float @arg_attr_f32(float noundef %x) | ||
pub fn arg_attr_f32(x: f32) -> f32 { | ||
x | ||
} | ||
|
||
#[no_mangle] | ||
// riscv64: define noundef double @arg_attr_f64(double noundef %x) | ||
// riscv64: define noundef double @arg_attr_f64(double noundef %x) | ||
// loongarch64: define noundef double @arg_attr_f64(double noundef %x) | ||
pub fn arg_attr_f64(x: f64) -> f64 { | ||
x | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters