mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 19:58:30 +00:00
Get codebase completely working with LLVM
You can now build Cosmopolitan with Clang: make -j8 MODE=llvm o/llvm/examples/hello.com The assembler and linker code is now friendly to LLVM too. So it's not needed to configure Clang to use binutils under the hood. If you love LLVM then you can now use pure LLVM.
This commit is contained in:
parent
0e36cb3ac4
commit
e75ffde09e
4528 changed files with 7776 additions and 11640 deletions
|
@ -21,12 +21,12 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥+𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param rdi is int64 𝑥
|
||||
/ @param rsi is int64 𝑦
|
||||
/ @return rax is 𝑥+𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥+𝑦, aborting on overflow.
|
||||
//
|
||||
// @param rdi is int64 𝑥
|
||||
// @param rsi is int64 𝑦
|
||||
// @return rax is 𝑥+𝑦
|
||||
// @see -ftrapv
|
||||
__addvdi3:
|
||||
mov %rdi,%rax
|
||||
add %rsi,%rax
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥+𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param edi is int32 𝑥
|
||||
/ @param esi is int32 𝑦
|
||||
/ @return eax is 𝑥+𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥+𝑦, aborting on overflow.
|
||||
//
|
||||
// @param edi is int32 𝑥
|
||||
// @param esi is int32 𝑦
|
||||
// @return eax is 𝑥+𝑦
|
||||
// @see -ftrapv
|
||||
__addvsi3:
|
||||
mov %edi,%eax
|
||||
add %esi,%eax
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥+𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param rdi:rsi is int128 𝑥
|
||||
/ @param rdx:rcx is int128 𝑦
|
||||
/ @return rdx:rax is 𝑥+𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥+𝑦, aborting on overflow.
|
||||
//
|
||||
// @param rdi:rsi is int128 𝑥
|
||||
// @param rdx:rcx is int128 𝑦
|
||||
// @return rdx:rax is 𝑥+𝑦
|
||||
// @see -ftrapv
|
||||
__addvti3:
|
||||
mov %rdi,%rax
|
||||
add %rdx,%rax
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
|
||||
/ Jump table for mpsadbw() with non-constexpr immediate parameter.
|
||||
/
|
||||
/ @note needs sse4 cf. core c. 2006 cf. bulldozer c. 2011
|
||||
/ @see mpsadbw()
|
||||
// Jump table for mpsadbw() with non-constexpr immediate parameter.
|
||||
//
|
||||
// @note needs sse4 cf. core c. 2006 cf. bulldozer c. 2011
|
||||
// @see mpsadbw()
|
||||
.align 8
|
||||
__mpsadbws:
|
||||
i = 0
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥*𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param rdi is int64 𝑥
|
||||
/ @param rdi is int64 𝑦
|
||||
/ @return rax is 𝑥*𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥*𝑦, aborting on overflow.
|
||||
//
|
||||
// @param rdi is int64 𝑥
|
||||
// @param rdi is int64 𝑦
|
||||
// @return rax is 𝑥*𝑦
|
||||
// @see -ftrapv
|
||||
__mulvdi3:
|
||||
mov %rdi,%rax
|
||||
imul %rsi
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥*𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param edi is int32 𝑥
|
||||
/ @param esi is int32 𝑦
|
||||
/ @return eax is 𝑥*𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥*𝑦, aborting on overflow.
|
||||
//
|
||||
// @param edi is int32 𝑥
|
||||
// @param esi is int32 𝑦
|
||||
// @return eax is 𝑥*𝑦
|
||||
// @see -ftrapv
|
||||
__mulvsi3:
|
||||
mov %edi,%eax
|
||||
imul %esi
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥*𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param rdi:rsi is int128 𝑥
|
||||
/ @param rdx:rcx is int128 𝑦
|
||||
/ @return rdx:rax is 𝑥*𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥*𝑦, aborting on overflow.
|
||||
//
|
||||
// @param rdi:rsi is int128 𝑥
|
||||
// @param rdx:rcx is int128 𝑦
|
||||
// @return rdx:rax is 𝑥*𝑦
|
||||
// @see -ftrapv
|
||||
__mulvti3:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns -𝑥, aborting on overflow (two's complement bane).
|
||||
/
|
||||
/ @param rdi is int64 𝑥
|
||||
/ @return rax is -𝑥
|
||||
/ @see -ftrapv
|
||||
// Returns -𝑥, aborting on overflow (two's complement bane).
|
||||
//
|
||||
// @param rdi is int64 𝑥
|
||||
// @return rax is -𝑥
|
||||
// @see -ftrapv
|
||||
__negvdi2:
|
||||
mov %rdi,%rax
|
||||
neg %rax
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns -𝑥, aborting on overflow (two's complement bane).
|
||||
/
|
||||
/ @param edi is int32 𝑥
|
||||
/ @return eax is -𝑥
|
||||
/ @see -ftrapv
|
||||
// Returns -𝑥, aborting on overflow (two's complement bane).
|
||||
//
|
||||
// @param edi is int32 𝑥
|
||||
// @return eax is -𝑥
|
||||
// @see -ftrapv
|
||||
__negvsi2:
|
||||
mov %edi,%eax
|
||||
neg %eax
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns -𝑥, aborting on overflow.
|
||||
/
|
||||
/ @param rdi:rsi is int128 𝑥
|
||||
/ @return rdx:rax is -𝑥
|
||||
/ @see -ftrapv
|
||||
// Returns -𝑥, aborting on overflow.
|
||||
//
|
||||
// @param rdi:rsi is int128 𝑥
|
||||
// @return rdx:rax is -𝑥
|
||||
// @see -ftrapv
|
||||
__negvti2:
|
||||
mov %rdi,%rax
|
||||
mov %rsi,%rdx
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
.privileged
|
||||
.source __FILE__
|
||||
|
||||
/ Arithmetic overflow handler.
|
||||
/ @see -ftrapv
|
||||
// Arithmetic overflow handler.
|
||||
// @see -ftrapv
|
||||
__on_arithmetic_overflow:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
|
||||
/ Jump table for palignr() with non-constexpr immediate parameter.
|
||||
/
|
||||
/ @note needs ssse3 cf. prescott c. 2004 cf. bulldozer c. 2011
|
||||
/ @see palignr()
|
||||
// Jump table for palignr() with non-constexpr immediate parameter.
|
||||
//
|
||||
// @note needs ssse3 cf. prescott c. 2004 cf. bulldozer c. 2011
|
||||
// @see palignr()
|
||||
.align 8
|
||||
__palignrs:
|
||||
palignr $0,%xmm1,%xmm0
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
|
||||
/ Jump table for pslldq() with non-constexpr immediate parameter.
|
||||
// Jump table for pslldq() with non-constexpr immediate parameter.
|
||||
.align 8
|
||||
__pslldqs:
|
||||
pslldq $0,%xmm0
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
|
||||
/ Jump table for psrldq() with non-constexpr immediate parameter.
|
||||
// Jump table for psrldq() with non-constexpr immediate parameter.
|
||||
.align 8
|
||||
__psrldqs:
|
||||
psrldq $0,%xmm0
|
||||
|
|
|
@ -53,11 +53,11 @@ __asan_report_load16:
|
|||
.endfn __asan_report_load16,globl
|
||||
__asan_report_load32:
|
||||
push $32
|
||||
/ 𝑠𝑙𝑖𝑑𝑒
|
||||
// 𝑠𝑙𝑖𝑑𝑒
|
||||
.endfn __asan_report_load32,globl
|
||||
OnReportLoad:
|
||||
pop %rsi
|
||||
/ 𝑠𝑙𝑖𝑑𝑒
|
||||
// 𝑠𝑙𝑖𝑑𝑒
|
||||
.endfn OnReportLoad
|
||||
__asan_report_load_n:
|
||||
lea __asan_report_load(%rip),%r11
|
||||
|
@ -86,15 +86,15 @@ __asan_report_store16:
|
|||
.endfn __asan_report_store16,globl
|
||||
__asan_report_store32:
|
||||
push $32
|
||||
/ 𝑠𝑙𝑖𝑑𝑒
|
||||
// 𝑠𝑙𝑖𝑑𝑒
|
||||
.endfn __asan_report_store32,globl
|
||||
ReportStore:
|
||||
pop %rsi
|
||||
/ 𝑠𝑙𝑖𝑑𝑒
|
||||
// 𝑠𝑙𝑖𝑑𝑒
|
||||
.endfn ReportStore
|
||||
__asan_report_store_n:
|
||||
lea __asan_report_store(%rip),%r11
|
||||
/ 𝑠𝑙𝑖𝑑𝑒
|
||||
// 𝑠𝑙𝑖𝑑𝑒
|
||||
.endfn __asan_report_store_n,globl
|
||||
|
||||
__asan_report_noreentry:
|
||||
|
@ -152,7 +152,7 @@ __asan_stack_free_9:
|
|||
.endfn __asan_stack_free_9,globl
|
||||
__asan_stack_free_10:
|
||||
push $10
|
||||
/ 𝑠𝑙𝑖𝑑𝑒
|
||||
// 𝑠𝑙𝑖𝑑𝑒
|
||||
.endfn __asan_stack_free_10,globl
|
||||
OnStackFree:
|
||||
pop %rdx
|
||||
|
@ -201,7 +201,7 @@ __asan_stack_malloc_9:
|
|||
.endfn __asan_stack_malloc_9,globl
|
||||
__asan_stack_malloc_10:
|
||||
push $10
|
||||
/ 𝑠𝑙𝑖𝑑𝑒
|
||||
// 𝑠𝑙𝑖𝑑𝑒
|
||||
.endfn __asan_stack_malloc_10,globl
|
||||
OnStackMalloc:
|
||||
pop %rsi
|
||||
|
@ -212,7 +212,7 @@ __asan_version_mismatch_check_v8:
|
|||
ret
|
||||
.endfn __asan_version_mismatch_check_v8,globl
|
||||
|
||||
/ Initializes Address Sanitizer runtime earlier if linked.
|
||||
// Initializes Address Sanitizer runtime earlier if linked.
|
||||
.init.start 301,_init_asan
|
||||
push %rdi
|
||||
push %rsi
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥-𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param rdi is int64 𝑥
|
||||
/ @param rsi is int64 𝑦
|
||||
/ @return rax is 𝑥-𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥-𝑦, aborting on overflow.
|
||||
//
|
||||
// @param rdi is int64 𝑥
|
||||
// @param rsi is int64 𝑦
|
||||
// @return rax is 𝑥-𝑦
|
||||
// @see -ftrapv
|
||||
__subvdi3:
|
||||
mov %rdi,%rax
|
||||
sub %rsi,%rax
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥-𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param edi is int32 𝑥
|
||||
/ @param esi is int32 𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥-𝑦, aborting on overflow.
|
||||
//
|
||||
// @param edi is int32 𝑥
|
||||
// @param esi is int32 𝑦
|
||||
// @see -ftrapv
|
||||
__subvsi3:
|
||||
mov %edi,%eax
|
||||
sub %esi,%eax
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
.privileged
|
||||
.alignfunc
|
||||
|
||||
/ Returns 𝑥-𝑦, aborting on overflow.
|
||||
/
|
||||
/ @param rdi:rsi is int128 𝑥
|
||||
/ @param rdx:rcx is int128 𝑦
|
||||
/ @return rdx:rax is 𝑥-𝑦
|
||||
/ @see -ftrapv
|
||||
// Returns 𝑥-𝑦, aborting on overflow.
|
||||
//
|
||||
// @param rdi:rsi is int128 𝑥
|
||||
// @param rdx:rcx is int128 𝑦
|
||||
// @return rdx:rax is 𝑥-𝑦
|
||||
// @see -ftrapv
|
||||
__subvti3:
|
||||
mov %rdi,%rax
|
||||
sub %rdx,%rax
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue