### ----------------------------------------------------
### -- Wasm::Emitter
### -- Licenses: Artistic-2.0
### -- Authors: Jonathan Worthington <jnthn@jnthn.net>
### -- File: lib/Wasm/Emitter/Expression.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 2
($!pos++, 0xBA);
    }

    method f64-promote-f32(--> Nil) {
        $!code.write-uint8($!pos++, 0xBB);
    }

    method i32-reinterpret-f32(--> Nil) {
        $!code.write-uint8($!pos++, 0xBC);
    }

    method i64-reinterpret-f64(--> Nil) {
        $!code.write-uint8($!pos++, 0xBD);
    }

    method f32-reinterpret-i32(--> Nil) {
        $!code.write-uint8($!pos++, 0xBE);
    }

    method f64-reinterpret-i64(--> Nil) {
        $!code.write-uint8($!pos++, 0xBF);
    }

    method i32-extend8-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xC0);
    }

    method i32-extend16-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xC1);
    }

    method i64-extend8-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xC2);
    }

    method i64-extend16-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xC3);
    }

    method i64-extend32-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xC4);
    }

    method i32-trunc-sat-f32-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xFC);
        $!pos += encode-leb128-unsigned(0, $!code, $!pos);
    }

    method i32-trunc-sat-f32-u(--> Nil) {
        $!code.write-uint8($!pos++, 0xFC);
        $!pos += encode-leb128-unsigned(1, $!code, $!pos);
    }

    method i32-trunc-sat-f64-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xFC);
        $!pos += encode-leb128-unsigned(2, $!code, $!pos);
    }

    method i32-trunc-sat-f64-u(--> Nil) {
        $!code.write-uint8($!pos++, 0xFC);
        $!pos += encode-leb128-unsigned(3, $!code, $!pos);
    }

    method i64-trunc-sat-f32-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xFC);
        $!pos += encode-leb128-unsigned(4, $!code, $!pos);
    }

    method i64-trunc-sat-f32-u(--> Nil) {
        $!code.write-uint8($!pos++, 0xFC);
        $!pos += encode-leb128-unsigned(5, $!code, $!pos);
    }

    method i64-trunc-sat-f64-s(--> Nil) {
        $!code.write-uint8($!pos++, 0xFC);
        $!pos += encode-leb128-unsigned(6, $!code, $!pos);
    }

    method i64-trunc-sat-f64-u(--> Nil) {
        $!code.write-uint8($!pos++, 0xFC);
        $!pos += encode-leb128-unsigned(7, $!code, $!pos);
    }

    method assemble(--> Buf) {
        unless $!assembled {
            $!code.write-uint8($!pos++, 0x0B);
            $!assembled = True;
        }
        $!code
    }

    #| If the expression does no more than load constant function reference,
    #| then return it. Otherwise, return a type object.
    method get-constant-func-ref(--> Int) {
        if $!code[0] == 0xD2 {
            my int $pos = 1;
            my int $read;
            my $index = decode-leb128-unsigned($!code, $pos, $read);
            $pos += $read;
            if $pos == $!code.elems || $pos + 1 == $!code.elems && $!code[*-1] == 0x0B {
                return $index;
            }
        }
        return Int;
    }
}


