blaise/vendor/qbe/test/_gcm1.ssa
Graeme Geldenhuys c9dde987f0 vendor: update QBE from v1.2 to v1.3
QBE 1.3 (released 2026-06-01) adds Windows AMD64 ABI support
(amd64_win target), improved PIC via extern symbol constants,
GVN/GCM optimisation passes, if-conversion, and various
correctness and performance fixes.

All 2293 compiler tests pass against the new QBE binary.
2026-06-02 16:54:51 +01:00

49 lines
742 B
Plaintext

export
function w $ifmv(w %p1, w %p2, w %p3) {
@start
@entry
%rt =w add %p2, %p3 # gcm moves to @true
%rf =w sub %p2, %p3 # gcm moves to @false
jnz %p1, @true, @false
@true
%r =w copy %rt
jmp @exit
@false
%r =w copy %rf
jmp @exit
@exit
ret %r
}
export
function w $hoist1(w %p1, w %p2, w %p3) {
@start
@entry
%n =w copy 0
%i =w copy %p1
@loop
%base =w add %p2, %p3 # gcm moves to @exit
%i =w sub %i, 1
%n =w add %n, 1
jnz %i, @loop, @exit
@exit
%r =w add %base, %n
ret %r
}
export
function w $hoist2(w %p1, w %p2, w %p3) {
@start
@entry
%n =w copy 0
%i =w copy %p1
@loop
%base =w add %p2, %p3 # gcm moves to @entry
%i =w sub %i, 1
%n =w add %n, %base
jnz %i, @loop, @exit
@exit
%r =w add %base, %n
ret %r
}