-
Notifications
You must be signed in to change notification settings - Fork 13.6k
S390x inline asm #88245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S390x inline asm #88245
Changes from 1 commit
f28793d
5f5afba
7095dff
66e95b1
eeb0b52
0c9e23c
05cd587
a9f6237
96381d3
4a9ba65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ macro_rules! check { ($func:ident, $ty:ty, $class:ident, $mov:literal) => { | |
};} | ||
|
||
macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt, $mov:literal) => { | ||
|
||
#[no_mangle] | ||
pub unsafe fn $func(x: $ty) -> $ty { | ||
dont_merge(stringify!(func)); | ||
|
||
|
@@ -70,17 +70,57 @@ macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt, $mov:literal) => { | |
} | ||
};} | ||
|
||
// systemz-LABEL: sym_fn_32: | ||
// systemz: #APP | ||
// systemz: brasl %r14, extern_func@PLT | ||
// systemz: #NO_APP | ||
// CHECK-LABEL: sym_fn_32: | ||
// CHECK: #APP | ||
// CHECK: brasl %r14, extern_func | ||
// CHECK: #NO_APP | ||
#[cfg(s390x)] | ||
#[no_mangle] | ||
pub unsafe fn sym_fn_32() { | ||
asm!("brasl %r14, {}", sym extern_func); | ||
} | ||
|
||
// CHECK-LABEL: sym_static: | ||
// CHECK: #APP | ||
// CHECK: brasl %r14, extern_static | ||
// CHECK: #NO_APP | ||
#[no_mangle] | ||
pub unsafe fn sym_static() { | ||
asm!("brasl %r14, {}", sym extern_static); | ||
} | ||
|
||
// CHECK-LABEL: reg_i8: | ||
// CHECK: #APP | ||
// CHECK: lgr %r{{[0-9]+}}, %r{{[0-9]+}} | ||
// CHECK: #NO_APP | ||
check!(reg_i8, i8, reg, "lgr"); | ||
|
||
// CHECK-LABEL: reg_i16: | ||
// CHECK: #APP | ||
// CHECK: lgr %r{{[0-9]+}}, %r{{[0-9]+}} | ||
// CHECK: #NO_APP | ||
check!(reg_i16, i16, reg, "lgr"); | ||
|
||
// CHECK-LABEL: reg_i32: | ||
// CHECK: #APP | ||
// CHECK: lgr r{{[0-15]+}}, r{{[0-15]+}} | ||
// CHECK: lgr %r{{[0-9]+}}, %r{{[0-9]+}} | ||
// CHECK: #NO_APP | ||
check!(reg_i32, i32, reg, "lgr"); | ||
|
||
// CHECK-LABEL: reg_i64: | ||
// CHECK: #APP | ||
// CHECK: lgr %r{{[0-9]+}}, %r{{[0-9]+}} | ||
// CHECK: #NO_APP | ||
check!(reg_i64, i64, reg, "lgr"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a test with pointer types. Refer to the other tests for examples. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the test I have for the pointer type, similar to
and
I am not sure why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you paste the full contents of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// CHECK-LABEL: reg_f32: | ||
// CHECK: #APP | ||
// CHECK: ler %f{{[0-9]+}}, %f{{[0-9]+}} | ||
// CHECK: #NO_APP | ||
check!(reg_f32, f32, freg, "ler"); | ||
|
||
// CHECK-LABEL: reg_f64: | ||
// CHECK: #APP | ||
// CHECK: ldr %f{{[0-9]+}}, %f{{[0-9]+}} | ||
// CHECK: #NO_APP | ||
check!(reg_f64, f64, freg, "ldr"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests look good, but you also need tests which use explicit registers like |
Uh oh!
There was an error while loading. Please reload this page.