mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 17:32:22 -07:00
Inline asm expression (-llvm-api)
See https://llvm.org/docs/LangRef.html#inline-assembler-expressions Example: ``` x := asm(i32) -> i32 { "bswap $0", "=r,r", }(123); ``` Allowed directives `#side_effect`, `#align_stack`, `#att`, `#intel` e.g. `asm() #side_effect #intel {...}`
This commit is contained in:
+7
-2
@@ -2209,7 +2209,7 @@ Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCall
|
||||
return new_type;
|
||||
}
|
||||
|
||||
if (cc == ProcCC_None || cc == ProcCC_PureNone) {
|
||||
if (cc == ProcCC_None || cc == ProcCC_PureNone || cc == ProcCC_InlineAsm) {
|
||||
return new_type;
|
||||
}
|
||||
|
||||
@@ -2328,10 +2328,15 @@ Type *type_to_abi_compat_result_type(gbAllocator a, Type *original_type, ProcCal
|
||||
|
||||
Type *single_type = reduce_tuple_to_single_type(original_type);
|
||||
|
||||
if (cc == ProcCC_InlineAsm) {
|
||||
return new_type;
|
||||
}
|
||||
|
||||
if (is_type_simd_vector(single_type)) {
|
||||
return new_type;
|
||||
}
|
||||
|
||||
|
||||
if (build_context.ODIN_OS == "windows") {
|
||||
if (build_context.ODIN_ARCH == "amd64") {
|
||||
if (is_type_integer_128bit(single_type)) {
|
||||
@@ -2401,7 +2406,7 @@ bool abi_compat_return_by_pointer(gbAllocator a, ProcCallingConvention cc, Type
|
||||
if (abi_return_type == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (cc == ProcCC_None || cc == ProcCC_PureNone) {
|
||||
if (cc == ProcCC_None || cc == ProcCC_PureNone || cc == ProcCC_InlineAsm) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user