Index: test/CodeGen/Mips/cconv/arguments-varargs.ll =================================================================== --- test/CodeGen/Mips/cconv/arguments-varargs.ll +++ test/CodeGen/Mips/cconv/arguments-varargs.ll @@ -1,41 +1,315 @@ -; RUN: llc -mtriple=mips-linux -relocation-model=static < %s | FileCheck --check-prefixes=ALL,O32,O32-BE %s -; RUN: llc -mtriple=mipsel-linux -relocation-model=static < %s | FileCheck --check-prefixes=ALL,O32,O32-LE %s +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=mips-mti-linux-gnu -relocation-model=static < %s | FileCheck --check-prefix=O32-BE %s +; RUN: llc -mtriple=mipsel-mti-linux-gnu -relocation-model=static < %s | FileCheck --check-prefix=O32-LE %s -; RUN-TODO: llc -march=mips64 -relocation-model=static -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s -; RUN-TODO: llc -march=mips64el -relocation-model=static -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s +; RUN-TODO: llc -march=mips64 -relocation-model=static -target-abi o32 < %s | FileCheck --check-prefix=O32 %s +; RUN-TODO: llc -march=mips64el -relocation-model=static -target-abi o32 < %s | FileCheck --check-prefix=O32 %s -; RUN: llc -mtriple=mips64-linux -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefixes=ALL,NEW,N32,NEW-BE %s -; RUN: llc -mtriple=mips64el-linux -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefixes=ALL,NEW,N32,NEW-LE %s +; RUN: llc -mtriple=mips64-mti-linux-gnu -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefix=N32BE %s +; RUN: llc -mtriple=mips64el-mti-linux-gnu -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefix=N32LE %s -; RUN: llc -march=mips64 -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefixes=ALL,NEW,N64,NEW-BE %s -; RUN: llc -march=mips64el -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefixes=ALL,NEW,N64,NEW-LE %s +; RUN: llc -mtriple=mips64-mti-linux-gnu -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefix=N64BE %s +; RUN: llc -mtriple=mips64el-mti-linux-gnu -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefix=N64LE %s @hwords = global [3 x i16] zeroinitializer, align 1 @words = global [3 x i32] zeroinitializer, align 1 @dwords = global [3 x i64] zeroinitializer, align 1 define void @fn_i16_dotdotdot_i16(i16 %a, ...) { +; O32-BE-LABEL: fn_i16_dotdotdot_i16: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: sw $5, 12($sp) +; O32-BE-NEXT: addiu $1, $sp, 12 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lui $2, %hi(hwords) +; O32-BE-NEXT: addiu $2, $2, %lo(hwords) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sh $1, 2($2) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $3, $1, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sh $1, 4($2) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i16_dotdotdot_i16: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: sw $5, 12($sp) +; O32-LE-NEXT: addiu $1, $sp, 12 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lui $2, %hi(hwords) +; O32-LE-NEXT: addiu $2, $2, %lo(hwords) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sh $1, 2($2) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $3, $1, 4 +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sh $1, 4($2) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i16_dotdotdot_i16: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(hwords) +; N32BE-NEXT: addiu $2, $2, %lo(hwords) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sh $1, 2($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sh $1, 4($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i16_dotdotdot_i16: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(hwords) +; N32LE-NEXT: addiu $2, $2, %lo(hwords) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sh $1, 2($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sh $1, 4($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i16_dotdotdot_i16: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(hwords) +; N64BE-NEXT: daddiu $2, $2, %higher(hwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(hwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(hwords) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sh $1, 2($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sh $1, 4($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i16_dotdotdot_i16: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(hwords) +; N64LE-NEXT: daddiu $2, $2, %higher(hwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(hwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(hwords) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sh $1, 2($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sh $1, 4($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i16_dotdotdot_i16: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; O32-DAG: sw $5, 12([[SP]]) - -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) + ; Initialize variable argument pointer. ; For O32, the offset is 12 due to the 4 bytes used to store local variables, @@ -43,75 +317,37 @@ ; fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 12 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-BE-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA]]) ; Copy the arg to the global -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; ALL-DAG: sh [[ARG1]], 2([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-BE-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA2]]) ; Copy the arg to the global -; ALL-DAG: sh [[ARG2]], 4([[GV]]) %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* @@ -133,27 +369,300 @@ } define void @fn_i16_dotdotdot_i32(i16 %a, ...) { +; O32-BE-LABEL: fn_i16_dotdotdot_i32: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: sw $5, 12($sp) +; O32-BE-NEXT: addiu $1, $sp, 12 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lui $2, %hi(words) +; O32-BE-NEXT: addiu $2, $2, %lo(words) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sw $1, 4($2) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $3, $1, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sw $1, 8($2) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i16_dotdotdot_i32: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: sw $5, 12($sp) +; O32-LE-NEXT: addiu $1, $sp, 12 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lui $2, %hi(words) +; O32-LE-NEXT: addiu $2, $2, %lo(words) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sw $1, 4($2) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $3, $1, 4 +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sw $1, 8($2) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i16_dotdotdot_i32: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(words) +; N32BE-NEXT: addiu $2, $2, %lo(words) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sw $1, 4($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sw $1, 8($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i16_dotdotdot_i32: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(words) +; N32LE-NEXT: addiu $2, $2, %lo(words) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sw $1, 4($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sw $1, 8($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i16_dotdotdot_i32: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(words) +; N64BE-NEXT: daddiu $2, $2, %higher(words) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(words) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(words) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sw $1, 4($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sw $1, 8($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i16_dotdotdot_i32: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(words) +; N64LE-NEXT: daddiu $2, $2, %higher(words) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(words) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(words) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sw $1, 4($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sw $1, 8($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i16_dotdotdot_i32: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; O32-DAG: sw $5, 12([[SP]]) - -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) + ; Initialize variable argument pointer. ; For O32, the offset is 12 due to the 4 bytes used to store local variables, @@ -161,75 +670,37 @@ ; fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 12 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-BE-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA]]) ; Copy the arg to the global -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; ALL-DAG: sw [[ARG1]], 4([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-BE-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA2]]) ; Copy the arg to the global -; ALL-DAG: sw [[ARG2]], 8([[GV]]) %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* @@ -251,27 +722,326 @@ } define void @fn_i16_dotdotdot_i64(i16 %a, ...) { +; O32-BE-LABEL: fn_i16_dotdotdot_i64: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: sw $5, 12($sp) +; O32-BE-NEXT: addiu $1, $sp, 12 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $1, $1, 7 +; O32-BE-NEXT: addiu $2, $zero, -8 +; O32-BE-NEXT: and $1, $1, $2 +; O32-BE-NEXT: ori $3, $1, 4 +; O32-BE-NEXT: lui $4, %hi(dwords) +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: addiu $4, $4, %lo(dwords) +; O32-BE-NEXT: lw $5, 0($1) +; O32-BE-NEXT: sw $5, 8($4) +; O32-BE-NEXT: addiu $3, $3, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 4($1) +; O32-BE-NEXT: sw $1, 12($4) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $1, $1, 7 +; O32-BE-NEXT: and $1, $1, $2 +; O32-BE-NEXT: ori $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lw $3, 0($1) +; O32-BE-NEXT: sw $3, 16($4) +; O32-BE-NEXT: addiu $2, $2, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lw $1, 4($1) +; O32-BE-NEXT: sw $1, 20($4) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i16_dotdotdot_i64: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: sw $5, 12($sp) +; O32-LE-NEXT: addiu $1, $sp, 12 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $1, $1, 7 +; O32-LE-NEXT: addiu $2, $zero, -8 +; O32-LE-NEXT: and $1, $1, $2 +; O32-LE-NEXT: ori $3, $1, 4 +; O32-LE-NEXT: lui $4, %hi(dwords) +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: addiu $3, $3, 4 +; O32-LE-NEXT: addiu $4, $4, %lo(dwords) +; O32-LE-NEXT: lw $5, 0($1) +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 4($1) +; O32-LE-NEXT: sw $1, 12($4) +; O32-LE-NEXT: sw $5, 8($4) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $1, $1, 7 +; O32-LE-NEXT: and $1, $1, $2 +; O32-LE-NEXT: ori $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lw $3, 0($1) +; O32-LE-NEXT: addiu $2, $2, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lw $1, 4($1) +; O32-LE-NEXT: sw $1, 20($4) +; O32-LE-NEXT: sw $3, 16($4) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i16_dotdotdot_i64: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(dwords) +; N32BE-NEXT: addiu $2, $2, %lo(dwords) +; N32BE-NEXT: ld $1, 0($1) +; N32BE-NEXT: sd $1, 8($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: ld $1, 0($1) +; N32BE-NEXT: sd $1, 16($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i16_dotdotdot_i64: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(dwords) +; N32LE-NEXT: addiu $2, $2, %lo(dwords) +; N32LE-NEXT: ld $1, 0($1) +; N32LE-NEXT: sd $1, 8($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: ld $1, 0($1) +; N32LE-NEXT: sd $1, 16($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i16_dotdotdot_i64: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(dwords) +; N64BE-NEXT: daddiu $2, $2, %higher(dwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(dwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(dwords) +; N64BE-NEXT: ld $1, 0($1) +; N64BE-NEXT: sd $1, 8($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: ld $1, 0($1) +; N64BE-NEXT: sd $1, 16($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i16_dotdotdot_i64: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(dwords) +; N64LE-NEXT: daddiu $2, $2, %higher(dwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(dwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(dwords) +; N64LE-NEXT: ld $1, 0($1) +; N64LE-NEXT: sd $1, 8($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: ld $1, 0($1) +; N64LE-NEXT: sd $1, 16($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i16_dotdotdot_i64: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; O32-DAG: sw $5, 12([[SP]]) - -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) + ; Initialize variable argument pointer. ; For O32, the offset is 12 due to the 4 bytes used to store local variables, @@ -279,82 +1049,31 @@ ; fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 12 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] (and realign pointer for O32) -; O32: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA_TMP0:\$[0-9]+]], [[VA]], 7 -; O32-DAG: addiu [[VA_TMP1:\$[0-9]+]], $zero, -8 -; O32-DAG: and [[VA_TMP2:\$[0-9]+]], [[VA_TMP0]], [[VA_TMP1]] -; O32-DAG: ori [[VA2:\$[0-9]+]], [[VA_TMP2]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion and copy it to the global. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA_TMP2]]) -; O32-DAG: sw [[ARG1]], 8([[GV]]) -; O32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 4 -; O32-DAG: sw [[VA3]], 0([[SP]]) -; O32-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA_TMP2]]) -; O32-DAG: sw [[ARG1]], 12([[GV]]) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; NEW-DAG: ld [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-DAG: sd [[ARG1]], 8([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. ; FIXME: We're still aligned from the last one but CodeGen doesn't spot that. -; O32: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA_TMP0:\$[0-9]+]], [[VA]], 7 -; O32-DAG: and [[VA_TMP2:\$[0-9]+]], [[VA_TMP0]], [[VA_TMP1]] -; O32-DAG: ori [[VA2:\$[0-9]+]], [[VA_TMP2]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion and copy it to the global. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; O32-DAG: sw [[ARG2]], 16([[GV]]) -; O32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 4 -; O32-DAG: sw [[VA3]], 0([[SP]]) -; O32-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA_TMP2]]) -; O32-DAG: sw [[ARG2]], 20([[GV]]) -; NEW-DAG: ld [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-DAG: sd [[ARG2]], 16([[GV]]) %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* @@ -376,27 +1095,300 @@ } define void @fn_i32_dotdotdot_i16(i32 %a, ...) { +; O32-BE-LABEL: fn_i32_dotdotdot_i16: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: sw $5, 12($sp) +; O32-BE-NEXT: addiu $1, $sp, 12 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lui $2, %hi(hwords) +; O32-BE-NEXT: addiu $2, $2, %lo(hwords) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sh $1, 2($2) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $3, $1, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sh $1, 4($2) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i32_dotdotdot_i16: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: sw $5, 12($sp) +; O32-LE-NEXT: addiu $1, $sp, 12 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lui $2, %hi(hwords) +; O32-LE-NEXT: addiu $2, $2, %lo(hwords) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sh $1, 2($2) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $3, $1, 4 +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sh $1, 4($2) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i32_dotdotdot_i16: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(hwords) +; N32BE-NEXT: addiu $2, $2, %lo(hwords) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sh $1, 2($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sh $1, 4($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i32_dotdotdot_i16: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(hwords) +; N32LE-NEXT: addiu $2, $2, %lo(hwords) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sh $1, 2($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sh $1, 4($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i32_dotdotdot_i16: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(hwords) +; N64BE-NEXT: daddiu $2, $2, %higher(hwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(hwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(hwords) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sh $1, 2($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sh $1, 4($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i32_dotdotdot_i16: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(hwords) +; N64LE-NEXT: daddiu $2, $2, %higher(hwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(hwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(hwords) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sh $1, 2($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sh $1, 4($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i32_dotdotdot_i16: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; O32-DAG: sw $5, 12([[SP]]) - -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) + ; Initialize variable argument pointer. ; For O32, the offset is 12 due to the 4 bytes used to store local variables, @@ -404,75 +1396,37 @@ ; fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 12 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-BE-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA]]) ; Copy the arg to the global -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; ALL-DAG: sh [[ARG1]], 2([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-BE-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA2]]) ; Copy the arg to the global -; ALL-DAG: sh [[ARG2]], 4([[GV]]) %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* @@ -494,27 +1448,300 @@ } define void @fn_i32_dotdotdot_i32(i32 %a, ...) { +; O32-BE-LABEL: fn_i32_dotdotdot_i32: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: sw $5, 12($sp) +; O32-BE-NEXT: addiu $1, $sp, 12 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lui $2, %hi(words) +; O32-BE-NEXT: addiu $2, $2, %lo(words) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sw $1, 4($2) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $3, $1, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sw $1, 8($2) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i32_dotdotdot_i32: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: sw $5, 12($sp) +; O32-LE-NEXT: addiu $1, $sp, 12 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lui $2, %hi(words) +; O32-LE-NEXT: addiu $2, $2, %lo(words) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sw $1, 4($2) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $3, $1, 4 +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sw $1, 8($2) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i32_dotdotdot_i32: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(words) +; N32BE-NEXT: addiu $2, $2, %lo(words) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sw $1, 4($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sw $1, 8($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i32_dotdotdot_i32: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(words) +; N32LE-NEXT: addiu $2, $2, %lo(words) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sw $1, 4($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sw $1, 8($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i32_dotdotdot_i32: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(words) +; N64BE-NEXT: daddiu $2, $2, %higher(words) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(words) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(words) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sw $1, 4($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sw $1, 8($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i32_dotdotdot_i32: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(words) +; N64LE-NEXT: daddiu $2, $2, %higher(words) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(words) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(words) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sw $1, 4($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sw $1, 8($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i32_dotdotdot_i32: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; O32-DAG: sw $5, 12([[SP]]) - -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) + ; Initialize variable argument pointer. ; For O32, the offset is 12 due to the 4 bytes used to store local variables, @@ -522,75 +1749,37 @@ ; fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 12 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-BE-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA]]) ; Copy the arg to the global -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; ALL-DAG: sw [[ARG1]], 4([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-BE-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA2]]) ; Copy the arg to the global -; ALL-DAG: sw [[ARG2]], 8([[GV]]) %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* @@ -612,27 +1801,326 @@ } define void @fn_i32_dotdotdot_i64(i32 %a, ...) { +; O32-BE-LABEL: fn_i32_dotdotdot_i64: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: sw $5, 12($sp) +; O32-BE-NEXT: addiu $1, $sp, 12 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $1, $1, 7 +; O32-BE-NEXT: addiu $2, $zero, -8 +; O32-BE-NEXT: and $1, $1, $2 +; O32-BE-NEXT: ori $3, $1, 4 +; O32-BE-NEXT: lui $4, %hi(dwords) +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: addiu $4, $4, %lo(dwords) +; O32-BE-NEXT: lw $5, 0($1) +; O32-BE-NEXT: sw $5, 8($4) +; O32-BE-NEXT: addiu $3, $3, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 4($1) +; O32-BE-NEXT: sw $1, 12($4) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $1, $1, 7 +; O32-BE-NEXT: and $1, $1, $2 +; O32-BE-NEXT: ori $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lw $3, 0($1) +; O32-BE-NEXT: sw $3, 16($4) +; O32-BE-NEXT: addiu $2, $2, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lw $1, 4($1) +; O32-BE-NEXT: sw $1, 20($4) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i32_dotdotdot_i64: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: sw $5, 12($sp) +; O32-LE-NEXT: addiu $1, $sp, 12 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $1, $1, 7 +; O32-LE-NEXT: addiu $2, $zero, -8 +; O32-LE-NEXT: and $1, $1, $2 +; O32-LE-NEXT: ori $3, $1, 4 +; O32-LE-NEXT: lui $4, %hi(dwords) +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: addiu $3, $3, 4 +; O32-LE-NEXT: addiu $4, $4, %lo(dwords) +; O32-LE-NEXT: lw $5, 0($1) +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 4($1) +; O32-LE-NEXT: sw $1, 12($4) +; O32-LE-NEXT: sw $5, 8($4) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $1, $1, 7 +; O32-LE-NEXT: and $1, $1, $2 +; O32-LE-NEXT: ori $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lw $3, 0($1) +; O32-LE-NEXT: addiu $2, $2, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lw $1, 4($1) +; O32-LE-NEXT: sw $1, 20($4) +; O32-LE-NEXT: sw $3, 16($4) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i32_dotdotdot_i64: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(dwords) +; N32BE-NEXT: addiu $2, $2, %lo(dwords) +; N32BE-NEXT: ld $1, 0($1) +; N32BE-NEXT: sd $1, 8($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: ld $1, 0($1) +; N32BE-NEXT: sd $1, 16($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i32_dotdotdot_i64: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(dwords) +; N32LE-NEXT: addiu $2, $2, %lo(dwords) +; N32LE-NEXT: ld $1, 0($1) +; N32LE-NEXT: sd $1, 8($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: ld $1, 0($1) +; N32LE-NEXT: sd $1, 16($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i32_dotdotdot_i64: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(dwords) +; N64BE-NEXT: daddiu $2, $2, %higher(dwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(dwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(dwords) +; N64BE-NEXT: ld $1, 0($1) +; N64BE-NEXT: sd $1, 8($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: ld $1, 0($1) +; N64BE-NEXT: sd $1, 16($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i32_dotdotdot_i64: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(dwords) +; N64LE-NEXT: daddiu $2, $2, %higher(dwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(dwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(dwords) +; N64LE-NEXT: ld $1, 0($1) +; N64LE-NEXT: sd $1, 8($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: ld $1, 0($1) +; N64LE-NEXT: sd $1, 16($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i32_dotdotdot_i64: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; O32-DAG: sw $5, 12([[SP]]) - -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) + ; Initialize variable argument pointer. ; For O32, the offset is 12 due to the 4 bytes used to store local variables, @@ -640,82 +2128,31 @@ ; fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 12 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] (and realign pointer for O32) -; O32: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA_TMP0:\$[0-9]+]], [[VA]], 7 -; O32-DAG: addiu [[VA_TMP1:\$[0-9]+]], $zero, -8 -; O32-DAG: and [[VA_TMP2:\$[0-9]+]], [[VA_TMP0]], [[VA_TMP1]] -; O32-DAG: ori [[VA2:\$[0-9]+]], [[VA_TMP2]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion and copy it to the global. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA_TMP2]]) -; O32-DAG: sw [[ARG1]], 8([[GV]]) -; O32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 4 -; O32-DAG: sw [[VA3]], 0([[SP]]) -; O32-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA_TMP2]]) -; O32-DAG: sw [[ARG1]], 12([[GV]]) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; NEW-DAG: ld [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-DAG: sd [[ARG1]], 8([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. ; FIXME: We're still aligned from the last one but CodeGen doesn't spot that. -; O32: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA_TMP0:\$[0-9]+]], [[VA]], 7 -; O32-DAG: and [[VA_TMP2:\$[0-9]+]], [[VA_TMP0]], [[VA_TMP1]] -; O32-DAG: ori [[VA2:\$[0-9]+]], [[VA_TMP2]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion and copy it to the global. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; O32-DAG: sw [[ARG2]], 16([[GV]]) -; O32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; O32-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA_TMP2]]) -; O32-DAG: sw [[ARG2]], 20([[GV]]) -; NEW-DAG: ld [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-DAG: sd [[ARG2]], 16([[GV]]) %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* @@ -737,26 +2174,298 @@ } define void @fn_i64_dotdotdot_i16(i64 %a, ...) { +; O32-BE-LABEL: fn_i64_dotdotdot_i16: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: addiu $1, $sp, 16 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lui $2, %hi(hwords) +; O32-BE-NEXT: addiu $2, $2, %lo(hwords) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sh $1, 2($2) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $3, $1, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sh $1, 4($2) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i64_dotdotdot_i16: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: addiu $1, $sp, 16 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lui $2, %hi(hwords) +; O32-LE-NEXT: addiu $2, $2, %lo(hwords) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sh $1, 2($2) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $3, $1, 4 +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sh $1, 4($2) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i64_dotdotdot_i16: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(hwords) +; N32BE-NEXT: addiu $2, $2, %lo(hwords) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sh $1, 2($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sh $1, 4($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i64_dotdotdot_i16: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(hwords) +; N32LE-NEXT: addiu $2, $2, %lo(hwords) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sh $1, 2($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sh $1, 4($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i64_dotdotdot_i16: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(hwords) +; N64BE-NEXT: daddiu $2, $2, %higher(hwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(hwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(hwords) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sh $1, 2($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sh $1, 4($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i64_dotdotdot_i16: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(hwords) +; N64LE-NEXT: daddiu $2, $2, %higher(hwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(hwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(hwords) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sh $1, 2($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sh $1, 4($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i64_dotdotdot_i16: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) ; Initialize variable argument pointer. ; For O32, the offset is 16 due to the 4 bytes used to store local variables, @@ -764,75 +2473,37 @@ ; first fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 16 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-BE-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA]]) ; Copy the arg to the global -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(hwords) -; ALL-DAG: sh [[ARG1]], 2([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-BE-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA2]]) ; Copy the arg to the global -; ALL-DAG: sh [[ARG2]], 4([[GV]]) %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* @@ -854,26 +2525,298 @@ } define void @fn_i64_dotdotdot_i32(i64 %a, ...) { +; O32-BE-LABEL: fn_i64_dotdotdot_i32: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: addiu $1, $sp, 16 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lui $2, %hi(words) +; O32-BE-NEXT: addiu $2, $2, %lo(words) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sw $1, 4($2) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $3, $1, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 0($1) +; O32-BE-NEXT: sw $1, 8($2) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i64_dotdotdot_i32: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: addiu $1, $sp, 16 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lui $2, %hi(words) +; O32-LE-NEXT: addiu $2, $2, %lo(words) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sw $1, 4($2) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $3, $1, 4 +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 0($1) +; O32-LE-NEXT: sw $1, 8($2) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i64_dotdotdot_i32: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(words) +; N32BE-NEXT: addiu $2, $2, %lo(words) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sw $1, 4($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: lw $1, 4($1) +; N32BE-NEXT: sw $1, 8($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i64_dotdotdot_i32: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(words) +; N32LE-NEXT: addiu $2, $2, %lo(words) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sw $1, 4($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: lw $1, 0($1) +; N32LE-NEXT: sw $1, 8($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i64_dotdotdot_i32: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(words) +; N64BE-NEXT: daddiu $2, $2, %higher(words) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(words) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(words) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sw $1, 4($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: lw $1, 4($1) +; N64BE-NEXT: sw $1, 8($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i64_dotdotdot_i32: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(words) +; N64LE-NEXT: daddiu $2, $2, %higher(words) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(words) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(words) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sw $1, 4($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: lw $1, 0($1) +; N64LE-NEXT: sw $1, 8($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i64_dotdotdot_i32: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) ; Initialize variable argument pointer. ; For O32, the offset is 16 due to the 4 bytes used to store local variables, @@ -881,75 +2824,37 @@ ; first fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 16 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-BE-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA]]) ; Copy the arg to the global -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(words) -; ALL-DAG: sw [[ARG1]], 4([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. -; O32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; NEW-LE-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-BE-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA2]]) ; Copy the arg to the global -; ALL-DAG: sw [[ARG2]], 8([[GV]]) %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* @@ -971,26 +2876,324 @@ } define void @fn_i64_dotdotdot_i64(i64 %a, ...) { +; O32-BE-LABEL: fn_i64_dotdotdot_i64: +; O32-BE: # %bb.0: # %entry +; O32-BE-NEXT: addiu $sp, $sp, -8 +; O32-BE-NEXT: .cfi_def_cfa_offset 8 +; O32-BE-NEXT: sw $7, 20($sp) +; O32-BE-NEXT: sw $6, 16($sp) +; O32-BE-NEXT: addiu $1, $sp, 16 +; O32-BE-NEXT: sw $1, 0($sp) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 1 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $1, $1, 7 +; O32-BE-NEXT: addiu $2, $zero, -8 +; O32-BE-NEXT: and $1, $1, $2 +; O32-BE-NEXT: ori $3, $1, 4 +; O32-BE-NEXT: lui $4, %hi(dwords) +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: addiu $4, $4, %lo(dwords) +; O32-BE-NEXT: lw $5, 0($1) +; O32-BE-NEXT: sw $5, 8($4) +; O32-BE-NEXT: addiu $3, $3, 4 +; O32-BE-NEXT: sw $3, 0($sp) +; O32-BE-NEXT: lw $1, 4($1) +; O32-BE-NEXT: sw $1, 12($4) +; O32-BE-NEXT: #APP +; O32-BE-NEXT: .set push +; O32-BE-NEXT: .set at +; O32-BE-NEXT: .set macro +; O32-BE-NEXT: .set reorder +; O32-BE-NEXT: +; O32-BE-NEXT: teqi $zero, 2 +; O32-BE-NEXT: +; O32-BE-NEXT: .set pop +; O32-BE-NEXT: #NO_APP +; O32-BE-NEXT: lw $1, 0($sp) +; O32-BE-NEXT: addiu $1, $1, 7 +; O32-BE-NEXT: and $1, $1, $2 +; O32-BE-NEXT: ori $2, $1, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lw $3, 0($1) +; O32-BE-NEXT: sw $3, 16($4) +; O32-BE-NEXT: addiu $2, $2, 4 +; O32-BE-NEXT: sw $2, 0($sp) +; O32-BE-NEXT: lw $1, 4($1) +; O32-BE-NEXT: sw $1, 20($4) +; O32-BE-NEXT: jr $ra +; O32-BE-NEXT: addiu $sp, $sp, 8 +; +; O32-LE-LABEL: fn_i64_dotdotdot_i64: +; O32-LE: # %bb.0: # %entry +; O32-LE-NEXT: addiu $sp, $sp, -8 +; O32-LE-NEXT: .cfi_def_cfa_offset 8 +; O32-LE-NEXT: sw $7, 20($sp) +; O32-LE-NEXT: sw $6, 16($sp) +; O32-LE-NEXT: addiu $1, $sp, 16 +; O32-LE-NEXT: sw $1, 0($sp) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 1 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $1, $1, 7 +; O32-LE-NEXT: addiu $2, $zero, -8 +; O32-LE-NEXT: and $1, $1, $2 +; O32-LE-NEXT: ori $3, $1, 4 +; O32-LE-NEXT: lui $4, %hi(dwords) +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: addiu $3, $3, 4 +; O32-LE-NEXT: addiu $4, $4, %lo(dwords) +; O32-LE-NEXT: lw $5, 0($1) +; O32-LE-NEXT: sw $3, 0($sp) +; O32-LE-NEXT: lw $1, 4($1) +; O32-LE-NEXT: sw $1, 12($4) +; O32-LE-NEXT: sw $5, 8($4) +; O32-LE-NEXT: #APP +; O32-LE-NEXT: .set push +; O32-LE-NEXT: .set at +; O32-LE-NEXT: .set macro +; O32-LE-NEXT: .set reorder +; O32-LE-NEXT: +; O32-LE-NEXT: teqi $zero, 2 +; O32-LE-NEXT: +; O32-LE-NEXT: .set pop +; O32-LE-NEXT: #NO_APP +; O32-LE-NEXT: lw $1, 0($sp) +; O32-LE-NEXT: addiu $1, $1, 7 +; O32-LE-NEXT: and $1, $1, $2 +; O32-LE-NEXT: ori $2, $1, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lw $3, 0($1) +; O32-LE-NEXT: addiu $2, $2, 4 +; O32-LE-NEXT: sw $2, 0($sp) +; O32-LE-NEXT: lw $1, 4($1) +; O32-LE-NEXT: sw $1, 20($4) +; O32-LE-NEXT: sw $3, 16($4) +; O32-LE-NEXT: jr $ra +; O32-LE-NEXT: addiu $sp, $sp, 8 +; +; N32BE-LABEL: fn_i64_dotdotdot_i64: +; N32BE: # %bb.0: # %entry +; N32BE-NEXT: addiu $sp, $sp, -64 +; N32BE-NEXT: .cfi_def_cfa_offset 64 +; N32BE-NEXT: sd $11, 56($sp) +; N32BE-NEXT: sd $10, 48($sp) +; N32BE-NEXT: sd $9, 40($sp) +; N32BE-NEXT: sd $8, 32($sp) +; N32BE-NEXT: sd $7, 24($sp) +; N32BE-NEXT: sd $6, 16($sp) +; N32BE-NEXT: sd $5, 8($sp) +; N32BE-NEXT: addiu $1, $sp, 8 +; N32BE-NEXT: sw $1, 0($sp) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 1 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $2, $1, 8 +; N32BE-NEXT: sw $2, 0($sp) +; N32BE-NEXT: lui $2, %hi(dwords) +; N32BE-NEXT: addiu $2, $2, %lo(dwords) +; N32BE-NEXT: ld $1, 0($1) +; N32BE-NEXT: sd $1, 8($2) +; N32BE-NEXT: #APP +; N32BE-NEXT: .set push +; N32BE-NEXT: .set at +; N32BE-NEXT: .set macro +; N32BE-NEXT: .set reorder +; N32BE-NEXT: +; N32BE-NEXT: teqi $zero, 2 +; N32BE-NEXT: +; N32BE-NEXT: .set pop +; N32BE-NEXT: #NO_APP +; N32BE-NEXT: lw $1, 0($sp) +; N32BE-NEXT: addiu $3, $1, 8 +; N32BE-NEXT: sw $3, 0($sp) +; N32BE-NEXT: ld $1, 0($1) +; N32BE-NEXT: sd $1, 16($2) +; N32BE-NEXT: jr $ra +; N32BE-NEXT: addiu $sp, $sp, 64 +; +; N32LE-LABEL: fn_i64_dotdotdot_i64: +; N32LE: # %bb.0: # %entry +; N32LE-NEXT: addiu $sp, $sp, -64 +; N32LE-NEXT: .cfi_def_cfa_offset 64 +; N32LE-NEXT: sd $11, 56($sp) +; N32LE-NEXT: sd $10, 48($sp) +; N32LE-NEXT: sd $9, 40($sp) +; N32LE-NEXT: sd $8, 32($sp) +; N32LE-NEXT: sd $7, 24($sp) +; N32LE-NEXT: sd $6, 16($sp) +; N32LE-NEXT: sd $5, 8($sp) +; N32LE-NEXT: addiu $1, $sp, 8 +; N32LE-NEXT: sw $1, 0($sp) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 1 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $2, $1, 8 +; N32LE-NEXT: sw $2, 0($sp) +; N32LE-NEXT: lui $2, %hi(dwords) +; N32LE-NEXT: addiu $2, $2, %lo(dwords) +; N32LE-NEXT: ld $1, 0($1) +; N32LE-NEXT: sd $1, 8($2) +; N32LE-NEXT: #APP +; N32LE-NEXT: .set push +; N32LE-NEXT: .set at +; N32LE-NEXT: .set macro +; N32LE-NEXT: .set reorder +; N32LE-NEXT: +; N32LE-NEXT: teqi $zero, 2 +; N32LE-NEXT: +; N32LE-NEXT: .set pop +; N32LE-NEXT: #NO_APP +; N32LE-NEXT: lw $1, 0($sp) +; N32LE-NEXT: addiu $3, $1, 8 +; N32LE-NEXT: sw $3, 0($sp) +; N32LE-NEXT: ld $1, 0($1) +; N32LE-NEXT: sd $1, 16($2) +; N32LE-NEXT: jr $ra +; N32LE-NEXT: addiu $sp, $sp, 64 +; +; N64BE-LABEL: fn_i64_dotdotdot_i64: +; N64BE: # %bb.0: # %entry +; N64BE-NEXT: daddiu $sp, $sp, -64 +; N64BE-NEXT: .cfi_def_cfa_offset 64 +; N64BE-NEXT: sd $11, 56($sp) +; N64BE-NEXT: sd $10, 48($sp) +; N64BE-NEXT: sd $9, 40($sp) +; N64BE-NEXT: sd $8, 32($sp) +; N64BE-NEXT: sd $7, 24($sp) +; N64BE-NEXT: sd $6, 16($sp) +; N64BE-NEXT: sd $5, 8($sp) +; N64BE-NEXT: daddiu $1, $sp, 8 +; N64BE-NEXT: sd $1, 0($sp) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 1 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $2, $1, 8 +; N64BE-NEXT: sd $2, 0($sp) +; N64BE-NEXT: lui $2, %highest(dwords) +; N64BE-NEXT: daddiu $2, $2, %higher(dwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %hi(dwords) +; N64BE-NEXT: dsll $2, $2, 16 +; N64BE-NEXT: daddiu $2, $2, %lo(dwords) +; N64BE-NEXT: ld $1, 0($1) +; N64BE-NEXT: sd $1, 8($2) +; N64BE-NEXT: #APP +; N64BE-NEXT: .set push +; N64BE-NEXT: .set at +; N64BE-NEXT: .set macro +; N64BE-NEXT: .set reorder +; N64BE-NEXT: +; N64BE-NEXT: teqi $zero, 2 +; N64BE-NEXT: +; N64BE-NEXT: .set pop +; N64BE-NEXT: #NO_APP +; N64BE-NEXT: ld $1, 0($sp) +; N64BE-NEXT: daddiu $3, $1, 8 +; N64BE-NEXT: sd $3, 0($sp) +; N64BE-NEXT: ld $1, 0($1) +; N64BE-NEXT: sd $1, 16($2) +; N64BE-NEXT: jr $ra +; N64BE-NEXT: daddiu $sp, $sp, 64 +; +; N64LE-LABEL: fn_i64_dotdotdot_i64: +; N64LE: # %bb.0: # %entry +; N64LE-NEXT: daddiu $sp, $sp, -64 +; N64LE-NEXT: .cfi_def_cfa_offset 64 +; N64LE-NEXT: sd $11, 56($sp) +; N64LE-NEXT: sd $10, 48($sp) +; N64LE-NEXT: sd $9, 40($sp) +; N64LE-NEXT: sd $8, 32($sp) +; N64LE-NEXT: sd $7, 24($sp) +; N64LE-NEXT: sd $6, 16($sp) +; N64LE-NEXT: sd $5, 8($sp) +; N64LE-NEXT: daddiu $1, $sp, 8 +; N64LE-NEXT: sd $1, 0($sp) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 1 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $2, $1, 8 +; N64LE-NEXT: sd $2, 0($sp) +; N64LE-NEXT: lui $2, %highest(dwords) +; N64LE-NEXT: daddiu $2, $2, %higher(dwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %hi(dwords) +; N64LE-NEXT: dsll $2, $2, 16 +; N64LE-NEXT: daddiu $2, $2, %lo(dwords) +; N64LE-NEXT: ld $1, 0($1) +; N64LE-NEXT: sd $1, 8($2) +; N64LE-NEXT: #APP +; N64LE-NEXT: .set push +; N64LE-NEXT: .set at +; N64LE-NEXT: .set macro +; N64LE-NEXT: .set reorder +; N64LE-NEXT: +; N64LE-NEXT: teqi $zero, 2 +; N64LE-NEXT: +; N64LE-NEXT: .set pop +; N64LE-NEXT: #NO_APP +; N64LE-NEXT: ld $1, 0($sp) +; N64LE-NEXT: daddiu $3, $1, 8 +; N64LE-NEXT: sd $3, 0($sp) +; N64LE-NEXT: ld $1, 0($1) +; N64LE-NEXT: sd $1, 16($2) +; N64LE-NEXT: jr $ra +; N64LE-NEXT: daddiu $sp, $sp, 64 entry: -; ALL-LABEL: fn_i64_dotdotdot_i64: ; Set up the stack with an 8-byte local area. N32/N64 must also make room for ; the argument save area (56 bytes). -; O32: addiu [[SP:\$sp]], $sp, -8 -; N32: addiu [[SP:\$sp]], $sp, -64 -; N64: daddiu [[SP:\$sp]], $sp, -64 ; Save variable argument portion on the stack -; O32-DAG: sw $7, 20([[SP]]) -; O32-DAG: sw $6, 16([[SP]]) -; NEW-DAG: sd $11, 56([[SP]]) -; NEW-DAG: sd $10, 48([[SP]]) -; NEW-DAG: sd $9, 40([[SP]]) -; NEW-DAG: sd $8, 32([[SP]]) -; NEW-DAG: sd $7, 24([[SP]]) -; NEW-DAG: sd $6, 16([[SP]]) -; NEW-DAG: sd $5, 8([[SP]]) ; Initialize variable argument pointer. ; For O32, the offset is 16 due to the 4 bytes used to store local variables, @@ -998,82 +3201,31 @@ ; first fixed argument. ; For N32/N64, it is only 8 since the fixed arguments do not reserve stack ; space. -; O32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 16 -; O32-DAG: sw [[VA]], 0([[SP]]) -; N32-DAG: addiu [[VA:\$[0-9]+]], [[SP]], 8 -; N32-DAG: sw [[VA]], 0([[SP]]) -; N64-DAG: daddiu [[VA:\$[0-9]+]], [[SP]], 8 -; N64-DAG: sd [[VA]], 0([[SP]]) ; Store [[VA]] -; O32-DAG: sw [[VA]], 0([[SP]]) -; ALL: teqi $zero, 1 ; Increment [[VA]] (and realign pointer for O32) -; O32: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA_TMP0:\$[0-9]+]], [[VA]], 7 -; O32-DAG: addiu [[VA_TMP1:\$[0-9]+]], $zero, -8 -; O32-DAG: and [[VA_TMP2:\$[0-9]+]], [[VA_TMP0]], [[VA_TMP1]] -; O32-DAG: ori [[VA2:\$[0-9]+]], [[VA_TMP2]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N32-DAG: sw [[VA2]], 0([[SP]]) -; N64-DAG: ld [[VA:\$[0-9]+]], 0([[SP]]) -; N64-DAG: addiu [[VA2:\$[0-9]+]], [[VA]], 8 -; N64-DAG: sd [[VA2]], 0([[SP]]) ; Load the first argument from the variable portion and copy it to the global. ; This has used the stack pointer directly rather than the [[VA]] we just set ; up. ; Big-endian mode for N32/N64 must add an additional 4 to the offset due to byte ; order. -; O32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; O32-DAG: lw [[ARG1:\$[0-9]+]], 0([[VA]]) -; O32-DAG: sw [[ARG1]], 8([[GV]]) -; O32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 4 -; O32-DAG: sw [[VA3]], 0([[SP]]) -; O32-DAG: lw [[ARG1:\$[0-9]+]], 4([[VA_TMP2]]) -; O32-DAG: sw [[ARG1]], 12([[GV]]) -; N32-DAG: addiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; N64-DAG: daddiu [[GV:\$[0-9]+]], ${{[0-9]+}}, %lo(dwords) -; NEW-DAG: ld [[ARG1:\$[0-9]+]], 0([[VA]]) -; NEW-DAG: sd [[ARG1]], 8([[GV]]) -; ALL: teqi $zero, 2 ; Increment [[VA]] again. ; FIXME: We're still aligned from the last one but CodeGen doesn't spot that. -; O32: lw [[VA:\$[0-9]+]], 0([[SP]]) -; O32-DAG: addiu [[VA_TMP0:\$[0-9]+]], [[VA]], 7 -; O32-DAG: and [[VA_TMP2:\$[0-9]+]], [[VA_TMP0]], [[VA_TMP1]] -; O32-DAG: ori [[VA2:\$[0-9]+]], [[VA_TMP2]], 4 -; O32-DAG: sw [[VA2]], 0([[SP]]) -; N32-DAG: lw [[VA2:\$[0-9]+]], 0([[SP]]) -; N32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N32-DAG: sw [[VA3]], 0([[SP]]) -; N64-DAG: ld [[VA2:\$[0-9]+]], 0([[SP]]) -; N64-DAG: daddiu [[VA3:\$[0-9]+]], [[VA2]], 8 -; N64-DAG: sd [[VA3]], 0([[SP]]) ; Load the second argument from the variable portion and copy it to the global. -; O32-DAG: lw [[ARG2:\$[0-9]+]], 0([[VA]]) -; O32-DAG: sw [[ARG2]], 16([[GV]]) -; O32-DAG: addiu [[VA3:\$[0-9]+]], [[VA2]], 4 -; O32-DAG: sw [[VA3]], 0([[SP]]) -; O32-DAG: lw [[ARG2:\$[0-9]+]], 4([[VA_TMP2]]) -; O32-DAG: sw [[ARG2]], 20([[GV]]) - -; NEW-DAG: ld [[ARG2:\$[0-9]+]], 0([[VA2]]) -; NEW-DAG: sd [[ARG2]], 16([[GV]]) + %ap = alloca i8*, align 8 %ap2 = bitcast i8** %ap to i8* Index: utils/UpdateTestChecks/asm.py =================================================================== --- utils/UpdateTestChecks/asm.py +++ utils/UpdateTestChecks/asm.py @@ -38,11 +38,12 @@ r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?' # f: (name of func) r'(?:^[ \t]+\.(frame|f?mask|set).*?\n)+' # Mips+LLVM standard asm prologue r'(?P.*?)\n' # (body of the function) - r'(?:^[ \t]+\.(set|end).*?\n)+' # Mips+LLVM standard asm epilogue r'(\$|\.L)func_end[0-9]+:\n', # $func_end0: (mips32 - O32) or # .Lfunc_end0: (mips64 - NewABI) flags=(re.M | re.S)) +SCRUB_MIPS_END_MODES = re.compile(r'(\s+\.set\s.+\n){3}\s+\.end\s+.+') + ASM_FUNCTION_PPC_RE = re.compile( r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' r'\.Lfunc_begin[0-9]+:\n' @@ -146,6 +147,10 @@ asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) # Expand the tabs used for indentation. asm = string.expandtabs(asm, 2) + + # Scrub out trailing .set, .end of a function + asm = SCRUB_MIPS_END_MODES.sub(r'', asm) + # Strip trailing whitespace. asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) return asm