# Changeset View

Changeset View

# Standalone View

Standalone View

# test/CodeGen/PowerPC/no-extra-fp-conv-ldst.ll

Show All 30 Lines | |||||

31 | ; Function Attrs: nounwind readnone | 31 | ; Function Attrs: nounwind readnone | ||

32 | define float @foo(float %X) #0 { | 32 | define float @foo(float %X) #0 { | ||

33 | entry: | 33 | entry: | ||

34 | %conv = fptosi float %X to i32 | 34 | %conv = fptosi float %X to i32 | ||

35 | %conv1 = sitofp i32 %conv to float | 35 | %conv1 = sitofp i32 %conv to float | ||

36 | ret float %conv1 | 36 | ret float %conv1 | ||

37 | 37 | | |||

38 | ; CHECK-LABEL: @foo | 38 | ; CHECK-LABEL: @foo | ||

39 | ; CHECK-DAG: fctiwz [[REG2:[0-9]+]], 1 | 39 | ; CHECK: friz 1, 1 | ||

40 | ; CHECK-DAG: addi [[REG1:[0-9]+]], 1, | | |||

41 | ; CHECK: stfiwx [[REG2]], 0, [[REG1]] | | |||

42 | ; CHECK: lfiwax [[REG3:[0-9]+]], 0, [[REG1]] | | |||

43 | ; CHECK: fcfids 1, [[REG3]] | | |||

44 | ; CHECK: blr | 40 | ; CHECK: blr | ||

45 | } | 41 | } | ||

46 | 42 | | |||

47 | ; Function Attrs: nounwind readnone | 43 | ; Function Attrs: nounwind readnone | ||

48 | define double @food(double %X) #0 { | 44 | define double @food(double %X) #0 { | ||

49 | entry: | 45 | entry: | ||

50 | %conv = fptosi double %X to i32 | 46 | %conv = fptosi double %X to i32 | ||

51 | %conv1 = sitofp i32 %conv to double | 47 | %conv1 = sitofp i32 %conv to double | ||

52 | ret double %conv1 | 48 | ret double %conv1 | ||

53 | 49 | | |||

54 | ; CHECK-LABEL: @food | 50 | ; CHECK-LABEL: @food | ||

55 | ; CHECK-DAG: fctiwz [[REG2:[0-9]+]], 1 | 51 | ; CHECK: friz 1, 1 | ||

56 | ; CHECK-DAG: addi [[REG1:[0-9]+]], 1, | | |||

57 | ; CHECK: stfiwx [[REG2]], 0, [[REG1]] | | |||

58 | ; CHECK: lfiwax [[REG3:[0-9]+]], 0, [[REG1]] | | |||

59 | ; CHECK: fcfid 1, [[REG3]] | | |||

60 | ; CHECK: blr | 52 | ; CHECK: blr | ||

61 | } | 53 | } | ||

62 | 54 | | |||

63 | ; Function Attrs: nounwind readnone | 55 | ; Function Attrs: nounwind readnone | ||

64 | define float @foou(float %X) #0 { | 56 | define float @foou(float %X) #0 { | ||

65 | entry: | 57 | entry: | ||

66 | %conv = fptoui float %X to i32 | 58 | %conv = fptoui float %X to i32 | ||

67 | %conv1 = uitofp i32 %conv to float | 59 | %conv1 = uitofp i32 %conv to float | ||

68 | ret float %conv1 | 60 | ret float %conv1 | ||

69 | 61 | | |||

70 | ; CHECK-LABEL: @foou | 62 | ; CHECK-LABEL: @foou | ||

71 | ; CHECK-DAG: fctiwuz [[REG2:[0-9]+]], 1 | 63 | ; CHECK: friz 1, 1 | ||

72 | ; CHECK-DAG: addi [[REG1:[0-9]+]], 1, | | |||

73 | ; CHECK: stfiwx [[REG2]], 0, [[REG1]] | | |||

74 | ; CHECK: lfiwzx [[REG3:[0-9]+]], 0, [[REG1]] | | |||

75 | ; CHECK: fcfidus 1, [[REG3]] | | |||

76 | ; CHECK: blr | 64 | ; CHECK: blr | ||

77 | } | 65 | } | ||

78 | 66 | | |||

79 | ; Function Attrs: nounwind readnone | 67 | ; Function Attrs: nounwind readnone | ||

80 | define double @fooud(double %X) #0 { | 68 | define double @fooud(double %X) #0 { | ||

81 | entry: | 69 | entry: | ||

82 | %conv = fptoui double %X to i32 | 70 | %conv = fptoui double %X to i32 | ||

83 | %conv1 = uitofp i32 %conv to double | 71 | %conv1 = uitofp i32 %conv to double | ||

84 | ret double %conv1 | 72 | ret double %conv1 | ||

85 | 73 | | |||

86 | ; CHECK-LABEL: @fooud | 74 | ; CHECK-LABEL: @fooud | ||

87 | ; CHECK-DAG: fctiwuz [[REG2:[0-9]+]], 1 | 75 | ; CHECK: friz 1, 1 | ||

88 | ; CHECK-DAG: addi [[REG1:[0-9]+]], 1, | | |||

89 | ; CHECK: stfiwx [[REG2]], 0, [[REG1]] | | |||

90 | ; CHECK: lfiwzx [[REG3:[0-9]+]], 0, [[REG1]] | | |||

91 | ; CHECK: fcfidu 1, [[REG3]] | | |||

92 | ; CHECK: blr | 76 | ; CHECK: blr | ||

93 | } | 77 | } | ||

94 | 78 | | |||

95 | attributes #0 = { nounwind readonly } | 79 | attributes #0 = { nounwind readonly } | ||

96 | 80 | |