mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64093 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4a2f112a5c
commit
be685cc72a
@ -1831,3 +1831,34 @@ unsigned long f2(struct s2 x) {
|
|||||||
|
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
We currently compile this:
|
||||||
|
|
||||||
|
define i32 @func1(i32 %v1, i32 %v2) nounwind {
|
||||||
|
entry:
|
||||||
|
%t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2)
|
||||||
|
%sum = extractvalue {i32, i1} %t, 0
|
||||||
|
%obit = extractvalue {i32, i1} %t, 1
|
||||||
|
br i1 %obit, label %overflow, label %normal
|
||||||
|
normal:
|
||||||
|
ret i32 %sum
|
||||||
|
overflow:
|
||||||
|
call void @llvm.trap()
|
||||||
|
unreachable
|
||||||
|
}
|
||||||
|
declare {i32, i1} @llvm.sadd.with.overflow.i32(i32, i32)
|
||||||
|
declare void @llvm.trap()
|
||||||
|
|
||||||
|
to:
|
||||||
|
|
||||||
|
_func1:
|
||||||
|
movl 4(%esp), %eax
|
||||||
|
addl 8(%esp), %eax
|
||||||
|
jo LBB1_2 ## overflow
|
||||||
|
LBB1_1: ## normal
|
||||||
|
ret
|
||||||
|
LBB1_2: ## overflow
|
||||||
|
ud2
|
||||||
|
|
||||||
|
it would be nice to produce "into" someday.
|
||||||
|
|
||||||
|
//===---------------------------------------------------------------------===//
|
||||||
|
Loading…
Reference in New Issue
Block a user