// File: /workspace/github_c_makefile_star2_O2/mbitsnbites[P]SoftFP/./softfptest_template.h
// Function: test_cvt_sf32_sf64
void test_cvt_sf32_sf(F_UINT a, RoundingModeEnum rm, int it)
{
    uint32_t a32, a32_ref;
    float_status st;
    uint32_t fflags;
    F_UINT a_ref;

    /* to 32 bit */
    fflags = 0;
    a32 = glue(glue(cvt_sf, F_SIZE), _sf32)(a, rm, &fflags);

    softfloat_init_ctx(&st, rm);
    a32_ref = softfloat_to_sf32(glue(glue(float, F_SIZE), _to_float32)(sf_to_softfloat(a), &st));
    if (a32 != a32_ref || softfloat_to_fflags(&st) != fflags) {
        printf("ERROR op=cvt_sf_sf32 size=%d rm=%s it=%d:\n",
               F_SIZE, rm_to_str[rm], it);
        printf("a  = "); print_sf(a); printf("\n");
        printf("ref= "); print_sf32(a32_ref); printf("\n");
        printf("r  = "); print_sf32(a32); printf("\n");
        exit(1);
    }
    
    /* from 32 bit */
    fflags = 0;
    a = glue(cvt_sf32_sf, F_SIZE)(a32, &fflags);
    
    softfloat_init_ctx(&st, rm);
    a_ref = softfloat_to_sf(glue(float32_to_float, F_SIZE)(sf_to_softfloat32(a32), &st));
    if (a != a_ref || softfloat_to_fflags(&st) != fflags) {
        printf("ERROR op=cvt_sf32_sf size=%d rm=%s it=%d\n",
               F_SIZE, rm_to_str[rm], it);
        printf("a  = "); print_sf32(a32); printf("\n");
        printf("ref= "); print_sf(a_ref); printf("\n");
        printf("r  = "); print_sf(a); printf("\n");
        exit(1);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
callq 0x68ef
movl %eax, %ebx
leaq 0x10(%rsp), %rsi
andl $0x0, (%rsi)
andw $0x0, 0x4(%rsi)
movl %r15d, %r12d
leaq 0x119f9(%rip), %rax     # 0x140d0
movb (%rax,%r12,4), %r13b
movb %r13b, 0x1(%rsi)
movb $0x1, 0x6(%rsi)
movq %r14, %rdi
callq 0xb8eb
movl %eax, %r15d
cmpl %eax, %ebx
jne 0x275f
leaq 0x10(%rsp), %rdi
callq 0x137c
cmpl 0xc(%rsp), %eax
jne 0x275f
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
movl %ebx, %edi
callq 0x685e
leaq 0x10(%rsp), %rsi
andl $0x0, (%rsi)
andw $0x0, 0x4(%rsi)
movq %rax, %r14
movb %r13b, 0x1(%rsi)
movb $0x1, 0x6(%rsi)
movl %ebx, %edi
callq 0x9fcc
movq %rax, %r15
cmpq %rax, %r14
jne 0x27d3
leaq 0x10(%rsp), %rdi
callq 0x137c
cmpl 0xc(%rsp), %eax
jne 0x27d3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1965a(%rip), %rax     # 0x1bdc0
movq (%rax,%r12,8), %rdx
leaq 0x11c64(%rip), %rdi     # 0x143d5
pushq $0x40
popq %rsi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x11a16(%rip), %rdi     # 0x1419a
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
callq 0x2653
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x1030
leaq 0x11a02(%rip), %rdi     # 0x141a6
xorl %eax, %eax
callq 0x1070
movl %r15d, %edi
callq 0x1565
movl %ebp, %edi
callq 0x1030
leaq 0x119fb(%rip), %rdi     # 0x141bc
xorl %eax, %eax
callq 0x1070
movl %ebx, %edi
callq 0x1565
movl %ebp, %edi
jmp 0x2845
leaq 0x195e6(%rip), %rax     # 0x1bdc0
movq (%rax,%r12,8), %rdx
leaq 0x11c1b(%rip), %rdi     # 0x14400
pushq $0x40
popq %rsi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x119a2(%rip), %rdi     # 0x1419a
xorl %eax, %eax
callq 0x1070
movl %ebx, %edi
callq 0x1565
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x1030
leaq 0x1198f(%rip), %rdi     # 0x141a6
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
callq 0x2653
movl %ebx, %edi
callq 0x1030
leaq 0x11988(%rip), %rdi     # 0x141bc
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
callq 0x2653
movl %ebx, %edi
callq 0x1030
pushq $0x1
popq %rdi
callq 0x10b0